Custom Smart Contract Write
This API provides endpoints for interacting with smart contracts on the blockchain. It allows for executing contract functions.
Request Body
The request body should be in raw format and include the following parameters:
-
address
: The address for the contract -
method
: The method to be called -
parameters
: An array of parameters -
abi
: An array containing the ABI of the contract or method
curl --request POST \
--url https://api.blockradar.co/v1/wallets/{walletId}/addresses/{addressId}/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",
"code": "654452",
"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
}
Authorizations
Path Parameters
"YOUR_WALLET_ID"
"ADDRESS_ID"
Body
false
"transfer"
[]
false
"nonpayable"
"function"
[
{
"constant": false,
"inputs": [
{ "name": "_to", "type": "address" },
{ "name": "_value", "type": "uint256" }
],
"name": "transfer",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
}
]
"0x337610d27c682E347C9cD60BD4b3b107C9d34dDd"
"654452"
"transfer"
[
"0x2455eC6700092991Ce0782365A89d5Cd89c8Fa22",
"100000"
]
Response
"2024-05-14T17:53:33.106Z"
"m/44'/60'/0'/0"
"b80d3d5e-16f1-4d99-be5e-6dfcd27f89aa"
true
true
false
"https://res.cloudinary.com/blockradar/image/upload/v1716800080/crypto-assets/bnb-bnb-logo_e4qdyk.png"
"BNB smart chain"
"bnb-smart-chain"
"bnb"
"BEP20"
"2024-11-26T19:04:13.941Z"
false
"2025-01-15T21:17:24.013Z"
"42e94af1-1b8c-47fd-9250-276a3c8a3a71"
"testnet"
"{\"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\"}}"
"0x337610d27c682E347C9cD60BD4b3b107C9d34dDd"
"0x947514e4B803e312C312da0F1B41fEDdbe15ae7a"
"PENDING"
"0x337610d27c682E347C9cD60BD4b3b107C9d34dDd"
"CUSTOM_SMART_CONTRACT"
"2025-01-15T21:17:24.013Z"
"0x947514e4B803e312C312da0F1B41fEDdbe15ae7a"
"2024-08-22T15:29:11.387Z"
"m/44'/60'/0'/0/0"
"This is BNB smart chain testnet master wallet"
"4465468a-3c36-4536-918a-91d689e18a74"
true
"BNB smart chain Master Wallet"
"testnet"
"ACTIVE"
"2024-10-30T13:11:56.221Z"
"Contract write initiated successfully"
200
curl --request POST \
--url https://api.blockradar.co/v1/wallets/{walletId}/addresses/{addressId}/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",
"code": "654452",
"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
}