Token
JavaScript Token Functions
Buy with fiat
Description
Returns a url of a widget where the user can buy a Token using a credit / debit card see the Token Checkout integration guidelines for more details about this feature.
Parameters
Name | Type | Required | Description |
---|---|---|---|
tokenID | String | ✔️ | The ID of the Token, the widget will collect the data to present the Token from the backend |
data | Record<any, any> | Extra data that diffuses to the backend | |
toWalletAddress | String | The wallet address that the Token will be send to, If the wallet was created by tweed the wallet address will be populated automatically. | |
amount | String | The default amount of the Token displayed on the widget. The user can modify this value. |
Return type
Example of usage
Get balance
Description
Returns the current balance of tokens in the user's wallet for multiple blockchains
Parameters
Name | Type | Required | Default | Description |
---|---|---|---|---|
blockchainIds | String[] | defaultBlockchainIds | Blockchain ids |
Return type
Usage Example
Response Example
Get transactions
Description
Returns a list of token transactions for multiple blockchains
Parameters
Name | Type | Required | Default | Description |
---|---|---|---|---|
blockchainIds | String[] | defaultBlockchainIds | Blockchain ids |
Return type
Usage Example
Response Example
Send to user
Description
Sends a token to another user on the platform by its user ID. The user will get a Sign Transaction widget to approve the transaction.
Parameters
Name | Type | Required | Default | Description |
---|---|---|---|---|
blockchainId | String | ✔️ | Blockchain | |
value | String | ✔️ | value of crypto | |
tokenAddress | String | ✔️ | The contract address of the token | |
userId | String | ✔️ | Id of user to send crypto to |
Return type
Usage Example
Send to wallet
Description
Sends a token to other wallet by its wallet address. The user will get a Sign Transaction widget to approve the transaction.
Parameters
Name | Type | Required | Default | Description |
---|---|---|---|---|
blockchainId | String | ✔️ | Blockchain | |
value | String | ✔️ | value of crypto | |
tokenAddress | String | ✔️ | The contract address of the token | |
walletAddress | String | ✔️ | Address of wallet to send crypto to |
Return type
Usage Example
Last updated