How to buy BetVerse Token in API
This session show how to buy betverse tokens through this API.
POST
https://{providerApiEndpoint}/api/v1/token/buy
REQUEST HEADERS
Header | Value |
---|---|
Content-Type | application/json |
api_key | api_value |
REQUEST BODY
Field | Type | Description |
---|---|---|
userAddress | String | The address from exchange wallet, this address must have founds to send tokens to destinatary. |
destinatary | String | The customer address that will receive tokens. |
amount | String | The amount in USD that customer desire transform in tokens. |
usdAddress | String | The address of stable coin that you wish use to make the trade (DAI, USDT, USDC) |
REQUEST EXAMPLES
{
"userAddress": "0x2dfFF737EB054DED9795d96d6d9B9909896BB940",
"destinatary": "0x2d8CB20c42D9E60Dc40e4e336a2cE7A97128a0aB",
"amount": "1",
"usdAddress": "0xcb1e72786a6eb3b44c2a2429e317c8a2462cfeb1",
}
curl --location --request POST 'https://{providerApiEndpoint}/api/v1/token/buy' \
--header 'api_key: api_value' \
--header 'Content-Type: application/json' \
--data-raw '{
"userAddress": "0x2dfFF737EB054DED9795d96d6d9B9909896BB940",
"destinatary": "0x2dfFF737EB054DED9795d96d6d9B9909896BB940",
"amount": "1",
"usdAddress": "0xcb1e72786a6eb3b44c2a2429e317c8a2462cfeb1",
}'
RESPONSE BODY
{
"blockHash": "0x4a38803da6977b7be909112935b72bd0dd9101a8c6fe69382e600f8e7307791b",
"blockNumber": 28072872,
"contractAddress": null,
"cumulativeGasUsed": 5676234,
"effectiveGasPrice": 2500000011,
"from": "0x2dfff737eb054ded9795d96d6d9b9909896bb940",
"gasUsed": 79551,
"logsBloom": "0x00000000000000020000000000000000000000000000000000000000020000000000000000000002000000000000000000008400000000000000000000000000000000000000001000000008000000800000000000000000000100000000000010000000008000000000000000000000000000000000000080080010000000000000002000000000000000000010000000000000000000000000000000000000200000000000040020000000000000000001000000000000000000000000004000000002000000000001000004000000000000000000000000100000000000000000000000008000000000000000080800000000000000000000000000900000",
"status": true,
"to": "0xb860e974fbe07f13f2ea2c39865958292aea1efe",
"transactionHash": "0x02485148d22293eb39ba3a19b8a3e1c4557b45eb8585020901bc199a83f48995",
"transactionIndex": 30,
"type": "0x2",
"events": {
"0": {
"address": "0xcB1e72786A6eb3b44C2a2429e317c8a2462CFeb1",
"blockHash": "0x4a38803da6977b7be909112935b72bd0dd9101a8c6fe69382e600f8e7307791b",
"blockNumber": 28072872,
"logIndex": 164,
"removed": false,
"transactionHash": "0x02485148d22293eb39ba3a19b8a3e1c4557b45eb8585020901bc199a83f48995",
"transactionIndex": 30,
"id": "log_f97f7400",
"returnValues": {},
"signature": null,
"raw": {
"data": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000",
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x0000000000000000000000002dfff737eb054ded9795d96d6d9b9909896bb940",
"0x000000000000000000000000b860e974fbe07f13f2ea2c39865958292aea1efe"
]
}
},
"1": {
"address": "0x6476846bb6138676c2FF4f78dFCB580a9B31DbDe",
"blockHash": "0x4a38803da6977b7be909112935b72bd0dd9101a8c6fe69382e600f8e7307791b",
"blockNumber": 28072872,
"logIndex": 165,
"removed": false,
"transactionHash": "0x02485148d22293eb39ba3a19b8a3e1c4557b45eb8585020901bc199a83f48995",
"transactionIndex": 30,
"id": "log_5eb1ac75",
"returnValues": {},
"signature": null,
"raw": {
"data": "0x0000000000000000000000000000000000000000000000008ac7230489e80000",
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x000000000000000000000000b860e974fbe07f13f2ea2c39865958292aea1efe",
"0x0000000000000000000000002d8cb20c42d9e60dc40e4e336a2ce7a97128a0ab"
]
}
},
"2": {
"address": "0x0000000000000000000000000000000000001010",
"blockHash": "0x4a38803da6977b7be909112935b72bd0dd9101a8c6fe69382e600f8e7307791b",
"blockNumber": 28072872,
"logIndex": 166,
"removed": false,
"transactionHash": "0x02485148d22293eb39ba3a19b8a3e1c4557b45eb8585020901bc199a83f48995",
"transactionIndex": 30,
"id": "log_6a5d4915",
"returnValues": {},
"signature": null,
"raw": {
"data": "0x0000000000000000000000000000000000000000000000000000b4e0c6bdc700000000000000000000000000000000000000000000000031dddc27e5601c41dd000000000000000000000000000000000000000000001535734dbde8794b5eaa000000000000000000000000000000000000000000000031dddb7304995e7add000000000000000000000000000000000000000000001535734e72c9400925aa",
"topics": [
"0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63",
"0x0000000000000000000000000000000000000000000000000000000000001010",
"0x0000000000000000000000002dfff737eb054ded9795d96d6d9b9909896bb940",
"0x000000000000000000000000c26880a0af2ea0c7e8130e6ec47af756465452e8"
]
}
}
}
}