Bitcoin Cash APIs
Blockchain information
curl -X GET 'https://api.blocksdk.com/v2/bch/info' \
-H 'Content-Type: application/json' \
-H 'X-API-Token: my-api-token'
$blockChain = $bchClient->getBlockChain();
var blockChain = bchClient.getBlockChain()
blockChain = bchClient.getBlockChain()
blockChain = bchClient.getBlockChain()
blockChain := bchClient.GetBlockChain()
Response Body
{
"payload": {
"network": "mainnet",
"currency": "BCH",
"last_block_height": 670002,
"last_block_hash": "00000000000000000197a29e62e132e826a8ae42033b65439df005386405c7ec",
"last_block_datetime": "2021-01-12T08:29:01+00:00",
"last_block_timestamp": 1610440141,
"prev_block_height": 670001,
"prev_block_hash": "000000000000000001efb4003af44598a6d91d03c57986bb084ef3d3da879b2c",
"prev_block_datetime": "2021-01-12T07:37:43+00:00",
"prev_block_timestamp": 1610437063,
"unconfirmed_count": 1398,
"low_fee_per_kb": 1.0e-5,
"medium_fee_per_kb": 1.0e-5,
"high_fee_per_kb": 2.0e-5
},
"state": {
"code": 200,
"success": true
}
}
Info
Returns information about the Bitcoin Cash blockchain.
HTTP Request
GET https://api.blocksdk.com/v2/bch/info
Response
Variable | Type | Description |
---|---|---|
unconfirmed_count | int | Memory pool transaction count |
low_fee_per_kb | double | Low fees per kb |
medium_fee_per_kb | double | Medium fees per kb (3~6 Block) |
high_fee_per_kb | double | High fees per kb (1~2 Block) |
Block information
curl -X GET 'https://api.blocksdk.com/v2/bch/blocks/1' \
-H 'Content-Type: application/json' \
-H 'X-API-Token: my-api-token'
$block = $bchClient->getBlock([
"block" => 1,
"rawtx" => false,
"offset" => 0,
"limit" => 10
]);
var block = bchClient.getBlock({
"block" : 1,
"rawtx" : false,
"offset" : 0,
"limit" : 10
})
block = bchClient.getBlock({
"block" => 1,
"rawtx" => false,
"offset" => 0,
"limit" => 10
})
block = bchClient.getBlock({
"block" : 1,
"rawtx" : false,
"offset" : 0,
"limit" : 10
})
block := bchClient.GetBlock(map[string]interface{}{
"block" : 1,
"rawtx" : false,
"offset" : 0,
"limit" : 10
})
Response Body
{
"payload": {
"hash": "00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048",
"confirmations": 670002,
"height": 1,
"transactions": [
"0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098"
],
"transaction_count": 1,
"total_input": 0,
"input_count": 1,
"total_output": 50,
"output_count": 1,
"fee_per_kb": 0,
"total_fee": 0,
"generation": 50,
"reward": 50,
"size": 215,
"datetime": "2009-01-09T02:54:25+00:00",
"timestamp": 1231469665,
"prev_block_hash": "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",
"prev_block_datetime": "2009-01-03T18:15:05+00:00",
"prev_block_timestamp": 1231006505,
"next_block_hash": "000000006a625f06636b8bb6ac7b960a8d03705d1ace08b1a19da3fdcc99ddbd",
"next_block_datetime": "2009-01-09T02:55:44+00:00",
"next_block_timestamp": 1231469744
},
"state": {
"code": 200,
"success": true
}
}
Info
Return information about a specific block
HTTP Request
GET https://api.blocksdk.com/v2/bch/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 |
transactions | array | List of transactions contained in the block |
transaction_count | array | Number of transactions contained in the block |
total_input | double | Total amount of input of all transactions included in the block |
input_count | int | Number of inputs of all transactions included in the block |
total_output | double | Total amount of output of all transactions included in the block |
output_count | int | Number of outputs of all transactions included in the block |
fee_per_kb | double | Average fee per kb of all transactions |
total_fee | double | Total fees for all transactions in the block |
generation | double | Block Mining Amount |
reward | double | Block mining reward |
size | int | Block Size |
datetime | string | Block creation date and time |
timestamp | string | Block creation date and time |
List of memory pool transactions
curl -X GET 'https://api.blocksdk.com/v2/bch/mempool' \
-H 'Content-Type: application/json' \
-H 'X-API-Token: my-api-token'
$mempool = $bchClient->getMemPool([
"rawtx" => false,
"offset" => 0,
"limit" => 10
]);
var mempool = bchClient.getMemPool({
"rawtx" : false,
"offset" : 0,
"limit" : 10
})
mempool = bchClient.getMemPool({
"rawtx" => false,
"offset" => 0,
"limit" => 10
})
mempool = bchClient.getMemPool({
"rawtx" : false,
"offset" : 0,
"limit" : 10
})
mempool := bchClient.GetMemPool(map[string]interface{}{
"rawtx" : false,
"offset" : 0,
"limit" : 10
})
Response Body
{
"payload": {
"transactions": [
"acc75329eb496be79be011dbe50d82534083d8a8b77879a314ed0f5c57c17ba4",
"9befd28d85fdc6c63b962976c7b2426d6ae36b972a1179f1c36c4157b5ab7060",
"92835931b5dd1fd2912ef1e231e2d3d5854d83f12ffbc1bdedab644cafcf848b",
"90d6a4ebb4c856bc170fcb34cc252c85ae1b2fd69cc939e15ec01b1a67e0ae8d",
"9517b3615526285b7091086dfd0fe770424ce4b478675228bf83e37b72ef339b",
"9996fb0afb18172ccda5e414bfd249564a82ce9ff61c18cbedaeb67334183caa",
"216e44b523f8e14c39d9cccbf4f32b144edfb3a1f66849bf8773ac42728de752",
"d40b81d12235885837a31eefae628f8e6ab691327c1b17d737cada44cc21fc2c",
"44cf7854cda20e087848f616694ef7580a37dd4038b4a97782a3bdcfeba3942d",
"11313ecf7cbc3fc7e91d1826baf5f53faa1a1f5ea704aa2fc28fb49c6452ba3a"
],
"transaction_count": 1478
},
"state": {
"code": 200,
"success": true
}
}
Info
Returns a list of transactions in the memory pool.
HTTP Request
GET https://api.blocksdk.com/v2/bch/mempool
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 |
---|---|---|
transactions | array | List of transactions with memory pool |
transaction_count | array | Number of transactions included in the memory pool |
Address information
curl -X GET 'https://api.blocksdk.com/v2/bch/addresses/qq824gn7smpdr3rlfyheuys2usqaud8weqp970t2a4' \
-H 'Content-Type: application/json' \
-H 'X-API-Token: my-api-token'
$addressInfo = $bchClient->getAddressInfo([
"address" => "qq824gn7smpdr3rlfyheuys2usqaud8weqp970t2a4",
"rawtx" => false,
"reverse" => true,
"offset" => 0,
"limit" => 10
]);
var addressInfo = bchClient.getAddressInfo({
"address" : "14ydRmjd5Tzg7W2hJJ8nsuZvpQNVcLYCYN",
"rawtx" : false,
"reverse" : true,
"offset" : 0,
"limit" : 10
})
addressInfo = bchClient.getAddressInfo({
"address" => "14ydRmjd5Tzg7W2hJJ8nsuZvpQNVcLYCYN",
"rawtx" => false,
"reverse" => true,
"offset" => 0,
"limit" => 10
})
addressInfo = bchClient.getAddressInfo({
"address" : "14ydRmjd5Tzg7W2hJJ8nsuZvpQNVcLYCYN",
"rawtx" : false,
"reverse" : true,
"offset" : 0,
"limit" : 10
})
addressInfo := bchClient.GetAddressInfo(map[string]interface{}{
"address" : "14ydRmjd5Tzg7W2hJJ8nsuZvpQNVcLYCYN",
"rawtx" : false,
"reverse" : true,
"offset" : 0,
"limit" : 10,
})
Response Body
{
"payload": {
"cash_address": "qq824gn7smpdr3rlfyheuys2usqaud8weqp970t2a4",
"legacy_address": "12LYsbY21YAU2B3ucK9LkHNsm9gCtcpQMY",
"transactions": [
"2f7e843559567e7cbf20be06a8b5901dff86cbe923c46e862084e89522f04420",
"501c4c15455b0a28a3ae67ac58a5dd7e3017e28aac1b7dc08a588e3e5c32dd80"
],
"unconfirmed_transactions": [],
"transaction_count": 2,
"received_count": 1,
"spent_count": 1,
"total_received": 18.1825413,
"total_spent": 18.1825413,
"unconfirmed_total_received": 0,
"unconfirmed_total_spent": 0,
"balance": 0,
"unconfirmed_count": 0,
"first_datetime": "2017-12-25T10:04:11+00:00",
"first_timestamp": 1514196251,
"last_datetime": "2017-12-25T10:04:11+00:00",
"last_timestamp": 1514196251
},
"state": {
"code": 200,
"success": true
}
}
Info
Returns information about a specific address.
HTTP Request
GET https://api.blocksdk.com/v2/bch/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 |
---|---|---|
transactions | array | List of transactions received or sent to the address |
transaction_count | int | Number of transactions received or sent to the address |
unconfirmed_transactions | array | List of transactions not included in the block |
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 balance
curl -X GET 'https://api.blocksdk.com/v2/addresses/qq824gn7smpdr3rlfyheuys2usqaud8weqp970t2a4/balance' \
-H 'Content-Type: application/json' \
-H 'X-API-Token: my-api-token'
$balance = $bchClient->getAddressBalance([
"address" => "qq824gn7smpdr3rlfyheuys2usqaud8weqp970t2a4"
]);
var balance = bchClient.getAddressBalance({
"address" : "14ydRmjd5Tzg7W2hJJ8nsuZvpQNVcLYCYN"
})
balance = bchClient.getAddressBalance({
"address" => "14ydRmjd5Tzg7W2hJJ8nsuZvpQNVcLYCYN"
})
balance = bchClient.getAddressBalance({
"address" : "14ydRmjd5Tzg7W2hJJ8nsuZvpQNVcLYCYN"
})
balance := bchClient.GetAddressBalance(map[string]interface{}{
"address" : "14ydRmjd5Tzg7W2hJJ8nsuZvpQNVcLYCYN"
})
Response Body
{
"payload": {
"cash_address": "qq824gn7smpdr3rlfyheuys2usqaud8weqp970t2a4",
"legacy_address": "12LYsbY21YAU2B3ucK9LkHNsm9gCtcpQMY",
"balance": 0,
"unconfirmed_total_received": 0,
"unconfirmed_total_spent": 0
},
"state": {
"code": 200,
"success": true
}
}
Info
Returns the balance for a specific address.
HTTP Request
GET https://api.blocksdk.com/v2/bch/addresses/<address>/balance
URL Parameters
Parameter | Type | Description |
---|---|---|
address* | string | Return information from this address. |
Response
Variable | Type | Description |
---|---|---|
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 |
HD wallet creation
curl -X POST 'https://api.blocksdk.com/v2/bch/wallets/hd' \
-H 'Content-Type: application/json' \
-H 'X-API-Token: my-api-token'\
-d '{"name" : "IwbdtnYMSD8MWHWGOwBluLAlbEZoMROC4mQ"}'
$wallet = $bchClient->createHdWallet([
"name" => "IwbdtnYMSD8MWHWGOwBluLAlbEZoMROC4mQ"
]);
var wallet = bchClient.createHdWallet({
"name" : "IwbdtnYMSD8MWHWGOwBluLAlbEZoMROC4mQ"
})
wallet = bchClient.createHdWallet({
"name" => "IwbdtnYMSD8MWHWGOwBluLAlbEZoMROC4mQ"
})
wallet = bchClient.createHdWallet({
"name" : "IwbdtnYMSD8MWHWGOwBluLAlbEZoMROC4mQ"
})
wallet := bchClient.CreateHdWallet(map[string]interface{}{
"name" : "IwbdtnYMSD8MWHWGOwBluLAlbEZoMROC4mQ"
})
Response Body
{
"payload": {
"id": 311,
"name": "WC4UBZJxAypQpi48IQ6HSTBYX90KtDCJQCe",
"wif": "KxVwNQNtQnm5MXjRiM8ciwNSfp8R5SzeAbz3pCNkN6WZL3j6t69R",
"datetime": "2021-01-12T08:50:47+00:00",
"timestamp": 1610441447
},
"state": {
"code": 201,
"success": true
}
}
Info
Create an HD wallet.
HTTP Request
POST https://api.blocksdk.com/v2/bch/wallets/hd
Body Parameters
Parameter | Type | Default | Description |
---|---|---|---|
name | string | random | Wallet name |
Response
Variable | Type | Description |
---|---|---|
id | int | Wallet unique id |
name | string | Wallet identification name |
wif | string | Wallet 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. |
Wallet list
curl -X GET 'https://api.blocksdk.com/v2/bch/wallets' \
-H 'Content-Type: application/json' \
-H 'X-API-Token: my-api-token'
$wallets = $bchClient->getWallets([
"offset" => 0,
"limit" => 10
]);
var wallets = bchClient.getWallets({
"offset" : 0,
"limit" : 10
})
wallets = bchClient.getWallets({
"offset" => 0,
"limit" => 10
})
wallets = bchClient.getWallets({
"offset" : 0,
"limit" : 10
})
wallets := bchClient.GetWallets(map[string]interface{}{
"offset" : 0,
"limit" : 10
})
Response Body
{
"payload": [
{
"id": 311,
"name": "WC4UBZJxAypQpi48IQ6HSTBYX90KtDCJQCe",
"datetime": "2021-01-12T08:50:47+00:00",
"timestamp": 1610441447
}
],
"state": {
"code": 200,
"success": true
}
}
Info
Returns the list of wallets created.
HTTP Request
GET https://api.blocksdk.com/v2/bch/wallets
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 | Wallet unique id |
name | string | Wallet identification name |
datetime | string | Date and time the wallet was created |
timestamp | int | Date and time the wallet was created |
Specific wallet information
curl -X GET 'https://api.blocksdk.com/v2/bch/wallets/311' \
-H 'Content-Type: application/json' \
-H 'X-API-Token: my-api-token'
$wallet = $bchClient->getWallet([
"wallet_id" => 311
]);
var wallet = bchClient.getWallet({
"wallet_id" : 311
})
wallet = bchClient.getWallet({
"wallet_id" => 311
})
wallet = bchClient.getWallet({
"wallet_id" : 311
})
wallet := bchClient.GetWallet(map[string]interface{}{
"wallet_id" : 466
})
Response Body
{
"payload": {
"id": 311,
"name": "WC4UBZJxAypQpi48IQ6HSTBYX90KtDCJQCe",
"address_count": 0,
"transaction_count": 0,
"unspent_transaction_count": 0,
"loaded": false,
"datetime": "2021-01-12T08:50:47+00:00",
"timestamp": 1610441447
},
"state": {
"code": 200,
"success": true
}
}
Info
Returns information about a specific wallet.
HTTP Request
GET https://api.blocksdk.com/v2/bch/wallets/<wallet_id>
URL Parameters
Parameter | Type | Description |
---|---|---|
wallet_id* | int | Wallet ID to return information |
Response
Variable | Type | Description |
---|---|---|
id | int | Wallet unique id |
name | string | Wallet identification name |
address_count | int | Number of addresses created in wallet |
transaction_count | int | Total number of transactions received or sent |
loaded | boolean | Loading state |
datetime | string | Date and time the wallet was created |
timestamp | int | Date and time the wallet was created |
Wallet loading
curl -X POST 'https://api.blocksdk.com/v2/bch/wallets/311/load' \
-H 'Content-Type: application/json' \
-H 'X-API-Token: my-api-token' \
-d '{
"wif" : "L5PGqGxSA7zTyHdNSVCKN8jzt3RKz9nn2KvUjdzyfsW1Czvqu5BG",
"password" : "abcdef123456"
}'
$load = $bchClient->loadWallet([
"wallet_id" => 467,
"wif" => ""KxVwNQNtQnm5MXjRiM8ciwNSfp8R5SzeAbz3pCNkN6WZL3j6t69R",",
"password" => "abcdef123456"
]);
var load = bchClient.loadWallet({
"wallet_id" : 467,
"wif" : "L5PGqGxSA7zTyHdNSVCKN8jzt3RKz9nn2KvUjdzyfsW1Czvqu5BG",
"password" : "abcdef123456"
})
load = bchClient.loadWallet({
"wallet_id" => 467,
"wif" => "L5PGqGxSA7zTyHdNSVCKN8jzt3RKz9nn2KvUjdzyfsW1Czvqu5BG",
"password" => "abcdef123456"
})
load = bchClient.loadWallet({
"wallet_id" : 467,
"wif" : "L5PGqGxSA7zTyHdNSVCKN8jzt3RKz9nn2KvUjdzyfsW1Czvqu5BG",
"password" : "abcdef123456"
})
load := bchClient.LoadWallet(map[string]interface{}{
"wallet_id" : 470,
"wif" : "L5PGqGxSA7zTyHdNSVCKN8jzt3RKz9nn2KvUjdzyfsW1Czvqu5BG",
"password" : "abcdef123456"
})
Response Body
{
"payload": {
"id": 467,
"loaded": true
},
"state": {
"code": 201,
"success": true
}
}
Info
Load a specific wallet.
The loaded wallet can create transactions or addresses with passwords without wif.
HTTP Request
POST https://api.blocksdk.com/v2/bch/wallets/<wallet_id>/load
URL Parameters
Parameter | Type | Description |
---|---|---|
wallet_id* | int | Wallet id to load |
Body Parameters
Parameter | Type | Description |
---|---|---|
password* | string | Loaded wallets require this password when creating a transaction or address. |
wif* | string | This is the wif returned when the wallet was created |
Response
Variable | Type | Description |
---|---|---|
id | int | Wallet unique id |
loaded | boolean | Loading state |
Unload wallet
curl -X GET 'https://api.blocksdk.com/v2/bch/wallets/311/unload' \
-H 'Content-Type: application/json' \
-H 'X-API-Token: my-api-token'
$unload = $bchClient->unloadWallet([
"wallet_id" => 311
]);
var unload = bchClient.unloadWallet({
"wallet_id" : 311
})
unload = bchClient.unloadWallet({
"wallet_id" => 311
})
unload = bchClient.unloadWallet({
"wallet_id" : 311
})
unload := bchClient.UnloadWallet(map[string]interface{}{
"wallet_id" : 467
})
Response Body
{
"payload": {
"id": 311,
"loaded": false
},
"state": {
"code": 201,
"success": true
}
}
Info
Unload the loaded wallet.
HTTP Request
POST https://api.blocksdk.com/v2/bch/wallets/<wallet_id>/unload
URL Parameters
Parameter | Type | Description |
---|---|---|
wallet_id* | int | Wallet ID to unload |
Response
Variable | Type | Description |
---|---|---|
id | int | Wallet unique id |
loaded | boolean | Loading state |
Wallet balance
curl -X GET 'https://api.blocksdk.com/v2/bch/wallets/311/balance' \
-H 'Content-Type: application/json' \
-H 'X-API-Token: my-api-token'
$walletBalance = $bchClient->getWalletBalance([
"wallet_id" => 311
]);
var walletBalance = bchClient.getWalletBalance({
"wallet_id" : 311
})
walletBalance = bchClient.getWalletBalance({
"wallet_id" => 311
})
walletBalance = bchClient.getWalletBalance({
"wallet_id" : 311
})
walletBalance := bchClient.GetWalletBalance(map[string]interface{}{
"wallet_id" : 467
})
Response Body
{
"payload": {
"balance": 0,
"unconfirmed_balance": 0
},
"state": {
"code": 200,
"success": true
}
}
Info
Returns the remaining balance information for a specific wallet.
HTTP Request
GET https://api.blocksdk.com/v2/bch/wallets/<wallet_id>/balance
URL Parameters
Parameter | Type | Description |
---|---|---|
wallet_id* | int | Wallet ID to return balance |
Response
Variable | Type | Description |
---|---|---|
balance | double | Balance left in wallet |
unconfirmed_balance | double | The remaining balance not included in the block and pending use |
Wallet address list
curl -X GET 'https://api.blocksdk.com/v2/bch/wallets/311/addresses' \
-H 'Content-Type: application/json' \
-H 'X-API-Token: my-api-token'
$wallet_addresses = $bchClient->getWalletAddresses([
"wallet_id" => 311,
"offset" => 0,
"limit" => 10
]);
var wallet_addresses = bchClient.getWalletAddresses({
"wallet_id" : 311,
"offset" : 0,
"limit" : 10
})
wallet_addresses = bchClient.getWalletAddresses({
"wallet_id" => 311,
"offset" => 0,
"limit" => 10
})
wallet_addresses = bchClient.getWalletAddresses({
"wallet_id" : 311,
"offset" : 0,
"limit" : 10
})
wallet_addresses := bchClient.GetWalletAddresses(map[string]interface{}{
"wallet_id" : 467,
"offset" : 0,
"limit" : 10
})
Response Body
{
"payload": [
{
"address": "qzdwmfvxxtp2sslamv0t08plsgldxlcxyyha42r4nq",
"hdkeypath": "m/0'/0'/0'",
"datetime": "2021-01-12T09:15:05+00:00",
"timestamp": 1610442905
}
],
"state": {
"code": 200,
"success": true
}
}
Info
Returns a list of addresses generated by a specific wallet.
HTTP Request
GET https://api.blocksdk.com/v2/bch/wallets/<wallet_id>/addresses
URL Parameters
Parameter | Type | Description |
---|---|---|
wallet_id* | int | Wallet ID to return address list |
Query Parameters
Parameter | Type | Default | Description |
---|---|---|---|
address | string | --- | Filter by this address |
hdkeypath | string | --- | Filter by this hdkeypath |
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 |
Create wallet address
curl -X POST 'https://api.blocksdk.com/v2/bch/wallets/311/addresses' \
-H 'Content-Type: application/json' \
-H 'X-API-Token: my-api-token' \
-d '{
"wif" : "KxVwNQNtQnm5MXjRiM8ciwNSfp8R5SzeAbz3pCNkN6WZL3j6t69R"
}'
$address = $bchClient->createWalletAddress([
"wallet_id" => 470,
"wif" => "L5PGqGxSA7zTyHdNSVCKN8jzt3RKz9nn2KvUjdzyfsW1Czvqu5BG"
]);
or
$address = $bchClient->createWalletAddress([
"wallet_id" => 470,
"password" => "abcdefg"
]);
var address = bchClient.createWalletAddress({
"wallet_id" : 470,
"wif" : "L5PGqGxSA7zTyHdNSVCKN8jzt3RKz9nn2KvUjdzyfsW1Czvqu5BG"
})
or
var address = bchClient.createWalletAddress({
"wallet_id" : 470,
"password" : "abcdefg"
})
address = bchClient.createWalletAddress({
"wallet_id" => 470,
"wif" => "L5PGqGxSA7zTyHdNSVCKN8jzt3RKz9nn2KvUjdzyfsW1Czvqu5BG"
})
or
address = bchClient.createWalletAddress({
"wallet_id" => 470,
"password" => "abcdefg"
})
address = bchClient.createWalletAddress({
"wallet_id" : 470,
"wif" : "L5PGqGxSA7zTyHdNSVCKN8jzt3RKz9nn2KvUjdzyfsW1Czvqu5BG"
})
or
address = bchClient.createWalletAddress({
"wallet_id" : 470,
"password" : "abcdefg"
})
address := bchClient.CreateWalletAddress(map[string]interface{}{
"wallet_id" : 470,
"wif" : "L5PGqGxSA7zTyHdNSVCKN8jzt3RKz9nn2KvUjdzyfsW1Czvqu5BG"
})
or
address := bchClient.CreateWalletAddress(map[string]interface{}{
"wallet_id" : 470,
"password" : "abcdefg"
})
Response Body
{
"payload": {
"address": "qr4n94pk83jm9w40rlz3qnyvlu6u460xkvkvm77nm8",
"hdkeypath": "m/0'/0'/4'",
"datetime": "2021-01-12T09:17:09+00:00",
"timestamp": 1610443029
},
"state": {
"code": 201,
"success": true
}
}
Info
Create an address in a specific wallet.
HTTP Request
POST https://api.blocksdk.com/v2/bch/wallets/<wallet_id>/addresses
URL Parameters
Parameter | Type | Description |
---|---|---|
wallet_id* | int | Wallet ID to create address |
Body Parameters
Parameter | Type | Description |
---|---|---|
password | string | If the wallet is loaded, you can create an address with a password. |
wif | string | This value is mandatory if the wallet is not loaded. Issued when the wallet is created. |
Response
Variable | Type | Description |
---|---|---|
address | string | Generated address |
hdkeypath | string | Hd path of generated address |
datetime | string | Address creation date and time |
timestamp | string | Address creation date and time |
Wallet transaction list
curl -X GET 'https://api.blocksdk.com/v2/bch/wallets/215/transactions' \
-H 'Content-Type: application/json' \
-H 'X-API-Token: my-api-token'
$wallet_transactions = $bchClient->getWalletTransactions([
"wallet_id" => 215,
"type" => "all",
"order" => "desc",
"offset" => 0,
"limit" => 10
]);
var wallet_transactions = bchClient.getWalletTransactions({
"wallet_id" : 215,
"type" : "all",
"order" : "desc",
"offset" : 0,
"limit" : 10
})
wallet_transactions = bchClient.getWalletTransactions({
"wallet_id" => 215,
"type" => "all",
"order" => "desc",
"offset" => 0,
"limit" => 10
})
wallet_transactions = bchClient.getWalletTransactions({
"wallet_id" : 215,
"type" : "all",
"order" : "desc",
"offset" : 0,
"limit" : 10
})
wallet_transactions := bchClient.GetWalletTransactions(map[string]interface{}{
"wallet_id" : 215,
"type" : "all",
"order" : "desc",
"offset" : 0,
"limit" : 10
})
Response Body
{
"payload": [
{
"txid": "00558c78ff245f0050c1ae8f5ca37bc7d8c12da11d171e1c3f7bb2622aecbe21",
"type": "received",
"address": "qrshfugt42m4y8gdgyrag9sdxgpl3ft0dsp4l4c9xw",
"amount": 0.00002300,
"confirmations": 5
},
...
],
"state": {
"code": 200,
"success": true
}
}
Info
Returns a list of transactions received or sent to the wallet.
HTTP Request
GET https://api.blocksdk.com/v2/bch/wallets/<wallet_id>/transactions
URL Parameters
Parameter | Type | Description |
---|---|---|
wallet_id* | int | Wallet ID to return transaction list |
Query Parameters
Parameter | Type | Default | Description |
---|---|---|---|
type | string | all | Type of transaction (all,receive,spent,unspent) |
order | string | desc | Sort by newest, oldest (asc,desc) |
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 |
---|---|---|
txid | string | transaction id, transaction hash |
type | string | Transaction type (receive,spent,unspent) |
address | string | Address used for transaction |
amount | string | Transaction amount |
Transfer wallet amount
curl -X POST 'https://api.blocksdk.com/v2/bch/wallets/125/sendtoaddress' \
-H 'Content-Type: application/json' \
-H 'X-API-Token: my-api-token' \
-d '{
"wif" : "KxVwNQNtQnm5MXjRiM8ciwNSfp8R5SzeAbz3pCNkN6WZL3j6t69R",
"address" : "qrshfugt42m4y8gdgyrag9sdxgpl3ft0dsp4l4c9xw",
"amount" : 0.0001
}'
$tx = $bchClient->sendToAddress([
"wallet_id" => 125,
"wif" => "KxVwNQNtQnm5MXjRiM8ciwNSfp8R5SzeAbz3pCNkN6WZL3j6t69R",
"address" => "qrshfugt42m4y8gdgyrag9sdxgpl3ft0dsp4l4c9xw",
"amount" => 0.000023
])
or
$tx = $bchClient->sendToAddress([
"wallet_id" => 125,
"password" => "abcdefg",
"address" => "qrshfugt42m4y8gdgyrag9sdxgpl3ft0dsp4l4c9xw",
"amount" => 0.000023
])
var tx = bchClient.sendToAddress({
"wallet_id" : 125,
"wif" : "L5PGqGxSA7zTyHdNSVCKN8jzt3RKz9nn2KvUjdzyfsW1Czvqu5BG",
"address" : "1KWbGyMn9MMwQSRLYtWqszcpNST9TqC1vg",
"amount" : 0.0001
})
or
var tx = bchClient.sendToAddress({
"wallet_id" : 125,
"password" : "abcdefg",
"address" : "1KWbGyMn9MMwQSRLYtWqszcpNST9TqC1vg",
"amount" : 0.0001
})
tx = bchClient.sendToAddress({
"wallet_id" => 125,
"wif" => "L5PGqGxSA7zTyHdNSVCKN8jzt3RKz9nn2KvUjdzyfsW1Czvqu5BG",
"address" => "1KWbGyMn9MMwQSRLYtWqszcpNST9TqC1vg",
"amount" => 0.0001
})
or
tx = bchClient.sendToAddress({
"wallet_id" => 125,
"password" => "abcdefg",
"address" => "1KWbGyMn9MMwQSRLYtWqszcpNST9TqC1vg",
"amount" => 0.0001
})
tx = bchClient.sendToAddress({
"wallet_id" : 125,
"wif" : "L5PGqGxSA7zTyHdNSVCKN8jzt3RKz9nn2KvUjdzyfsW1Czvqu5BG",
"address" : "1KWbGyMn9MMwQSRLYtWqszcpNST9TqC1vg",
"amount" : 0.0001
})
or
tx = bchClient.sendToAddress({
"wallet_id" : 125,
"password" : "abcdefg",
"address" : "1KWbGyMn9MMwQSRLYtWqszcpNST9TqC1vg",
"amount" : 0.0001
})
tx := bchClient.SendToAddress(map[string]interface{}{
"wallet_id" : 125,
"wif" : "L5PGqGxSA7zTyHdNSVCKN8jzt3RKz9nn2KvUjdzyfsW1Czvqu5BG",
"address" : "1KWbGyMn9MMwQSRLYtWqszcpNST9TqC1vg",
"amount" : 0.0001
})
or
tx := bchClient.SendToAddress(map[string]interface{}{
"wallet_id" : 125,
"password" : "abcdefg",
"address" : "1KWbGyMn9MMwQSRLYtWqszcpNST9TqC1vg",
"amount" : 0.0001
})
Response Body
{
"payload": {
"txid": "00558c78ff245f0050c1ae8f5ca37bc7d8c12da11d171e1c3f7bb2622aecbe21",
"version": 2,
"size": 219,
"inputs": [
{
"txid": "6b627e7b398863f86cb2d84be9195252343caa80a0d052b804d02e64da8dd285",
"output_index": 1,
"script": {
"ams": "1bbecd69c6f0ae359d7ff7b24e5581a9b08347013e93fe470754fdfed34a70a7b5048d5c37a5f43ea7a00a4b747c757fa8a02053b3355dbb91ad211edf213ff141 02500d108148babf67b43768612f79fa33412648a8de79a2245d80df1733f1dab1",
"hex": "411bbecd69c6f0ae359d7ff7b24e5581a9b08347013e93fe470754fdfed34a70a7b5048d5c37a5f43ea7a00a4b747c757fa8a02053b3355dbb91ad211edf213ff1412102500d108148babf67b43768612f79fa33412648a8de79a2245d80df1733f1dab1"
},
"addresses": [
"bitcoincash:qqs8420g6ddv2qzfw7ugea43ajd8t3th8s7euu7wmt"
],
"value": 0.03649129
}
],
"total_input": 0.03649129,
"outputs": [
{
"value": 2.3e-5,
"index": 0,
"script": {
"type": "pubkeyhash",
"asm": "OP_DUP OP_HASH160 e174f10baab7521d0d4107d4160d3203f8a56f6c OP_EQUALVERIFY OP_CHECKSIG",
"hex": "76a914e174f10baab7521d0d4107d4160d3203f8a56f6c88ac"
},
"addresses": [
"bitcoincash:qrshfugt42m4y8gdgyrag9sdxgpl3ft0dsp4l4c9xw"
]
},
{
"value": 0.03646609,
"index": 1,
"script": {
"type": "pubkeyhash",
"asm": "OP_DUP OP_HASH160 207aa9e8d35ac5004977b88cf6b1ec9a75c5773c OP_EQUALVERIFY OP_CHECKSIG",
"hex": "76a914207aa9e8d35ac5004977b88cf6b1ec9a75c5773c88ac"
},
"addresses": [
"bitcoincash:qqs8420g6ddv2qzfw7ugea43ajd8t3th8s7euu7wmt"
]
}
],
"total_output": 0.03648909,
"input_count": 1,
"output_count": 2,
"fee": 2.2e-6,
"fee_per_kb": 1.005e-5,
"locktime": 0,
"block_hash": "000000000000000000a8b10032ba9fb3c4525ec8d0474f6cbecc3204713b698f",
"block_height": 670111,
"datetime": "2021-01-13T02:47:28+00:00",
"timestamp": 1610506048,
"confirmations": 6
},
"state": {
"code": 200,
"success": true
}
}
Info
Send the amount to a specific address.
HTTP Request
POST https://api.blocksdk.com/v2/bch/wallets/<wallet_id>/sendtoaddress
URL Parameters
Parameter | Type | Description |
---|---|---|
wallet_id* | int | Wallet ID to transfer coin to |
Body Parameters
Parameter | Type | Default | Description |
---|---|---|---|
password | string | --- | If the wallet is loaded, you can create a transaction with your password. |
wif | string | --- | This value is mandatory if the wallet is not loaded. Issued when the wallet is created. |
kbfee | double | --- | Fee per kb |
address* | string | --- | Address to receive coin |
amount* | double | --- | Amount to send |
subtractfeefromamount | boolean | false | If this value is true, the fee is deducted from the amount to be sent. |
Response
Transaction Object
Wallet multi-coin transfer
curl -X POST 'https://api.blocksdk.com/v2/bch/wallets/125/sendtoaddress' \
-H 'Content-Type: application/json' \
-H 'X-API-Token: my-api-token' \
-d '{
"wif" : "KxVwNQNtQnm5MXjRiM8ciwNSfp8R5SzeAbz3pCNkN6WZL3j6t69R",
"to" : {
"qrshfugt42m4y8gdgyrag9sdxgpl3ft0dsp4l4c9xw" : 000023
}
}'
$tx = $bchClient->sendMany([
"wallet_id" => 125,
"wif" => "KxVwNQNtQnm5MXjRiM8ciwNSfp8R5SzeAbz3pCNkN6WZL3j6t69R",
"to" => [
"qrshfugt42m4y8gdgyrag9sdxgpl3ft0dsp4l4c9xw" => 0.000023
],
]);
or
$tx = $bchClient->sendMany([
"wallet_id" => 125,
"password" => "asd",
"to" => [
"qrshfugt42m4y8gdgyrag9sdxgpl3ft0dsp4l4c9xw" => 0.000023
]
]);
var tx = bchClient.sendMany({
"wallet_id" : 125,
"wif" : "L5PGqGxSA7zTyHdNSVCKN8jzt3RKz9nn2KvUjdzyfsW1Czvqu5BG",
"to" : {
"1KWbGyMn9MMwQSRLYtWqszcpNST9TqC1vg" : 0.0001,
"1AxZmuy1kMK4VXQzGuvzQNmqP2s9mS9vBu" : 0.00006840
},
})
or
var tx = bchClient.sendMany({
"wallet_id" : 125,
"password" : "abcdefg",
"to" : {
"1KWbGyMn9MMwQSRLYtWqszcpNST9TqC1vg" : 0.0001,
"1AxZmuy1kMK4VXQzGuvzQNmqP2s9mS9vBu" : 0.00006840
}
})
tx = bchClient.sendMany({
"wallet_id" => 125,
"wif" => "L5PGqGxSA7zTyHdNSVCKN8jzt3RKz9nn2KvUjdzyfsW1Czvqu5BG",
"to" => {
"1KWbGyMn9MMwQSRLYtWqszcpNST9TqC1vg" => 0.0001,
"1AxZmuy1kMK4VXQzGuvzQNmqP2s9mS9vBu" => 0.00006840
},
})
or
tx = bchClient.sendMany({
"wallet_id" => 125,
"password" => "abcdefg",
"to" => {
"1KWbGyMn9MMwQSRLYtWqszcpNST9TqC1vg" => 0.0001,
"1AxZmuy1kMK4VXQzGuvzQNmqP2s9mS9vBu" => 0.00006840
}
})
tx = bchClient.sendMany({
"wallet_id" : 125,
"wif" : "L5PGqGxSA7zTyHdNSVCKN8jzt3RKz9nn2KvUjdzyfsW1Czvqu5BG",
"to" : {
"1KWbGyMn9MMwQSRLYtWqszcpNST9TqC1vg" : 0.0001,
"1AxZmuy1kMK4VXQzGuvzQNmqP2s9mS9vBu" : 0.00006840
},
})
or
tx = bchClient.sendMany({
"wallet_id" : 125,
"password" : "abcdefg",
"to" : {
"1KWbGyMn9MMwQSRLYtWqszcpNST9TqC1vg" : 0.0001,
"1AxZmuy1kMK4VXQzGuvzQNmqP2s9mS9vBu" : 0.00006840
}
})
tx := bchClient.SendMany(map[string]interface{}{
"wallet_id" : 125,
"wif" : "L5PGqGxSA7zTyHdNSVCKN8jzt3RKz9nn2KvUjdzyfsW1Czvqu5BG",
"to" : {
"1KWbGyMn9MMwQSRLYtWqszcpNST9TqC1vg" : 0.0001,
"1AxZmuy1kMK4VXQzGuvzQNmqP2s9mS9vBu" : 0.00006840
}
})
or
tx := bchClient.SendMany(map[string]interface{}{
"wallet_id" : 125,
"password" : "abcdefg",
"to" : {
"1KWbGyMn9MMwQSRLYtWqszcpNST9TqC1vg" : 0.0001,
"1AxZmuy1kMK4VXQzGuvzQNmqP2s9mS9vBu" : 0.00006840
}
})
Response Body
{
"payload": {
"txid": "00558c78ff245f0050c1ae8f5ca37bc7d8c12da11d171e1c3f7bb2622aecbe21",
"version": 2,
"size": 219,
"inputs": [
{
"txid": "6b627e7b398863f86cb2d84be9195252343caa80a0d052b804d02e64da8dd285",
"output_index": 1,
"script": {
"ams": "1bbecd69c6f0ae359d7ff7b24e5581a9b08347013e93fe470754fdfed34a70a7b5048d5c37a5f43ea7a00a4b747c757fa8a02053b3355dbb91ad211edf213ff141 02500d108148babf67b43768612f79fa33412648a8de79a2245d80df1733f1dab1",
"hex": "411bbecd69c6f0ae359d7ff7b24e5581a9b08347013e93fe470754fdfed34a70a7b5048d5c37a5f43ea7a00a4b747c757fa8a02053b3355dbb91ad211edf213ff1412102500d108148babf67b43768612f79fa33412648a8de79a2245d80df1733f1dab1"
},
"addresses": [
"bitcoincash:qqs8420g6ddv2qzfw7ugea43ajd8t3th8s7euu7wmt"
],
"value": 0.03649129
}
],
"total_input": 0.03649129,
"outputs": [
{
"value": 2.3e-5,
"index": 0,
"script": {
"type": "pubkeyhash",
"asm": "OP_DUP OP_HASH160 e174f10baab7521d0d4107d4160d3203f8a56f6c OP_EQUALVERIFY OP_CHECKSIG",
"hex": "76a914e174f10baab7521d0d4107d4160d3203f8a56f6c88ac"
},
"addresses": [
"bitcoincash:qrshfugt42m4y8gdgyrag9sdxgpl3ft0dsp4l4c9xw"
]
},
{
"value": 0.03646609,
"index": 1,
"script": {
"type": "pubkeyhash",
"asm": "OP_DUP OP_HASH160 207aa9e8d35ac5004977b88cf6b1ec9a75c5773c OP_EQUALVERIFY OP_CHECKSIG",
"hex": "76a914207aa9e8d35ac5004977b88cf6b1ec9a75c5773c88ac"
},
"addresses": [
"bitcoincash:qqs8420g6ddv2qzfw7ugea43ajd8t3th8s7euu7wmt"
]
}
],
"total_output": 0.03648909,
"input_count": 1,
"output_count": 2,
"fee": 2.2e-6,
"fee_per_kb": 1.005e-5,
"locktime": 0,
"block_hash": "000000000000000000a8b10032ba9fb3c4525ec8d0474f6cbecc3204713b698f",
"block_height": 670111,
"datetime": "2021-01-13T02:47:28+00:00",
"timestamp": 1610506048,
"confirmations": 6
},
"state": {
"code": 200,
"success": true
}
}
Info
Send money to multiple addresses.
HTTP Request
POST https://api.blocksdk.com/v2/bch/wallets/<wallet_id>/sendmany
URL Parameters
Parameter | Type | Description |
---|---|---|
wallet_id* | int | Wallet ID to transfer coin to |
Body Parameters
Parameter | Type | Default | Description |
---|---|---|---|
password | string | --- | If the wallet is loaded, you can create a transaction with your password. |
wif | string | --- | This value is mandatory if the wallet is not loaded. Issued when the wallet is created. |
kbfee | double | --- | Fee per kb |
to* | object | --- | List of address and amount to receive the amount |
subtractfeefromamount | boolean | false | If this value is true, the fee is deducted from the amount to be sent. |
to Sample
` {
"qrshfugt42m4y8gdgyrag9sdxgpl3ft0dsp4l4c9xw" : 0.0012 ,
"qqs8420g6ddv2qzfw7ugea43ajd8t3th8s7euu7wmt" : 0.031
} `
Response
Transaction Object
Send Transaction
curl -X POST 'https://api.blocksdk.com/v2/bch/transactions/send' \
-H 'Content-Type: application/json' \
-H 'X-API-Token: my-api-token' \
-d '{
"hex" : "020000000185d28dda642ed004b852d0a080aa3c34525219e94bd8b26cf86388397b7e626b0100000064411bbecd69c6f0ae359d7ff7b24e5581a9b08347013e93fe470754fdfed34a70a7b5048d5c37a5f43ea7a00a4b747c757fa8a02053b3355dbb91ad211edf213ff1412102500d108148babf67b43768612f79fa33412648a8de79a2245d80df1733f1dab10000000002fc080000000000001976a914e174f10baab7521d0d4107d4160d3203f8a56f6c88ac91a43700000000001976a914207aa9e8d35ac5004977b88cf6b1ec9a75c5773c88ac00000000"
}'
$tx = $bchClient->sendTransaction([
"hex" => "020000000185d28dda642ed004b852d0a080aa3c34525219e94bd8b26cf86388397b7e626b0100000064411bbecd69c6f0ae359d7ff7b24e5581a9b08347013e93fe470754fdfed34a70a7b5048d5c37a5f43ea7a00a4b747c757fa8a02053b3355dbb91ad211edf213ff1412102500d108148babf67b43768612f79fa33412648a8de79a2245d80df1733f1dab10000000002fc080000000000001976a914e174f10baab7521d0d4107d4160d3203f8a56f6c88ac91a43700000000001976a914207aa9e8d35ac5004977b88cf6b1ec9a75c5773c88ac00000000"
]);
$tx = $btcClient->sendTransaction([
"hex" => "010000000001020f97230a629600ef2ce03116f910b172248b54a1c006fb0ee5999aab03a0a11000000000171600142a7466cd986288292aa43a2c9e4874c6f2f9a7ccffffffff0e65c24edd64b6ecf75cccb8329c5975ea3011d91219127ccd6741ba583253a30000000017160014760c51588eebf1d9f26c81335c70c42aea4f1a59ffffffff0210270000000000001976a914cb0af04acb1be057e1172119b94383f4653fa3b788acb81a0000000000001976a9146d3b5e5d8d8bd035ce785d3bb27c332d7cfced1c88ac02483045022100fe68240f0531038b8834025abd4d9338d7bbc0095f9f9301e0f02e159aa033e1022068edeae31080b32106a59cef92445c78e296797d8c4af193a0f5eaef1588f9c4012103508333612a63bd0b26bb9814bc1cfb53d8e2a3f1f237171e33223a8eeaa7da6f02483045022100acad6d184ac1dfd04ea335039ed329e79b76668cb90609fbabd8b3d6442e4c7d0220460961d945286f698e234000fb42e10dc4be566eac949c82060897a3c546137c0121027960d1c0511bcf5722afea96adb1c59aa584b48cdb88b802e0ead360e73a130a00000000"
]);
var tx = btcClient.sendTransaction({
"hex" : "010000000001020f97230a629600ef2ce03116f910b172248b54a1c006fb0ee5999aab03a0a11000000000171600142a7466cd986288292aa43a2c9e4874c6f2f9a7ccffffffff0e65c24edd64b6ecf75cccb8329c5975ea3011d91219127ccd6741ba583253a30000000017160014760c51588eebf1d9f26c81335c70c42aea4f1a59ffffffff0210270000000000001976a914cb0af04acb1be057e1172119b94383f4653fa3b788acb81a0000000000001976a9146d3b5e5d8d8bd035ce785d3bb27c332d7cfced1c88ac02483045022100fe68240f0531038b8834025abd4d9338d7bbc0095f9f9301e0f02e159aa033e1022068edeae31080b32106a59cef92445c78e296797d8c4af193a0f5eaef1588f9c4012103508333612a63bd0b26bb9814bc1cfb53d8e2a3f1f237171e33223a8eeaa7da6f02483045022100acad6d184ac1dfd04ea335039ed329e79b76668cb90609fbabd8b3d6442e4c7d0220460961d945286f698e234000fb42e10dc4be566eac949c82060897a3c546137c0121027960d1c0511bcf5722afea96adb1c59aa584b48cdb88b802e0ead360e73a130a00000000"
})
tx = btcClient.sendTransaction({
"hex" => "010000000001020f97230a629600ef2ce03116f910b172248b54a1c006fb0ee5999aab03a0a11000000000171600142a7466cd986288292aa43a2c9e4874c6f2f9a7ccffffffff0e65c24edd64b6ecf75cccb8329c5975ea3011d91219127ccd6741ba583253a30000000017160014760c51588eebf1d9f26c81335c70c42aea4f1a59ffffffff0210270000000000001976a914cb0af04acb1be057e1172119b94383f4653fa3b788acb81a0000000000001976a9146d3b5e5d8d8bd035ce785d3bb27c332d7cfced1c88ac02483045022100fe68240f0531038b8834025abd4d9338d7bbc0095f9f9301e0f02e159aa033e1022068edeae31080b32106a59cef92445c78e296797d8c4af193a0f5eaef1588f9c4012103508333612a63bd0b26bb9814bc1cfb53d8e2a3f1f237171e33223a8eeaa7da6f02483045022100acad6d184ac1dfd04ea335039ed329e79b76668cb90609fbabd8b3d6442e4c7d0220460961d945286f698e234000fb42e10dc4be566eac949c82060897a3c546137c0121027960d1c0511bcf5722afea96adb1c59aa584b48cdb88b802e0ead360e73a130a00000000"
})
tx = btcClient.sendTransaction({
"hex" : "010000000001020f97230a629600ef2ce03116f910b172248b54a1c006fb0ee5999aab03a0a11000000000171600142a7466cd986288292aa43a2c9e4874c6f2f9a7ccffffffff0e65c24edd64b6ecf75cccb8329c5975ea3011d91219127ccd6741ba583253a30000000017160014760c51588eebf1d9f26c81335c70c42aea4f1a59ffffffff0210270000000000001976a914cb0af04acb1be057e1172119b94383f4653fa3b788acb81a0000000000001976a9146d3b5e5d8d8bd035ce785d3bb27c332d7cfced1c88ac02483045022100fe68240f0531038b8834025abd4d9338d7bbc0095f9f9301e0f02e159aa033e1022068edeae31080b32106a59cef92445c78e296797d8c4af193a0f5eaef1588f9c4012103508333612a63bd0b26bb9814bc1cfb53d8e2a3f1f237171e33223a8eeaa7da6f02483045022100acad6d184ac1dfd04ea335039ed329e79b76668cb90609fbabd8b3d6442e4c7d0220460961d945286f698e234000fb42e10dc4be566eac949c82060897a3c546137c0121027960d1c0511bcf5722afea96adb1c59aa584b48cdb88b802e0ead360e73a130a00000000"
})
tx := bchClient.SendTransaction(map[string]interface{}{
"hex" : "010000000001020f97230a629600ef2ce03116f910b172248b54a1c006fb0ee5999aab03a0a11000000000171600142a7466cd986288292aa43a2c9e4874c6f2f9a7ccffffffff0e65c24edd64b6ecf75cccb8329c5975ea3011d91219127ccd6741ba583253a30000000017160014760c51588eebf1d9f26c81335c70c42aea4f1a59ffffffff0210270000000000001976a914cb0af04acb1be057e1172119b94383f4653fa3b788acb81a0000000000001976a9146d3b5e5d8d8bd035ce785d3bb27c332d7cfced1c88ac02483045022100fe68240f0531038b8834025abd4d9338d7bbc0095f9f9301e0f02e159aa033e1022068edeae31080b32106a59cef92445c78e296797d8c4af193a0f5eaef1588f9c4012103508333612a63bd0b26bb9814bc1cfb53d8e2a3f1f237171e33223a8eeaa7da6f02483045022100acad6d184ac1dfd04ea335039ed329e79b76668cb90609fbabd8b3d6442e4c7d0220460961d945286f698e234000fb42e10dc4be566eac949c82060897a3c546137c0121027960d1c0511bcf5722afea96adb1c59aa584b48cdb88b802e0ead360e73a130a00000000"
})
Response Body
{
"payload": {
"txid": "00558c78ff245f0050c1ae8f5ca37bc7d8c12da11d171e1c3f7bb2622aecbe21",
"version": 2,
"size": 219,
"inputs": [
{
"txid": "6b627e7b398863f86cb2d84be9195252343caa80a0d052b804d02e64da8dd285",
"output_index": 1,
"script": {
"ams": "1bbecd69c6f0ae359d7ff7b24e5581a9b08347013e93fe470754fdfed34a70a7b5048d5c37a5f43ea7a00a4b747c757fa8a02053b3355dbb91ad211edf213ff141 02500d108148babf67b43768612f79fa33412648a8de79a2245d80df1733f1dab1",
"hex": "411bbecd69c6f0ae359d7ff7b24e5581a9b08347013e93fe470754fdfed34a70a7b5048d5c37a5f43ea7a00a4b747c757fa8a02053b3355dbb91ad211edf213ff1412102500d108148babf67b43768612f79fa33412648a8de79a2245d80df1733f1dab1"
},
"addresses": [
"bitcoincash:qqs8420g6ddv2qzfw7ugea43ajd8t3th8s7euu7wmt"
],
"value": 0.03649129
}
],
"total_input": 0.03649129,
"outputs": [
{
"value": 2.3e-5,
"index": 0,
"script": {
"type": "pubkeyhash",
"asm": "OP_DUP OP_HASH160 e174f10baab7521d0d4107d4160d3203f8a56f6c OP_EQUALVERIFY OP_CHECKSIG",
"hex": "76a914e174f10baab7521d0d4107d4160d3203f8a56f6c88ac"
},
"addresses": [
"bitcoincash:qrshfugt42m4y8gdgyrag9sdxgpl3ft0dsp4l4c9xw"
]
},
{
"value": 0.03646609,
"index": 1,
"script": {
"type": "pubkeyhash",
"asm": "OP_DUP OP_HASH160 207aa9e8d35ac5004977b88cf6b1ec9a75c5773c OP_EQUALVERIFY OP_CHECKSIG",
"hex": "76a914207aa9e8d35ac5004977b88cf6b1ec9a75c5773c88ac"
},
"addresses": [
"bitcoincash:qqs8420g6ddv2qzfw7ugea43ajd8t3th8s7euu7wmt"
]
}
],
"total_output": 0.03648909,
"input_count": 1,
"output_count": 2,
"fee": 2.2e-6,
"fee_per_kb": 1.005e-5,
"locktime": 0,
"block_hash": "000000000000000000a8b10032ba9fb3c4525ec8d0474f6cbecc3204713b698f",
"block_height": 670111,
"datetime": "2021-01-13T02:47:28+00:00",
"timestamp": 1610506048,
"confirmations": 6
},
"state": {
"code": 200,
"success": true
}
}
Info
Send the signed transaction.
HTTP Request
POST https://api.blocksdk.com/v2/bch/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/bch/transactions/00558c78ff245f0050c1ae8f5ca37bc7d8c12da11d171e1c3f7bb2622aecbe21' \
-H 'Content-Type: application/json' \
-H 'X-API-Token: my-api-token'
$tx = $bchClient->getTransaction([
"tx_id" => "00558c78ff245f0050c1ae8f5ca37bc7d8c12da11d171e1c3f7bb2622aecbe21"
]);
var tx = btcClient.getTransaction({
"tx_id" : "b7e98ec27b6fe51a1c1d7fc98ad0dd9c3f5953747901d4d3644fc3fc625c57a1"
})
tx = btcClient.getTransaction({
"tx_id" => "b7e98ec27b6fe51a1c1d7fc98ad0dd9c3f5953747901d4d3644fc3fc625c57a1"
})
tx = btcClient.getTransaction({
"tx_id" : "b7e98ec27b6fe51a1c1d7fc98ad0dd9c3f5953747901d4d3644fc3fc625c57a1"
})
tx := bchClient.GetTransaction(map[string]interface{}{
"tx_id" : "b7e98ec27b6fe51a1c1d7fc98ad0dd9c3f5953747901d4d3644fc3fc625c57a1"
})
Response Body
{
"payload": {
"txid": "00558c78ff245f0050c1ae8f5ca37bc7d8c12da11d171e1c3f7bb2622aecbe21",
"version": 2,
"size": 219,
"inputs": [
{
"txid": "6b627e7b398863f86cb2d84be9195252343caa80a0d052b804d02e64da8dd285",
"output_index": 1,
"script": {
"ams": "1bbecd69c6f0ae359d7ff7b24e5581a9b08347013e93fe470754fdfed34a70a7b5048d5c37a5f43ea7a00a4b747c757fa8a02053b3355dbb91ad211edf213ff141 02500d108148babf67b43768612f79fa33412648a8de79a2245d80df1733f1dab1",
"hex": "411bbecd69c6f0ae359d7ff7b24e5581a9b08347013e93fe470754fdfed34a70a7b5048d5c37a5f43ea7a00a4b747c757fa8a02053b3355dbb91ad211edf213ff1412102500d108148babf67b43768612f79fa33412648a8de79a2245d80df1733f1dab1"
},
"addresses": [
"bitcoincash:qqs8420g6ddv2qzfw7ugea43ajd8t3th8s7euu7wmt"
],
"value": 0.03649129
}
],
"total_input": 0.03649129,
"outputs": [
{
"value": 2.3e-5,
"index": 0,
"script": {
"type": "pubkeyhash",
"asm": "OP_DUP OP_HASH160 e174f10baab7521d0d4107d4160d3203f8a56f6c OP_EQUALVERIFY OP_CHECKSIG",
"hex": "76a914e174f10baab7521d0d4107d4160d3203f8a56f6c88ac"
},
"addresses": [
"bitcoincash:qrshfugt42m4y8gdgyrag9sdxgpl3ft0dsp4l4c9xw"
]
},
{
"value": 0.03646609,
"index": 1,
"script": {
"type": "pubkeyhash",
"asm": "OP_DUP OP_HASH160 207aa9e8d35ac5004977b88cf6b1ec9a75c5773c OP_EQUALVERIFY OP_CHECKSIG",
"hex": "76a914207aa9e8d35ac5004977b88cf6b1ec9a75c5773c88ac"
},
"addresses": [
"bitcoincash:qqs8420g6ddv2qzfw7ugea43ajd8t3th8s7euu7wmt"
]
}
],
"total_output": 0.03648909,
"input_count": 1,
"output_count": 2,
"fee": 2.2e-6,
"fee_per_kb": 1.005e-5,
"locktime": 0,
"block_hash": "000000000000000000a8b10032ba9fb3c4525ec8d0474f6cbecc3204713b698f",
"block_height": 670111,
"datetime": "2021-01-13T02:47:28+00:00",
"timestamp": 1610506048,
"confirmations": 6
},
"state": {
"code": 200,
"success": true
}
}
Info
Return information for a specific transaction.
HTTP Request
GET https://api.blocksdk.com/v2/bch/transactions/<tx_id>
URL Parameters
Parameter | Type | Description |
---|---|---|
tx_id | string | Transaction hash or transaction ID to return transaction information |
Response
Transaction Object
Transaction Object
Variable | Type | Description |
---|---|---|
txid | string | Transaction id,Transaction Hash |
version | int | Transaction version |
size | int | Transaction size |
inputs | array[object] | List of transactions used |
total_input | double | Total amount of transactions used |
outputs | array[object] | List of transactions received |
total_output | double | Total amount of transactions received |
input_count | int | Number of transactions used |
output_count | int | Number of transactions received |
fee | double | Fees used in the transaction |
fee_per_kb | double | Fee per kb unit |
locktime | int | Block height to be unlocked |
block_hash | string | Hash of the block containing the transaction |
block_height | string | The height of the block containing the transaction |
datetime | string | Date and time the transaction was created |
timestamp | int | Date and time the transaction was created |
Input Object
Variable | Type | Description |
---|---|---|
txid | string | Previous transaction id, transaction hash |
output_index | int | Previous transaction output number |
script | object | Signature script |
addresses | array | Address received from previous transaction |
value | double | Amount received from previous transaction |
Output Object
Variable | Type | Description |
---|---|---|
value | double | Amount to receive |
index | index | Transaction Output number |
script | object | Receive Address Script |
addresses | array | receiving address |