Token
Token React Widgets and Modals
Get Method Widgets and Modals
To use the widgets in React components you need to import the Widget
component:
Every widget has an optional parameter called settings
.
Name | Type | Required | Default | Description |
---|---|---|---|---|
fullScreen | Boolean | true | Should widget be shown fullscreen | |
hideMenu | Boolean | true | Deprecated | |
preventClose | Boolean | true | Hides close button |
You can provide them to the widget like this:
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 | Default | Description |
---|---|---|---|---|
tokenID | String | ✔️ | The ID of the Token, the widget will collect the data to present the Token from the backend | |
amount | String | 1 | The default amount of the Token displayed on the widget. The user can modify this value. |
Usage Example
Send to user
Description
Sends a token to other user in 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 | ✔️ | Amount of crypto | |
tokenAddress | String | ✔️ | The contract address of the token | |
onClose |
| Close callback | ||
onError |
| Error callback | ||
onSuccess |
| Success callback | ||
userId | String | ✔️ | Id of user to send crypto to |
Usage Example
Send to wallet
Description
Sends a token to another 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 | ✔️ | Amount of crypto | |
tokenAddress | String | ✔️ | Contract address of a token | |
onClose |
| Close callback | ||
onError |
| Error callback | ||
onSuccess |
| Success callback | ||
walletAddress | String | ✔️ | Address of wallet to send crypto to |
Usage Example
Post Method Widgets and Modals
Mutation Parameters
Name | Type | Required | Default | Description |
---|---|---|---|---|
widget parameters | Widget parameters |
Usage Example
Send token to user
Description
Show modal for sending token to user with specified address and amount, by using your internal user id.
Callback Parameters
Name | Type | Required | Default | Description |
---|---|---|---|---|
blockchainId | String | ✔️ | Blockchain | |
value | String | ✔️ | Amount of crypto | |
tokenAddress | String | ✔️ | The contract address of the token | |
userId | String | ✔️ | Id of user to send crypto to |
Usage Example
Send token to wallet
Description
Show modal for sending token to address with specified amount.
Callback Parameters
Name | Type | Required | Default | Description |
---|---|---|---|---|
blockchainId | String | ✔️ | Blockchain | |
value | String | ✔️ | Amount of crypto | |
tokenAddress | String | ✔️ | The contract address of the token | |
walletAddress | String | ✔️ | address of wallet to send crypto to |
Usage Example
Last updated