BitcoinCash
Create BitcoinCash Client
Object
TX
Name | Type | Content |
txid | string | hash of the transaction. |
hash | string | hash of the transaction. |
size | int | size of the transaction. |
version | char | version of the transaction. |
vin | array[vin] | List of inputs into transaction |
total_in | double | Total balance of transaction input |
vout | array[vout] | List of outputs into transaction |
total_out | double | Total balance of transaction output |
in_count | int | Transaction input count |
out_count | int | Transaction output count |
fee | double | Transaction fee |
fee_per_kb | double | Transaction fee per kb |
locktime | int | If not 0, this tells when a transaction output is spendable. |
block_hash | string | block hash including the transaction |
block_height | int | block height including the transaction |
time | int | The time contained in the block |
confirmations | int | Transaction Confirmation Count |
VIN
Name | Type | Content |
txid | string | hash of the transaction |
vout | int | the index of the output being redeemed from the origin transaction |
scriptSig | object | signature script |
addresses | array[string] | BitcoinCash Address |
value | double | Amount used |
VOUT
Name | Type | Content |
value | double | Amount received |
n | int | Output index |
scriptPubKey | object | the public key script used to pay coins |
addresses | array[string] | BitcoinCash Address |
GetBlockChain
GET
https://api.blocksdk.com/v1/bch/block
Response
Name | Type | Content |
height | int | number of most recent block. |
bestblockhash | string | hash of most recent block. |
prev_hash | string | Previous block hash of the most recent block |
unconfirmed_count | int | Unconfirmed Transaction Count |
low_fee_per_kb | double | Low Priority (7+ blocks) |
medium_fee_per_kb | double | Medium Priority (3-6 blocks) |
high_fee_per_kb | double | High Priority (1-2 blocks) |
GetBlock
GET
https://api.blocksdk.com/v1/bch/block/{block}
Path Parameters
Name | Type | Description |
---|---|---|
block | string | Block number or hash |
Query Parameters
Name | Type | Description |
---|---|---|
rawtx | boolean | Get transaction details |
limit | number | Number of transactions to import |
offset | number | Transaction List Offset |
Response
Name | Type | Content |
hash | string | hash of the block |
confirmations | int | Block Confirmation Count |
height | int | the block number |
time | int | The date and time at which a block is mined. |
tx | array | Transaction contained in the block |
tx_count | int | The number of transactions contained in the block |
input_total | double | Total input balance of transactions contained in the block |
input_count | int | The number of inputs for all transactions in the block |
out_total | double | Total output balance of transactions contained in the block |
out_count | int | The number of outputs for all transactions in the block |
fee_per_kb | double | Kb unit fee for all transactions in a block |
fee_total | double | Total transaction fee |
generation | double | Mining Compensation Including Fees |
reward | double | Block Mining Reward |
size | int | integer the size of this block in bytes. |
prev_hash | string | Previous block hash |
next_hash | string | Next block hash |
GetMemPool
GET
https://api.blocksdk.com/v1/bch/mempool
Query Parameters
Name | Type | Description |
---|---|---|
rawtx | boolean | Get transaction details |
offset | number | Transaction List Offset |
limit | number | Number of transactions to import |
GetAddressInfo
GET
https://api.blocksdk.com/v1/bch/address/{address}
Path Parameters
Name | Type | Description |
---|---|---|
address | string | BitcoinCash Address |
Query Parameters
Name | Type | Description |
---|---|---|
reverse | boolean | Reverse transaction information |
rawtx | boolean | Get transaction details |
offset | number | Transaction List Offset |
limit | number | Number of Transaction to import |
Response
Name | Type | Content |
address | string | BitcoinCash Address |
tx | array | Transaction originated from address |
tx_count | int | The number of transactions that occurred at the address |
received_count | int | The number of transactions received from the address |
received_total | double | Transaction amount received from the address |
received_unconfirmed | double | Transaction amount not included in the block received from the address |
spent_count | int | The number of transactions spent from the address |
spent_total | double | Transaction amount spent from the address |
spent_unconfirmed | double | Transaction amount not included in the block spent from the address |
balance | double | Remaining balance |
unconfirmed_count | int | Transaction count not included in address block |
first_time | int | First Deal Creation Time at Address |
last_time | int | Last transaction creation time from address |
GetAddressBalance
GET
https://api.blocksdk.com/v1/bch/address/{address}/balance
Path Parameters
Name | Type | Description |
---|---|---|
address | string | BitcoinCash Address |
Response
Name | Type | Content |
address | string | BitcoinCash Address |
balance | double | Balance of the address |
unconfirmed_balance | double | Balance of transactions not included in the block of addresses |
ListWallet
GET
https://api.blocksdk.com/v1/bch/wallet
Query Parameters
Name | Type | Description |
---|---|---|
offset | number | Number of Address to import |
limit | number | Address List offset |
Response
Name | Type | Content |
id | int | Unique ID of the wallet |
name | string | Name specified when creating wallet |
created_at | datetime | Date Wallet Was Created |
CreateWallet
POST
https://api.blocksdk.com/v1/bch/wallet
Request Body
Name | Type | Description |
---|---|---|
name | string | Wallet Name |
Response
Name | Type | Content |
id | id | Unique ID of the wallet |
name | string | Wallet name |
seed_wif | string | Seed private key of wallet(This key is not stored on the blocksdk server) |
LoadWallet
POST
https://api.blocksdk.com/v1/bch/wallet/{wallet_id}/load
Load your wallet. The loaded wallet does not require seed_wif when using CreateAddress,SendToAddress,SendMany ※It is not recommended to use
Path Parameters
Name | Type | Description |
---|---|---|
wallet_id | number | Wallet Unique ID |
Request Body
Name | Type | Description |
---|---|---|
password | string | Only available if the wallet is loaded. |
seed_wif | string | Wallet seed private key |
UnloadWallet
POST
https://api.blocksdk.com/v1/bch/wallet/{wallet_id}/unload
Path Parameters
Name | Type | Description |
---|---|---|
wallet_id | number | Wallet Unique ID |
GetWalletBalance
GET
https://api.blocksdk.com/v1/bch/{wallet_id}/balance
Path Parameters
Name | Type | Description |
---|---|---|
wallet_id | number | Wallet Unique ID |
Response
Name | Type | Content |
balance | double | Wallet Balance |
unconfirmed_balance | double | Balance of transactions not included in the block of wallet |
ListWalletAddress
GET
https://api.blocksdk.com/v1/bch/wallet/{wallet_td}/address
Path Parameters
Name | Type | Description |
---|---|---|
wallet_id | string | Wallet Unique ID |
Query Parameters
Name | Type | Description |
---|---|---|
offset | string | Number of Address to import |
limit | string | Number of transactions to import |
address | string | Search by this address |
hdkeypath | string | Search by this hdkeypath |
Response
Name | Type | Content |
address | string | Bitcoin Address |
hdkeypath | string | The HD keypath if the key is HD and available |
CreateWalletAddress
POST
https://api.blocksdk.com/v1/bch/wallet/{wallet_id}/address
Path Parameters
Name | Type | Description |
---|---|---|
wallet_id | string | Wallet Unique ID |
Request Body
Name | Type | Description |
---|---|---|
password | string | Only available if the wallet is loaded. |
seed_wif | string | Seed private key issued at wallet creation(Not necessary if your wallet is loaded) |
Response
Name | Type | Content |
address | string | Bitcoin Address |
hdkeypath | string | The HD keypath if the key is HD and available |
GetWalletTx
GET
https://api.blocksdk.com/v1/bch/wallet/{wallet_id}/transaction
Path Parameters
Name | Type | Description |
---|---|---|
wallet_id | string | Wallet Unique ID |
Request Body
Name | Type | Description |
---|---|---|
category | string | Transaction type to import(all,receive,spent,unspent) |
order | string | Sort deals to import(desc,asc) |
offset | number | Number of Address to import |
limit | number | Address List offset |
Response
Name | Type | Content |
txid | string | Transaction hash |
category | string | receive or spent |
address | string | Address where the transaction occurred |
amount | double | Transaction balance amount |
confirmations | int | Transaction Confirmation Count |
SendToAddress
POST
https://api.blocksdk.com/v1/bch/wallet/{wallet_id}/sendtoaddress
Path Parameters
Name | Type | Description |
---|---|---|
wallet_id | string | Wallet Unique ID |
Request Body
Name | Type | Description |
---|---|---|
subtractfeefromamount | boolean | The fee will be deducted from the amount being sent. The recipient will receive less coins than you enter in the amount field. |
password | string | Only available if the wallet is loaded. |
kbfee | number | Fee per kilobytes to be used for transactions |
seed_wif | string | Seed private key issued at wallet creation(Not necessary if your wallet is loaded) |
amount | number | balance to be sent |
address | string | BitcoinCash Address to Receive |
Response
Return Tx on Success
SendMany
POST
https://api.blocksdk.com/v1/bch/wallet/{wallet_id}/sendmany
Path Parameters
Name | Type | Description |
---|---|---|
wallet_id | string | Wallet Unique ID |
Request Body
Name | Type | Description |
---|---|---|
subtractfeefromamount | boolean | The fee will be deducted from the amount being sent. The recipient will receive less coins than you enter in the amount field. |
password | string | Only available if the wallet is loaded. |
to | object | Receiving Information |
kbfee | number | Fee per kilobytes to be used for transactions |
seed_wif | string | Seed private key issued at wallet creation(Not necessary if your wallet is loaded) |
Example PostData
Response
Return Tx on Success
GetTransaction
GET
https://api.blocksdk.com/v1/bch/transaction/{hash}
Path Parameters
Name | Type | Description |
---|---|---|
hash | string | transaction hash |
Response
Return Tx on Success
SendTransaction
POST
https://api.blocksdk.com/v1/bch/transaction
Request Body
Name | Type | Description |
---|---|---|
sign_hex | string | signed transaction hex |
Response
Return Tx on Success
Last updated