Creates an unsigned ICO token purchase transaction,equivalent to purchaseAsset.
Usage
visionWeb.transactionBuilder.purchaseToken(
issuerAddress,
tokenId,
amount,
buyer,
options
);
Parameters
Parameter | Description | Type | Default |
---|---|---|---|
issuerAddress | Address issuing the token. | string | - |
tokenId | Name of the token, matching the exact capitalization. | string | number | - |
amount | Amount of tokens to buy. | object | - |
buyer | Optional address purchasing the tokens. | string | Default account address |
options | Descriptions are below. | object | - |
options parameters
Parameter | Description | Type | Default |
---|---|---|---|
permissionId | The permission Id,optional, for multi-signature use. | number | - |
Returns
Object.
Example
visionWeb.transactionBuilder.purchaseToken("4653cd48c2723cb985679f4e44d99c64d22d89f41d","1000001",1000);
> {
visible: false,
txID: 'e956a134e9f55121bfa7e45e75cbde4f82037a05f9ef8a27ac5e11a6f87f0676',
raw_data: {
contract: [ [Object] ],
ref_block_bytes: '48ad',
ref_block_hash: 'f5312b2bdeedcf8e',
expiration: 1608468477000,
timestamp: 1608468419037
},
raw_data_hex: '0a0248ad2208f5312b2bdeedcf8e40c8e8c481e82e5a65080112610a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412300a154653cd48c2723cb985679f4e44d99c64d22d89f41d1215462d7a77f8bef6fe225bf5e353dd6a380f588a1496180a70dda3c181e82e'
}