NAV
shell php javascript java csharp ruby python go

Ethereum APIs

Blockchain information

curl -X GET 'https://api.blocksdk.com/v2/eth/info' \
    -H 'Content-Type: application/json' \
    -H 'X-API-Token: my-api-token'
$blockChain = $ethClient->getBlockChain();
var blockChain = ethClient.getBlockChain()
blockChain = ethClient.getBlockChain()
blockChain = ethClient.getBlockChain()
blockChain := ethClient.GetBlockChain()

Response Body

{
    "payload": {
        "network": "mainnet",
        "currency": "ETH",
        "last_block_height": 11626683,
        "last_block_hash": "0x5350ee64929f1eedba95de3a9444d2bbfedea4972d040301745b380b7c90f1e9",
        "last_block_datetime": "2021-01-10T10:59:04+00:00",
        "last_block_timestamp": 1610276344,
        "prev_block_height": 11626682,
        "prev_block_hash": "0x4a63ed79e57a1f63c8df5da5f390dea380a2679d32cb49a7659fd4759aab459f",
        "prev_block_datetime": "2021-01-10T10:59:01+00:00",
        "prev_block_timestamp": 1610276341,
        "low_gwei": 17,
        "medium_gwei": 25,
        "high_gwei": 37,
        "unconfirmed_count": 120591
    },
    "state": {
        "code": 200,
        "success": true
    }
}

Info

Returns information about the Ethereum blockchain.

HTTP Request

GET https://api.blocksdk.com/v2/eth/info

Response

Variable Type Description
unconfirmed_count int Memory pool transaction count
low_gwei double Low fees per kb
medium_gwei double Medium fees per kb (3~6 Block)
high_gwei double High fees per kb (1~2 Block)

Block information

curl -X GET 'https://api.blocksdk.com/v2/eth/blocks/3000000' \
    -H 'Content-Type: application/json' \
    -H 'X-API-Token: my-api-token'
$block = $ethClient->getBlock([
    "block" => 3000000,
    "offset" => 0,
    "limit" => 10,
    "rawtx" => true
]);
var block = ethClient.getBlock({
    "block" : 3000000,
    "rawtx" : false,
    "offset" : 0,
    "limit" : 10
})
block = ethClient.getBlock({
    "block" => 3000000,
    "rawtx" => false,
    "offset" => 0,
    "limit" => 10
})
block = ethClient.getBlock({
    "block" : 3000000,
    "rawtx" : false,
    "offset" : 0,
    "limit" : 10
})
block := ethClient.GetBlock(map[string]interface{}{
      "block" : 3000000,
      "rawtx" : false,
      "offset" : 0,
      "limit" : 10
})

Response Body

{
    "payload": {
        "hash": "0xee396a86beaade9d6057b72a92b7bf5b40be4997745b437857469557b562a7c3",
        "height": 3000000,
        "extra_data": "0x65746865726d696e65202d20455532",
        "gas_limit": 3996095,
        "gas_used": 269381,
        "miner": "0xea674fdde714fd979de3edf0f56aa9716b898ec8",
        "transactions": [
            "0x7c03009d52ec50069adb4311d5225fe2249ce5afb3a9951af258f0f680efb19a",
            .....
        ],
        "transaction_count": 6,
        "total_value": 8.99840163,
        "total_fee": 0.00851086,
        "reward": 5,
        "size": 1643,
        "nonce": "0xe9d09233833686d4",
        "confirmations": 8626779,
        "sha3_uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
        "datetime": "2017-01-15T10:10:35+00:00",
        "timestamp": 1484475035,
        "prev_block_hash": "0x79feeecc59fcd9cd0172a2aa74e0884262a013e9df01ba3de00c4e9fd9030082",
        "prev_block_datetime": "2017-01-15T10:10:17+00:00",
        "prev_block_timestamp": 1484475017,
        "next_block_hash": "0x9d52e9421dfc80b9820a3a06f6ed02fc3835a44b7d4f8a8a28ec6d74e43abcfa",
        "next_block_datetime": "2017-01-15T10:10:55+00:00",
        "next_block_timestamp": 1484475055
    },
    "state": {
        "code": 200,
        "success": true
    }
}

Info

Return information about a specific block

HTTP Request

GET https://api.blocksdk.com/v2/eth/blocks/<block>

URL Parameters

Parameter Type Description
block* string Block height or block hash

Query Parameters

Parameter Type Default Description
rawtx boolean false If true, return transaction details
offset int 0 Sequential index number at the beginning of the list of items for a given criterion
limit int 10 Limit number of item lists for a given criterion

Response

Variable Type Description
hash string Block Hash
height string Block Height
extra_data string Additional data in the block
gas_limit string Maximum gas_limit allowed for this block
gas_used string Total gas used by all transactions in this block
miner string Address of beneficiary who received mining rewards
transactions array List of transactions contained in the block
transaction_count int Total number of transactions in the block
total_value double Total transaction amount of all transactions included in the block
total_fee double Total fee for all transactions included in the block
reward double Block Mining Amount
size int Block Size
nonce string Is the hash of the generated proof-of-work
datetime string Block creation date and time
timestamp int Block creation date and time

List of memory pool transactions

curl -X GET 'https://api.blocksdk.com/v2/eth/mempool' \
    -H 'Content-Type: application/json' \
    -H 'X-API-Token: my-api-token'
$pool = $ethClient->getMemPool([
    "rawtx" => true,
    "offset" => 0,
    "limit" => 10
]);
var mempool = ethClient.getMemPool({
    "rawtx" : true,
    "offset" : 0,
    "limit" : 10
})
mempool = ethClient.getMemPool({
    "rawtx" => true,
    "offset" => 0,
    "limit" => 10
})
mempool = ethClient.getMemPool({
    "rawtx" : true,
    "offset" : 0,
    "limit" : 10
})
mempool := ethClient.GetMemPool(map[string]interface{}{
      "rawtx" : true,
      "offset" : 0,
      "limit" : 10
})

Response Body

{
    "payload": {
        "transactions": [
            "0x128a8dc34686e4ab8db8807ad7a6698a6c28875fd0c5315ad9b47c6435875126",
            "0x0196b94d042ec81b57ec51377a811f011c35c540c1279a3a3aa4a5d8fe99cdaf",
            ...
        ],
        "transaction_count": 121059
    },
    "state": {
        "code": 200,
        "success": true
    }
}

Info

Returns a list of transactions in the memory pool.

HTTP Request

GET https://api.blocksdk.com/v2/eth/mempool

Query Parameters

Parameter Type Default Description
offset int 0 Sequential index number at the beginning of the list of items for a given criterion
limit int 10 Limit number of item lists for a given criterion

Response

Variable Type Description
transactions array List of transactions with memory pool
transaction_count array Number of transactions included in the memory pool

Address list

curl -X GET 'https://api.blocksdk.com/v2/eth/addresses' \
    -H 'Content-Type: application/json' \
    -H 'X-API-Token: my-api-token'
$addresses = $ethClient->getAddresses([
    "offset" => 0,
    "limit" => 10
]);
var addresses = ethClient.getAddresses({
    "offset" : 0,
    "limit" : 10
})
addresses = ethClient.getAddresses({
    "offset" => 0,
    "limit" => 10
})
addresses = ethClient.getAddresses({
    "offset" : 0,
    "limit" : 10
})
addresses := ethClient.GetAddresses(map[string]interface{}{
    "offset" : 0,
    "limit" : 10
})

Response Body

{
    "payload": [
        {
            "id": 528,
            "name": "vKbpOkTa4rIxQau4gb75X2yIxLj34aj0UX4",
            "address": "0x81aa731c4c3c5a8b94246f987cc0f61070123dc3",
            "datetime": "2021-01-10T11:30:15+00:00",
            "timestamp": 1610278215
        },

        ...

    ],
    "state": {
        "code": 200,
        "success": true
    }
}

Info

Returns the created address list.

HTTP Request

GET https://api.blocksdk.com/v2/eth/addresses

Query Parameters

Parameter Type Default Description
offset int 0 Sequential index number at the beginning of the list of items for a given criterion
limit int 10 Limit number of item lists for a given criterion

Response

Variable Type Description
id int Address unique id
name string Address unique name
address string Ethereum Address
datetime string Address creation date and time
timestamp int Address creation date and time

Address information

curl -X GET 'https://api.blocksdk.com/v2/eth/addresses/0xedcf6a54ea0bd22aadb41c59bb82860c424eb7d6' \
    -H 'Content-Type: application/json' \
    -H 'X-API-Token: my-api-token'
$addressInfo = $ethClient->getAddressInfo([
    "address" => "0xedcf6a54ea0bd22aadb41c59bb82860c424eb7d6",
    "reverse" => true,
    "rawtx" => false,
    "offset" => 0,
    "limit" => 10
]);
var addressInfo = ethClient.getAddressInfo({
    "address" : "0xedcf6a54ea0bd22aadb41c59bb82860c424eb7d6",
    "rawtx" : false,
    "reverse" : true,
    "offset" : 0,
    "limit" : 10
})
addressInfo = ethClient.getAddressInfo({
    "address" => "0xedcf6a54ea0bd22aadb41c59bb82860c424eb7d6",
    "rawtx" => false,
    "reverse" => true,
    "offset" => 0,
    "limit" => 10
})
addressInfo = ethClient.getAddressInfo({
    "address" : "0xedcf6a54ea0bd22aadb41c59bb82860c424eb7d6",
    "rawtx" : false,
    "reverse" : true,
    "offset" : 0,
    "limit" : 10
})
addressInfo := ethClient.GetAddressInfo(map[string]interface{}{
      "address" : "0xedcf6a54ea0bd22aadb41c59bb82860c424eb7d6",
      "rawtx" : false,
      "reverse" : true,
      "offset" : 0,
      "limit" : 10,
})

Response Body

{
    "payload": {
        "address": "0xedcf6a54ea0bd22aadb41c59bb82860c424eb7d6",
        "nonce": 0,
        "transactions": [
            "0xf2e44abfafa97f032fd54fa14316c14639649037a8ea40cf9150c878437ad511"
        ],
        "transaction_count": 1,
        "received_count": 1,
        "total_received": 0.020071,
        "unconfirmed_total_received": 0,
        "spent_count": 0,
        "total_spent": 0,
        "unconfirmed_total_spent": 0,
        "balance": 0.020071000000000002,
        "unconfirmed_balance": 0,
        "unconfirmed_count": 0,
        "first_datetime": "2021-01-11T04:11:12+00:00",
        "first_timestamp": 1610338272,
        "last_datetime": "2021-01-11T04:11:12+00:00",
        "last_timestamp": 1610338272
    },
    "state": {
        "code": 200,
        "success": true
    }
}

Info

Returns information about a specific address.

HTTP Request

GET https://api.blocksdk.com/v2/eth/addresses/<address>

URL Parameters

Parameter Type Description
address* string Return information from this address.

Query Parameters

Parameter Type Default Description
rawtx boolean false If true, return transaction details
reverse boolean true If true, the transaction is returned in the most recent order.
offset int 0 Sequential index number at the beginning of the list of items for a given criterion
limit int 10 Limit number of item lists for a given criterion

Response

Variable Type Description
nonce int Number of transactions sent
transactions array List of transactions received or sent to the address
transaction_count int Number of transactions received or sent to the address
received_count double Number of transactions received
spent_count double Number of transactions sent
total_received double Total amount received
total_spent double Total amount sent
unconfirmed_total_received double Total amount received not included in the block
unconfirmed_total_spent double Total amount sent not included in the block
balance double Remaining balance
unconfirmed_count int Number of transactions not included in the block
first_datetime string Creation date and time of the first transaction that occurred at the address
first_timestamp int Creation date and time of the first transaction that occurred at the address
last_datetime string Creation date and time of the last transaction that occurred at the address
last_timestamp int Creation date and time of the last transaction that occurred at the address

address generation

curl -X POST 'https://api.blocksdk.com/v2/eth/addresses' \
    -H 'Content-Type: application/json' \
    -H 'X-API-Token: my-api-token'
$address = $ethClient->createAddress([
    "name" => "test address"
]);
var address = ethClient.createAddress({
    "name" : "test address"
})
address = ethClient.createAddress({
    "name" => "test address"
})
address = ethClient.createAddress({
    "name" : "test address"
})
address := ethClient.CreateAddress(map[string]interface{}{
      "name" : "test address"
})

Response Body

{
    "payload": {
        "id": 528,
        "address": "0x81aa731c4c3c5a8b94246f987cc0f61070123dc3",
        "private_key": "0xfc64c591ca617edb5dedbad78e624768ff5fb2f79fe2bc61319a8a1d360cab97",
        "datetime": "2021-01-10T11:30:15+00:00",
        "timestamp": 1610278215
    },
    "state": {
        "code": 201,
        "success": true
    }
}

Info

Create an address.

HTTP Request

POST https://api.blocksdk.com/v2/eth/addresses

Body Parameters

Parameter Type Default Description
name string random Wallet name

Response

Variable Type Description
id int Address unique id
address string Generated address
private_key string Address key. This value is not stored on the server for security and stability reasons, so it cannot be recovered when lost. Be careful not to lose it.

Address Load

curl -X POST 'https://api.blocksdk.com/v2/eth/addresses/0x24e10cc3ba369d9ad0d1db15d2ea7e93f40fdf1a/load`' \
    -H 'Content-Type: application/json' \
    -H 'X-API-Token: my-api-token' \
    -d '{"private_key" : "0x8fc51d42cc3783ac169d820c489edc9ea42c962af4328d65e27f0a932eedac58","password":"asdasd1234"}' 
$load = $ethClient->loadAddress([
    "address" => "0x24e10cc3ba369d9ad0d1db15d2ea7e93f40fdf1a",
    "private_key" => "0x8fc51d42cc3783ac169d820c489edc9ea42c962af4328d65e27f0a932eedac58",
    "password" => "asdasd1234"
]);
var load = ethClient.loadAddress({
    "address" : "14ydRmjd5Tzg7W2hJJ8nsuZvpQNVcLYCYN",
    "private_key" : "0x8fc51d42cc3783ac169d820c489edc9ea42c962af4328d65e27f0a932eedac58",
    "password" : "asdasd1234"

})
load = ethClient.loadAddress({
    "address" => "14ydRmjd5Tzg7W2hJJ8nsuZvpQNVcLYCYN",
    "private_key" => "0x8fc51d42cc3783ac169d820c489edc9ea42c962af4328d65e27f0a932eedac58",
    "password" => "asdasd1234"

})
load = ethClient.loadAddress({
    "address" : "14ydRmjd5Tzg7W2hJJ8nsuZvpQNVcLYCYN",
    "private_key" : "0x8fc51d42cc3783ac169d820c489edc9ea42c962af4328d65e27f0a932eedac58",
    "password" : "asdasd1234"
})
load := ethClient.LoadAddress(map[string]interface{}{
      "address" : "14ydRmjd5Tzg7W2hJJ8nsuZvpQNVcLYCYN",
      "private_key" : "0x8fc51d42cc3783ac169d820c489edc9ea42c962af4328d65e27f0a932eedac58",
      "password" : "abcdef123456"
})

Response Body

{
    "payload": {
        "address": "0x24e10cc3ba369d9ad0d1db15d2ea7e93f40fdf1a",
        "loaded": true
    },
    "state": {
        "code": 201,
        "success": true
    }
}

Info

Load a specific address.

The loaded address can create a transaction with a password without a private_key.

HTTP Request

POST https://api.blocksdk.com/v2/eth/addresses/<address>/load

URL Parameters

Parameter Type Description
address* int Address to load

Body Parameters

Parameter Type Description
password* string Loaded addresses require this password when creating a transaction.
private_key* string This is the private_key returned when creating the address.

Response

Variable Type Description
id int Address unique id
loaded boolean Loading state

Address unload

curl -X POST 'https://api.blocksdk.com/v2/eth/addresses/0x24e10cc3ba369d9ad0d1db15d2ea7e93f40fdf1a/unload' \
    -H 'Content-Type: application/json' \
    -H 'X-API-Token: my-api-token'
$unload = $ethClient->unloadAddress([
    "address" => "0x24e10cc3ba369d9ad0d1db15d2ea7e93f40fdf1a"
]);
var unload = ethClient.unloadAddress({
    "address" : "0x24e10cc3ba369d9ad0d1db15d2ea7e93f40fdf1a"
})
unload = ethClient.unloadAddress({
    "address" => "0x24e10cc3ba369d9ad0d1db15d2ea7e93f40fdf1a"
})
unload = ethClient.unloadAddress({
    "address" : "0x24e10cc3ba369d9ad0d1db15d2ea7e93f40fdf1a"
})
unload := ethClient.UnloadAddress(map[string]interface{}{
      "address" : "0x24e10cc3ba369d9ad0d1db15d2ea7e93f40fdf1a"
})

Response Body

{
    "payload": {
        "address": "0x24e10cc3ba369d9ad0d1db15d2ea7e93f40fdf1a",
        "loaded": false
    },
    "state": {
        "code": 201,
        "success": true
    }
}

Info

Unload the loaded address.

HTTP Request

POST https://api.blocksdk.com/v2/eth/addresses/<address>/unload

URL Parameters

Parameter Type Description
address* int Address to unload

Response

Variable Type Description
id int Address unique id
loaded boolean Loading state

Address balance

curl -X GET 'https://api.blocksdk.com/v2/eth/addresses/0xedcf6a54ea0bd22aadb41c59bb82860c424eb7d6/balance' \
    -H 'Content-Type: application/json' \
    -H 'X-API-Token: my-api-token'
$addressBalance = $ethClient->getAddressBalance([
    "address" => "0xedcf6a54ea0bd22aadb41c59bb82860c424eb7d6"
]);
var addressBalance = ethClient.getAddressBalance({
    "address" : "0xedcf6a54ea0bd22aadb41c59bb82860c424eb7d6"
})
addressBalance = ethClient.getAddressBalance({
    "address" => "0xedcf6a54ea0bd22aadb41c59bb82860c424eb7d6"
})
addressBalance = ethClient.getAddressBalance({
    "address" : "0xedcf6a54ea0bd22aadb41c59bb82860c424eb7d6"
})
addressBalance := ethClient.GetAddressBalance(map[string]interface{}{
      "address" : "0xedcf6a54ea0bd22aadb41c59bb82860c424eb7d6"
})

Response Body

{
    "payload": {
        "address": "0xedcf6a54ea0bd22aadb41c59bb82860c424eb7d6",
        "balance": 0.020071,
        "unconfirmed_balance": 0
    },
    "state": {
        "code": 200,
        "success": true
    }
}

Info

Returns the balance for a specific address.

HTTP Request

GET https://api.blocksdk.com/v2/eth/addresses/<address>/balance

URL Parameters

Parameter Type Description
address* string Return information from this address.

Response

Variable Type Description
balance double Remaining balance
unconfirmed_balance double Total amount not included in block

Send address amount

curl -X POST 'https://api.blocksdk.com/v2/eth/addresses/0xf5f81e069c9af52763b4b82187cea38505608f39/sendtoaddress' \
    -H 'Content-Type: application/json' \
    -H 'X-API-Token: my-api-token' \
    -d '{
        "private_key" : "0x8fc51d42cc3783ac169d820c489edc9ea42c962af4328d65e27f0a932eedac58",
        "to":"0xedcf6a54ea0bd22aadb41c59bb82860c424eb7d6",
        "amount":0.020071,
        "gas_limit":21000,
        "gwei":286
    }'  
$tx = $ethClient->sendToAddress([
    "from" => "0xf5f81e069c9af52763b4b82187cea38505608f39",
    "to" => "0xedcf6a54ea0bd22aadb41c59bb82860c424eb7d6",
    "amount" =>0.020071,
    "private_key" => "0x8fc51d42cc3783ac169d820c489edc9ea42c962af4328d65e27f0a932eedac58",
    "gas_limit" => 21000,
    "gwei" => 286
]);

or

$tx = $ethClient->sendToAddress([
    "from" => "0xf5f81e069c9af52763b4b82187cea38505608f39",
    "to" => "0xedcf6a54ea0bd22aadb41c59bb82860c424eb7d6",
    "amount" =>0.020071,
    "password" => "asdasd1234",
    "gas_limit" => 21000,
    "gwei" => 286
]);
var tx = ethClient.sendToAddress({
    "from" : "0xf5f81e069c9af52763b4b82187cea38505608f39",
    "to" : "0xedcf6a54ea0bd22aadb41c59bb82860c424eb7d6",
    "amount" : 0.020071,
    "private_key" : "0x8fc51d42cc3783ac169d820c489edc9ea42c962af4328d65e27f0a932eedac58",
    "gas_limit" : 21000,
    "gwei" : 286
})

or

var tx = ethClient.sendToAddress({
    "from" : "0xf5f81e069c9af52763b4b82187cea38505608f39",
    "to" : "0xedcf6a54ea0bd22aadb41c59bb82860c424eb7d6",
    "amount" : 0.020071,
    "password" : "asdasd1234",
    "gas_limit" : 21000,
    "gwei" : 286
})
tx = ethClient.sendToAddress({
    "from" => "0xf5f81e069c9af52763b4b82187cea38505608f39",
    "to" => "0xedcf6a54ea0bd22aadb41c59bb82860c424eb7d6",
    "amount" => 0.020071,
    "private_key" => "0x8fc51d42cc3783ac169d820c489edc9ea42c962af4328d65e27f0a932eedac58",
    "gas_limit" =. 21000,
    "gwei" => 286
})

or

tx = ethClient.sendToAddress({
    "from" => "0xf5f81e069c9af52763b4b82187cea38505608f39",
    "to" => "0xedcf6a54ea0bd22aadb41c59bb82860c424eb7d6",
    "amount" => 0.020071,
    "password" => "asdasd1234",
    "gas_limit" =. 21000,
    "gwei" => 286
})
tx = ethClient.sendToAddress({
    "from" : "0xf5f81e069c9af52763b4b82187cea38505608f39",
    "to" : "0xedcf6a54ea0bd22aadb41c59bb82860c424eb7d6",
    "amount" : 0.020071,
    "private_key" : "0x8fc51d42cc3783ac169d820c489edc9ea42c962af4328d65e27f0a932eedac58",
    "gas_limit" : 21000,
    "gwei" : 286
})

or

tx = ethClient.sendToAddress({
    "from" : "0xf5f81e069c9af52763b4b82187cea38505608f39",
    "to" : "0xedcf6a54ea0bd22aadb41c59bb82860c424eb7d6",
    "amount" : 0.020071,
    "password" : "asdasd1234",
    "gas_limit" : 21000,
    "gwei" : 286
})
tx := ethClient.SendToAddress(map[string]interface{}{
    "from" : "0xf5f81e069c9af52763b4b82187cea38505608f39",
    "to" : "0xedcf6a54ea0bd22aadb41c59bb82860c424eb7d6",
    "amount" : 0.020071,
    "private_key" : "0x8fc51d42cc3783ac169d820c489edc9ea42c962af4328d65e27f0a932eedac58",
    "gas_limit" : 21000,
    "gwei" : 286
})

or

tx := ethClient.SendToAddress(map[string]interface{}{
    "from" : "0xf5f81e069c9af52763b4b82187cea38505608f39",
    "to" : "0xedcf6a54ea0bd22aadb41c59bb82860c424eb7d6",
    "amount" : 0.020071,
    "password" : "asdasd1234",
    "gas_limit" : 21000,
    "gwei" : 286
})

Response Body

{
    "payload": {
        "hash": "0xf2e44abfafa97f032fd54fa14316c14639649037a8ea40cf9150c878437ad511",
        "from": "0xf5f81e069c9af52763b4b82187cea38505608f39",
        "to": "0xedcf6a54ea0bd22aadb41c59bb82860c424eb7d6",
        "value": 0.020071,
        "gas_used": 21000,
        "gas_limit": 21000,
        "gas_price": 2.86e-7,
        "total_fee": 0.006006,
        "nonce": 541,
        "transaction_index": 118,
        "input": "0x",
        "block_hash": "0x42c3c97007c177cc48203b00896c38243a87ddc0b94bec64f56b144d2b7dcc4f",
        "block_height": 11631372,
        "confirmations": 33,
        "datetime": "2021-01-11T04:11:12+00:00",
        "timestamp": 1610338272,
        "status": 1
    },
    "state": {
        "code": 200,
        "success": true
    }
}

Info

Send the amount to a specific address.

HTTP Request

POST https://api.blocksdk.com/v2/eth/addresses/<from>/sendtoaddress

URL Parameters

Parameter Type Description
from* string Address to which to send the amount

Body Parameters

Parameter Type Default Description
password string --- If the address is loaded, you can send the amount by password.
private_key string --- If it is an external address or the address is not loaded, this value is required. Issued when creating an address.
gas_limit int 90000 Maximum gas to be used for trading
gwei int Titration gwei Price per gas to be used in the transaction
to* string --- Address to receive coin
amount* double --- Amount to send

Response

Transaction Object

Send Transaction

curl -X POST 'https://api.blocksdk.com/v2/eth/transactions/send' \
    -H 'Content-Type: application/json' \
    -H 'X-API-Token: my-api-token' \
    -d '{"hex" : "0xf86c0a85046c7cfe0083016dea94d1310c1e038bc12865d3d3997275b3e4737c6302880b503be34d9fe80080269fc7eaaa9c21f59adf8ad43ed66cf5ef9ee1c317bd4d32cd65401e7aaca47cfaa0387d79c65b90be6260d09dcfb780f29dd8133b9b1ceb20b83b7e442b4bfc30cb"}'     
$tx = $ethClient->sendTransaction([
    "hex" => "0xf86c0a85046c7cfe0083016dea94d1310c1e038bc12865d3d3997275b3e4737c6302880b503be34d9fe80080269fc7eaaa9c21f59adf8ad43ed66cf5ef9ee1c317bd4d32cd65401e7aaca47cfaa0387d79c65b90be6260d09dcfb780f29dd8133b9b1ceb20b83b7e442b4bfc30cb"
]);
var tx = ethClient.sendTransaction({
    "hex" : "0xf86c0a85046c7cfe0083016dea94d1310c1e038bc12865d3d3997275b3e4737c6302880b503be34d9fe80080269fc7eaaa9c21f59adf8ad43ed66cf5ef9ee1c317bd4d32cd65401e7aaca47cfaa0387d79c65b90be6260d09dcfb780f29dd8133b9b1ceb20b83b7e442b4bfc30cb"
})
tx = ethClient.sendTransaction({
    "hex" => "0xf86c0a85046c7cfe0083016dea94d1310c1e038bc12865d3d3997275b3e4737c6302880b503be34d9fe80080269fc7eaaa9c21f59adf8ad43ed66cf5ef9ee1c317bd4d32cd65401e7aaca47cfaa0387d79c65b90be6260d09dcfb780f29dd8133b9b1ceb20b83b7e442b4bfc30cb"
})
tx = ethClient.sendTransaction({
    "hex" : "0xf86c0a85046c7cfe0083016dea94d1310c1e038bc12865d3d3997275b3e4737c6302880b503be34d9fe80080269fc7eaaa9c21f59adf8ad43ed66cf5ef9ee1c317bd4d32cd65401e7aaca47cfaa0387d79c65b90be6260d09dcfb780f29dd8133b9b1ceb20b83b7e442b4bfc30cb"
})
tx := ethClient.SendTransaction(map[string]interface{}{
    "hex" : "0xf86c0a85046c7cfe0083016dea94d1310c1e038bc12865d3d3997275b3e4737c6302880b503be34d9fe80080269fc7eaaa9c21f59adf8ad43ed66cf5ef9ee1c317bd4d32cd65401e7aaca47cfaa0387d79c65b90be6260d09dcfb780f29dd8133b9b1ceb20b83b7e442b4bfc30cb"
})

Response Body

{
    "payload": {
        "hash": "0xf2e44abfafa97f032fd54fa14316c14639649037a8ea40cf9150c878437ad511",
        "from": "0xf5f81e069c9af52763b4b82187cea38505608f39",
        "to": "0xedcf6a54ea0bd22aadb41c59bb82860c424eb7d6",
        "value": 0.020071000000000002,
        "gas_used": 21000,
        "gas_limit": 21000,
        "gas_price": 2.86e-7,
        "total_fee": 0.006006,
        "nonce": 541,
        "transaction_index": 118,
        "input": "0x",
        "block_hash": "0x42c3c97007c177cc48203b00896c38243a87ddc0b94bec64f56b144d2b7dcc4f",
        "block_height": 11631372,
        "confirmations": 33,
        "datetime": "2021-01-11T04:11:12+00:00",
        "timestamp": 1610338272,
        "status": 1
    },
    "state": {
        "code": 200,
        "success": true
    }
}

Info

Send the signed transaction.

HTTP Request

POST https://api.blocksdk.com/v2/eth/transactions/send

Body Parameters

Parameter Type Description
hex string Signed transaction hex

Response

Transaction Object

Transaction information

curl -X GET 'https://api.blocksdk.com/v2/eth/transactions/0xf2e44abfafa97f032fd54fa14316c14639649037a8ea40cf9150c878437ad511' \
    -H 'Content-Type: application/json' \
    -H 'X-API-Token: my-api-token'
$tx = $ethClient->getTransaction([
    "hash" => "0xf2e44abfafa97f032fd54fa14316c14639649037a8ea40cf9150c878437ad511"
]);
var tx = ethClient.getTransaction({
    "hash" : "0xf2e44abfafa97f032fd54fa14316c14639649037a8ea40cf9150c878437ad511"
})
tx = ethClient.getTransaction({
    "hash" => "0xf2e44abfafa97f032fd54fa14316c14639649037a8ea40cf9150c878437ad511"
})
tx = ethClient.getTransaction({
    "hash" : "0xf2e44abfafa97f032fd54fa14316c14639649037a8ea40cf9150c878437ad511"
})
tx := ethClient.GetTransaction(map[string]interface{}{
    "hash" : "0xf2e44abfafa97f032fd54fa14316c14639649037a8ea40cf9150c878437ad511"
})

Response Body

{
    "payload": {
        "hash": "0xf2e44abfafa97f032fd54fa14316c14639649037a8ea40cf9150c878437ad511",
        "from": "0xf5f81e069c9af52763b4b82187cea38505608f39",
        "to": "0xedcf6a54ea0bd22aadb41c59bb82860c424eb7d6",
        "value": 0.020071000000000002,
        "gas_used": 21000,
        "gas_limit": 21000,
        "gas_price": 2.86e-7,
        "total_fee": 0.006006,
        "nonce": 541,
        "transaction_index": 118,
        "input": "0x",
        "block_hash": "0x42c3c97007c177cc48203b00896c38243a87ddc0b94bec64f56b144d2b7dcc4f",
        "block_height": 11631372,
        "confirmations": 33,
        "datetime": "2021-01-11T04:11:12+00:00",
        "timestamp": 1610338272,
        "status": 1
    },
    "state": {
        "code": 200,
        "success": true
    }
}

Info

Return information for a specific transaction.

HTTP Request

GET https://api.blocksdk.com/v2/eth/transactions/<tx_hash>

URL Parameters

Parameter Type Description
tx_hash string Transaction hash to return transaction information

Response

Transaction Object

ERC20 token information

curl -X GET 'https://api.blocksdk.com/v2/eth/erc20-tokens/0xdac17f958d2ee523a2206206994597c13d831ec7' \
    -H 'Content-Type: application/json' \
    -H 'X-API-Token: my-api-token'
$erc20 = $ethClient->getErc20([
    "contract_address" => "0xdac17f958d2ee523a2206206994597c13d831ec7"
]);
var erc20 = ethClient.getErc20({
    "contract_address" : "0xdac17f958d2ee523a2206206994597c13d831ec7"
})
erc20 = ethClient.getErc20({
    "contract_address" => "0xdac17f958d2ee523a2206206994597c13d831ec7"
})
erc20 = ethClient.getErc20({
    "contract_address" : "0xdac17f958d2ee523a2206206994597c13d831ec7"
})
erc20 := ethClient.GetErc20(map[string]interface{}{
    "contract_address" : "0xdac17f958d2ee523a2206206994597c13d831ec7"
})

Response Body

{
    "payload": {
        "name": "Tether USD",
        "symbol": "USDT",
        "totalSupply": 14340316718.197083,
        "decimals": 6,
        "owner_address": "0xc6cde7c39eb2f0f0095f41570af89efc2c1ea828"
    },
    "state": {
        "code": 200,
        "success": true
    }
}

Info

Returns the information of the ERC20 token.

HTTP Request

GET https://api.blocksdk.com/v2/eth/erc20-tokens/<contract_address>

URL Parameters

Parameter Type Description
contract_address* string ERC20 token contract address

Response

Variable Type Description
name string ERC20 Token name
symbol string ERC20 Token symbol
totalSupply double Total ERC20 tokens issued
decimals int Number of decimal places
owner_address string ERC20 token owned address

ERC20 Token Balance

curl -X GET 'https://api.blocksdk.com/v2/eth/erc20-tokens/0xdac17f958d2ee523a2206206994597c13d831ec7/0xd6bf2c22cff024a7aca70a29c15dbb6d0424db1b/balance' \
    -H 'Content-Type: application/json' \
    -H 'X-API-Token: my-api-token'
$erc20 = $ethClient->getErc20Balance([
    "contract_address" => "0xdac17f958d2ee523a2206206994597c13d831ec7",
    "from" => "0xd6bf2c22cff024a7aca70a29c15dbb6d0424db1b"
]);
var erc20 = ethClient.getErc20Balance({
    "contract_address" : "0xdac17f958d2ee523a2206206994597c13d831ec7",
    "from" : "0xd6bf2c22cff024a7aca70a29c15dbb6d0424db1b"
})
erc20 = ethClient.getErc20Balance({
    "contract_address" => "0xdac17f958d2ee523a2206206994597c13d831ec7",
    "from" => "0xd6bf2c22cff024a7aca70a29c15dbb6d0424db1b"
})
erc20 = ethClient.getErc20Balance({
    "contract_address" : "0xdac17f958d2ee523a2206206994597c13d831ec7",
    "from" : "0xd6bf2c22cff024a7aca70a29c15dbb6d0424db1b"
})
erc20 := ethClient.GetErc20Balance(map[string]interface{}{
    "contract_address" : "0xdac17f958d2ee523a2206206994597c13d831ec7",
    "from" : "0xd6bf2c22cff024a7aca70a29c15dbb6d0424db1b"
})

Response Body

{
    "payload": {
        "contract_address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
        "address": "0xd6bf2c22cff024a7aca70a29c15dbb6d0424db1b",
        "balance": 79766.000087
    },
    "state": {
        "code": 200,
        "success": true
    }
}

Info

Returns the balance of ERC20 tokens at a specific address.

HTTP Request

GET https://api.blocksdk.com/v2/eth/erc20-tokens/<contract_address>/<from>/balance

URL Parameters

Parameter Type Description
contract_address* string ERC20 token contract address
from* string Returns the balance of this address

Response

Variable Type Description
contract_address string ERC20 token contract address
address string Address to check balance
balance double Remaining balance

ERC20 Token Transfer

curl -X POST 'https://api.blocksdk.com/v2/eth/erc20-tokens/0xdac17f958d2ee523a2206206994597c13d831ec7/0x4434bfad24fdff68fa965ae337c529bd69ab3a50/transfer' \
    -H 'Content-Type: application/json' \
    -H 'X-API-Token: my-api-token' \
    -d '{
        "private_key" : "0x8fc51d42cc3783ac169d820c489edc9ea42c962af4328d65e27f0a932eedac58",
        "gas_limit" : 60000,
        "gwei" : 449,
        "to" : "0xd6bf2c22cff024a7aca70a29c15dbb6d0424db1b",
        "amount" : 79766
    }'      

$erc20 = $ethClient->getErc20Transfer([
    "contract_address" => "0xdac17f958d2ee523a2206206994597c13d831ec7",
    "from" => "0xd6bf2c22cff024a7aca70a29c15dbb6d0424db1b",
    "to" => "0xd6bf2c22cff024a7aca70a29c15dbb6d0424db1b",
    "private_key" => "0x8fc51d42cc3783ac169d820c489edc9ea42c962af4328d65e27f0a932eedac58",
    "gas_limit" => 60000,
    "gwei" => 449,
    "amount" => 79766
]);
var erc20 = ethClient.getErc20Transfer({
    "contract_address" : "0xdac17f958d2ee523a2206206994597c13d831ec7",
    "from" : "0xd6bf2c22cff024a7aca70a29c15dbb6d0424db1b",
    "to" : "0xd6bf2c22cff024a7aca70a29c15dbb6d0424db1b",
    "private_key" : "0x8fc51d42cc3783ac169d820c489edc9ea42c962af4328d65e27f0a932eedac58",
    "gas_limit" : 60000,
    "gwei" : 449,
    "amount" : 79766
})
erc20 = ethClient.getErc20Transfer({
    "contract_address" => "0xdac17f958d2ee523a2206206994597c13d831ec7",
    "from" => "0xd6bf2c22cff024a7aca70a29c15dbb6d0424db1b",
    "to" => "0xd6bf2c22cff024a7aca70a29c15dbb6d0424db1b",
    "private_key" => "0x8fc51d42cc3783ac169d820c489edc9ea42c962af4328d65e27f0a932eedac58",
    "gas_limit" => 60000,
    "gwei" => 449,
    "amount" => 79766
})
erc20 = ethClient.getErc20Transfer({
    "contract_address" : "0xdac17f958d2ee523a2206206994597c13d831ec7",
    "from" : "0xd6bf2c22cff024a7aca70a29c15dbb6d0424db1b",
    "to" : "0xd6bf2c22cff024a7aca70a29c15dbb6d0424db1b",
    "private_key" : "0x8fc51d42cc3783ac169d820c489edc9ea42c962af4328d65e27f0a932eedac58",
    "gas_limit" : 60000,
    "gwei" : 449,
    "amount" : 79766
})
erc20 := ethClient.GetErc20Transfer(map[string]interface{}{
    "contract_address" : "0xdac17f958d2ee523a2206206994597c13d831ec7",
    "from" : "0xd6bf2c22cff024a7aca70a29c15dbb6d0424db1b",
    "to" : "0xd6bf2c22cff024a7aca70a29c15dbb6d0424db1b",
    "private_key" : "0x8fc51d42cc3783ac169d820c489edc9ea42c962af4328d65e27f0a932eedac58",
    "gas_limit" : 60000,
    "gwei" : 449,
    "amount" : 79766
})

Response Body

{
    "payload": {
        "hash": "0xfaa52b0ffd4c82ea42b518b3d0f3c4c1917a05ad9f1363b3e25303c1705803ec",
        "from": "0x4434bfad24fdff68fa965ae337c529bd69ab3a50",
        "to": "0xd6bf2c22cff024a7aca70a29c15dbb6d0424db1b",
        "contract_address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
        "erc20_value": 79766,
        "value": 0,
        "gas_used": 41221,
        "gas_limit": 60000,
        "gas_price": 4.49e-7,
        "total_fee": 0.01850823,
        "nonce": 225,
        "transaction_index": 262,
        "input": "0xa9059cbb000000000000000000000000d6bf2c22cff024a7aca70a29c15dbb6d0424db1b00000000000000000000000000000000000000000000000000000012926c9180",
        "block_hash": "0xc3eaa3d1a326c9683a98e06157b8bc4183549a789101eb890d49b69bc917d5b5",
        "block_height": 11631405,
        "confirmations": 8,
        "datetime": "2021-01-11T04:19:20+00:00",
        "timestamp": 1610338760,
        "status": 1
    },
    "state": {
        "code": 200,
        "success": true
    }
}

Info

Send ERC20 tokens to specific addresses.

HTTP Request

POST https://api.blocksdk.com/v2/eth/erc20-tokens/<contract_address>/<from>/transfer

URL Parameters

Parameter Type Description
contract_address* string ERC20 token contract address
from* string Address to send ERC20 token

Body Parameters

Parameter Type Default Description
password string --- If the address is loaded, you can create a transaction with your password.
private_key string --- If it is an external address or the address is not loaded, this value is required. Issued when creating an address.
gas_limit int 90000 Maximum gas to be used for trading
gwei int --- Price per gas to be used in the transaction
to* string --- Address to receive the token
amount* double --- Amount of tokens to send

Response

Transaction Object

Transaction Object

Variable Type Description
hash string Transaction hash
from string Sending address
to string Receiving address
contract_address string Contract address
erc20_value double Amount of ERC20 tokens sent
value double Amount of ether sent
gas_used int The amount of gas determined by being included in the block
gas_limit int Max gas
gas_price double Price per gas
total_fee double Fees used in the transaction
nonce int Transaction number from the address to which the amount was sent
transaction_index int Transaction number in block
input string Transaction data
block_hash string Hash of contained block
block_height string The height of the included block
datetime string Date and time of transaction creation
timestamp int Date and time of transaction creation
status int Success:1, Error:0