curl --request POST \
--url https://api.blockradar.co/v1/wallets/{walletId}/contracts/write \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '{
"abi": [
{
"constant": false,
"inputs": [
{
"name": "_to",
"type": "address"
},
{
"name": "_value",
"type": "uint256"
}
],
"name": "transfer",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
}
],
"address": "0x337610d27c682E347C9cD60BD4b3b107C9d34dDd",
"method": "transfer",
"parameters": [
"0x2455eC6700092991Ce0782365A89d5Cd89c8Fa22",
"100000"
]
}'
{
"data": {
"amlScreening": null,
"amountPaid": null,
"assetSwept": null,
"assetSweptAmount": null,
"assetSweptAt": null,
"assetSweptGasFee": null,
"assetSweptHash": null,
"assetSweptRecipientAddress": null,
"assetSweptResponse": null,
"assetSweptSenderAddress": null,
"blockHash": null,
"blockNumber": null,
"blockchain": {
"createdAt": "2024-05-14T17:53:33.106Z",
"derivationPath": "m/44'/60'/0'/0",
"id": "b80d3d5e-16f1-4d99-be5e-6dfcd27f89aa",
"isActive": true,
"isEvmCompatible": true,
"isL2": false,
"logoUrl": "https://res.cloudinary.com/blockradar/image/upload/v1716800080/crypto-assets/bnb-bnb-logo_e4qdyk.png",
"name": "BNB smart chain",
"slug": "bnb-smart-chain",
"symbol": "bnb",
"tokenStandard": "BEP20",
"updatedAt": "2024-11-26T19:04:13.941Z"
},
"chainId": null,
"confirmations": null,
"confirmed": false,
"createdAt": "2025-01-15T21:17:24.013Z",
"currency": null,
"fee": null,
"feeMetadata": null,
"gasFee": null,
"gasPrice": null,
"gasUsed": null,
"hash": null,
"id": "42e94af1-1b8c-47fd-9250-276a3c8a3a71",
"metadata": null,
"network": "testnet",
"note": null,
"reason": "{\"method\":\"transfer\",\"parameters\":[\"0x2455eC6700092991Ce0782365A89d5Cd89c8Fa22\",\"100000\"],\"abi\":{\"constant\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}}",
"recipientAddress": "0x337610d27c682E347C9cD60BD4b3b107C9d34dDd",
"response": null,
"senderAddress": "0x947514e4B803e312C312da0F1B41fEDdbe15ae7a",
"status": "PENDING",
"tokenAddress": "0x337610d27c682E347C9cD60BD4b3b107C9d34dDd",
"type": "CUSTOM_SMART_CONTRACT",
"updatedAt": "2025-01-15T21:17:24.013Z",
"wallet": {
"address": "0x947514e4B803e312C312da0F1B41fEDdbe15ae7a",
"business": {
"id": "4b96c271-35eb-45e8-b558-6a53f95df601",
"name": "Test One Inc"
},
"createdAt": "2024-08-22T15:29:11.387Z",
"derivationPath": "m/44'/60'/0'/0/0",
"description": "This is BNB smart chain testnet master wallet",
"id": "4465468a-3c36-4536-918a-91d689e18a74",
"isActive": true,
"name": "BNB smart chain Master Wallet",
"network": "testnet",
"status": "ACTIVE",
"updatedAt": "2024-10-30T13:11:56.221Z"
}
},
"message": "Contract write initiated successfully",
"statusCode": 200
}
This API provides endpoints for interacting with smart contracts on the blockchain. It allows for executing contract functions.
The request body should be in raw format and include the following parameters:
Parameter | Type | Required | Description |
---|---|---|---|
address | string | Yes | The address of the contract. |
method | string | Yes | The method to be called on the contract. |
parameters | array | Yes | An array of parameters to pass to the method. |
abi | array | Yes | An array containing the ABI of the contract or method. |
curl --request POST \
--url https://api.blockradar.co/v1/wallets/{walletId}/contracts/write \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '{
"abi": [
{
"constant": false,
"inputs": [
{
"name": "_to",
"type": "address"
},
{
"name": "_value",
"type": "uint256"
}
],
"name": "transfer",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
}
],
"address": "0x337610d27c682E347C9cD60BD4b3b107C9d34dDd",
"method": "transfer",
"parameters": [
"0x2455eC6700092991Ce0782365A89d5Cd89c8Fa22",
"100000"
]
}'
{
"data": {
"amlScreening": null,
"amountPaid": null,
"assetSwept": null,
"assetSweptAmount": null,
"assetSweptAt": null,
"assetSweptGasFee": null,
"assetSweptHash": null,
"assetSweptRecipientAddress": null,
"assetSweptResponse": null,
"assetSweptSenderAddress": null,
"blockHash": null,
"blockNumber": null,
"blockchain": {
"createdAt": "2024-05-14T17:53:33.106Z",
"derivationPath": "m/44'/60'/0'/0",
"id": "b80d3d5e-16f1-4d99-be5e-6dfcd27f89aa",
"isActive": true,
"isEvmCompatible": true,
"isL2": false,
"logoUrl": "https://res.cloudinary.com/blockradar/image/upload/v1716800080/crypto-assets/bnb-bnb-logo_e4qdyk.png",
"name": "BNB smart chain",
"slug": "bnb-smart-chain",
"symbol": "bnb",
"tokenStandard": "BEP20",
"updatedAt": "2024-11-26T19:04:13.941Z"
},
"chainId": null,
"confirmations": null,
"confirmed": false,
"createdAt": "2025-01-15T21:17:24.013Z",
"currency": null,
"fee": null,
"feeMetadata": null,
"gasFee": null,
"gasPrice": null,
"gasUsed": null,
"hash": null,
"id": "42e94af1-1b8c-47fd-9250-276a3c8a3a71",
"metadata": null,
"network": "testnet",
"note": null,
"reason": "{\"method\":\"transfer\",\"parameters\":[\"0x2455eC6700092991Ce0782365A89d5Cd89c8Fa22\",\"100000\"],\"abi\":{\"constant\":false,\"inputs\":[{\"name\":\"_to\",\"type\":\"address\"},{\"name\":\"_value\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}}",
"recipientAddress": "0x337610d27c682E347C9cD60BD4b3b107C9d34dDd",
"response": null,
"senderAddress": "0x947514e4B803e312C312da0F1B41fEDdbe15ae7a",
"status": "PENDING",
"tokenAddress": "0x337610d27c682E347C9cD60BD4b3b107C9d34dDd",
"type": "CUSTOM_SMART_CONTRACT",
"updatedAt": "2025-01-15T21:17:24.013Z",
"wallet": {
"address": "0x947514e4B803e312C312da0F1B41fEDdbe15ae7a",
"business": {
"id": "4b96c271-35eb-45e8-b558-6a53f95df601",
"name": "Test One Inc"
},
"createdAt": "2024-08-22T15:29:11.387Z",
"derivationPath": "m/44'/60'/0'/0/0",
"description": "This is BNB smart chain testnet master wallet",
"id": "4465468a-3c36-4536-918a-91d689e18a74",
"isActive": true,
"name": "BNB smart chain Master Wallet",
"network": "testnet",
"status": "ACTIVE",
"updatedAt": "2024-10-30T13:11:56.221Z"
}
},
"message": "Contract write initiated successfully",
"statusCode": 200
}
"{{walletId}}"
200
The response is of type object
.