NAV
shell php javascript java csharp ruby python go

Bitcoin APIs

Blockchain information

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

Response Body

{
    "payload": {
        "network": "mainnet",
        "currency": "BTC",
        "last_block_height": 665390,
        "last_block_hash": "000000000000000000067ede91ae7f27bb9a7276fa65d86c59da871bab262925",
        "last_block_datetime": "2021-01-10T08:31:56+00:00",
        "last_block_timestamp": 1610267516,
        "prev_block_height": 665389,
        "prev_block_hash": "0000000000000000000793aa8c982ab702b932c7316500e586a2c52ca2c1e863",
        "prev_block_datetime": "2021-01-10T08:29:07+00:00",
        "prev_block_timestamp": 1610267347,
        "unconfirmed_count": 41617,
        "low_fee_per_kb": 0.00011,
        "medium_fee_per_kb": 0.00018,
        "high_fee_per_kb": 0.00036
    },
    "state": {
        "code": 200,
        "success": true
    }
}

Info

Returns information about the Bitcoin blockchain.

HTTP Request

GET https://api.blocksdk.com/v2/btc/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/btc/blocks/1' \
    -H 'Content-Type: application/json' \
    -H 'X-API-Token: my-api-token'
$block = $btcClient->getBlock([
    "block" => 1,
    "rawtx" => false,
    "offset" => 0,
    "limit" => 10
]);
var block = btcClient.getBlock({
    "block" : 1,
    "rawtx" : false,
    "offset" : 0,
    "limit" : 10
})
block = btcClient.getBlock({
    "block" => 1,
    "rawtx" => false,
    "offset" => 0,
    "limit" => 10
})
block = btcClient.getBlock({
    "block" : 1,
    "rawtx" : false,
    "offset" : 0,
    "limit" : 10
})
block := btcClient.GetBlock(map[string]interface{}{
      "block" : 1,
      "rawtx" : false,
      "offset" : 0,
      "limit" : 10
})

Response Body

{
    "payload": {
        "hash": "00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048",
        "confirmations": 665390,
        "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/btc/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/btc/mempool' \
    -H 'Content-Type: application/json' \
    -H 'X-API-Token: my-api-token'
$mempool = $btcClient->getMemPool([
    "rawtx" => false,
    "offset" => 0,
    "limit" => 10
]);
var mempool = btcClient.getMemPool({
    "rawtx" : false,
    "offset" : 0,
    "limit" : 10
})
mempool = btcClient.getMemPool({
    "rawtx" => false,
    "offset" => 0,
    "limit" => 10
})
mempool = btcClient.getMemPool({
    "rawtx" : false,
    "offset" : 0,
    "limit" : 10
})
mempool := btcClient.GetMemPool(map[string]interface{}{
      "rawtx" : false,
      "offset" : 0,
      "limit" : 10
})

Response Body

{
    "payload": {
        "transactions": [
            "ab15b8f7a2e76c9d4948a02223c0bf4b310ea549ad398dbcd3cabc2426dcf0e8",
            "fe08fc0c02d181daf2aeab9eaa261ce3cf903446df49ef67c7f764acedbc8e8b",
            "e21df6ebfd89b881232c27c6234034763e0cff944b6067cff74ddcb0195468b8",
            "c3a1084774f811d80e33dfbe133b48e951f6a3a8ab48b6192337c5bb3a0976f4",
            "88418a47bee0440fe73af9a05ac1bf4e639f785045f5977a803c10b20e897909",
            "26b217902300993f3881bd7b618332c70ef1e80133c9b0e54b36fc45b51c6636",
            "dcdd2d65743b85c7198b1fb088b149889adc85f2df433303fd1e0b8ae69e187a",
            "826f00fd770ec8c09cd1f41daed1e62fdc9fa8122cfe1172a54ec29558e46654",
            "e257a52d4fb6f2ca5dde08b98683de7582403c9cf76419aca1213a9cb53f7877",
            "39d8d5cc3fb9447ca47c9862d0dd32e96715e55385d0ab7c0a90a010c25415f2"
        ],
        "transaction_count": 40892
    },
    "state": {
        "code": 200,
        "success": true
    }
}

Info

Returns a list of transactions in the memory pool.

HTTP Request

GET https://api.blocksdk.com/v2/btc/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/btc/addresses/14ydRmjd5Tzg7W2hJJ8nsuZvpQNVcLYCYN' \
    -H 'Content-Type: application/json' \
    -H 'X-API-Token: my-api-token'
$addressInfo = $btcClient->getAddressInfo([
    "address" => "14ydRmjd5Tzg7W2hJJ8nsuZvpQNVcLYCYN",
    "rawtx" => false,
    "reverse" => true,
    "offset" => 0,
    "limit" => 10
]);
var addressInfo = btcClient.getAddressInfo({
    "address" : "14ydRmjd5Tzg7W2hJJ8nsuZvpQNVcLYCYN",
    "rawtx" : false,
    "reverse" : true,
    "offset" : 0,
    "limit" : 10
})
addressInfo = btcClient.getAddressInfo({
    "address" => "14ydRmjd5Tzg7W2hJJ8nsuZvpQNVcLYCYN",
    "rawtx" => false,
    "reverse" => true,
    "offset" => 0,
    "limit" => 10
})
addressInfo = btcClient.getAddressInfo({
    "address" : "14ydRmjd5Tzg7W2hJJ8nsuZvpQNVcLYCYN",
    "rawtx" : false,
    "reverse" : true,
    "offset" : 0,
    "limit" : 10
})
addressInfo := btcClient.GetAddressInfo(map[string]interface{}{
      "address" : "14ydRmjd5Tzg7W2hJJ8nsuZvpQNVcLYCYN",
      "rawtx" : false,
      "reverse" : true,
      "offset" : 0,
      "limit" : 10,
})

Response Body

{
    "payload": {
        "address": "14ydRmjd5Tzg7W2hJJ8nsuZvpQNVcLYCYN",
        "transactions": [
            "85ce9bf9b147873d814d90d68f7a3e5566debfd9d11e7a2928ff78ae7ec16dfb"
        ],
        "unconfirmed_transactions": [],
        "transaction_count": 1,
        "received_count": 1,
        "spent_count": 0,
        "total_received": 0.04135495,
        "total_spent": 0,
        "unconfirmed_total_received": 0,
        "unconfirmed_total_spent": 0,
        "balance": 0.04135495,
        "unconfirmed_count": 0,
        "first_datetime": "2021-01-10T08:51:49+00:00",
        "first_timestamp": 1610268709,
        "last_datetime": "2021-01-10T08:51:49+00:00",
        "last_timestamp": 1610268709
    },
    "state": {
        "code": 200,
        "success": true
    }
}

Info

Returns information about a specific address.

HTTP Request

GET https://api.blocksdk.com/v2/btc/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/14ydRmjd5Tzg7W2hJJ8nsuZvpQNVcLYCYN/balance' \
    -H 'Content-Type: application/json' \
    -H 'X-API-Token: my-api-token'
$balance = $btcClient->getAddressBalance([
    "address" => "14ydRmjd5Tzg7W2hJJ8nsuZvpQNVcLYCYN"
]);
var balance = btcClient.getAddressBalance({
    "address" : "14ydRmjd5Tzg7W2hJJ8nsuZvpQNVcLYCYN"
})
balance = btcClient.getAddressBalance({
    "address" => "14ydRmjd5Tzg7W2hJJ8nsuZvpQNVcLYCYN"
})
balance = btcClient.getAddressBalance({
    "address" : "14ydRmjd5Tzg7W2hJJ8nsuZvpQNVcLYCYN"
})
balance := btcClient.GetAddressBalance(map[string]interface{}{
      "address" : "14ydRmjd5Tzg7W2hJJ8nsuZvpQNVcLYCYN"
})

Response Body

{
    "payload": {
        "address": "14ydRmjd5Tzg7W2hJJ8nsuZvpQNVcLYCYN",
        "balance": 0.04135495,
        "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/btc/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 balance

HD wallet creation

curl -X POST 'https://api.blocksdk.com/v2/btc/wallets/hd' \
    -H 'Content-Type: application/json' \
    -H 'X-API-Token: my-api-token'\
    -d '{"name" : "IwbdtnYMSD8MWHWGOwBluLAlbEZoMROC4mQ"}'   
$wallet = $btcClient->createHdWallet([
    "name" => "IwbdtnYMSD8MWHWGOwBluLAlbEZoMROC4mQ"
]);
var wallet = btcClient.createHdWallet({
    "name" : "IwbdtnYMSD8MWHWGOwBluLAlbEZoMROC4mQ"
})
wallet = btcClient.createHdWallet({
    "name" => "IwbdtnYMSD8MWHWGOwBluLAlbEZoMROC4mQ"
})
wallet = btcClient.createHdWallet({
    "name" : "IwbdtnYMSD8MWHWGOwBluLAlbEZoMROC4mQ"
})
wallet := btcClient.CreateHdWallet(map[string]interface{}{
      "name" : "IwbdtnYMSD8MWHWGOwBluLAlbEZoMROC4mQ"
})

Response Body

{
    "payload": {
        "id": 470,
        "name": "IwbdtnYMSD8MWHWGOwBluLAlbEZoMROC4mQ",
        "wif": "L5PGqGxSA7zTyHdNSVCKN8jzt3RKz9nn2KvUjdzyfsW1Czvqu5BG",
        "datetime": "2021-01-12T04:39:03+00:00",
        "timestamp": 1610426343
    },
    "state": {
        "code": 201,
        "success": true
    }
}

Info

Create an HD wallet.

HTTP Request

POST https://api.blocksdk.com/v2/btc/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/btc/wallets' \
    -H 'Content-Type: application/json' \
    -H 'X-API-Token: my-api-token'
$wallets = $btcClient->getWallets([
    "offset" => 0,
    "limit" => 10
]);
var wallets = btcClient.getWallets({
    "offset" : 0,
    "limit" : 10
})
wallets = btcClient.getWallets({
    "offset" => 0,
    "limit" => 10
})
wallets = btcClient.getWallets({
    "offset" : 0,
    "limit" : 10
})
wallets := btcClient.GetWallets(map[string]interface{}{
      "offset" : 0,
      "limit" : 10
})

Response Body

{
    "payload": [
        {
            "id": 153,
            "name": "2Xzt7bnCH0bOt9zD0wB5PqWFY5I4AhVSm8D",
            "datetime": "2019-08-23T06:39:19+00:00",
            "timestamp": 1566542359
        }
    ],
    "state": {
        "code": 200,
        "success": true
    }
}

Info

Returns the list of wallets created.

HTTP Request

GET https://api.blocksdk.com/v2/btc/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/btc/wallets/466' \
    -H 'Content-Type: application/json' \
    -H 'X-API-Token: my-api-token'
$wallet = $btcClient->getWallet([
    "wallet_id" => 466
]);
var wallet = btcClient.getWallet({
    "wallet_id" : 466
})
wallet = btcClient.getWallet({
    "wallet_id" => 466
})
wallet = btcClient.getWallet({
    "wallet_id" : 466
})
wallet := btcClient.GetWallet(map[string]interface{}{
      "wallet_id" : 466
})

Response Body

{
    "payload": {
        "id": 466,
        "name": "g8SYpcuc0Jsylkgje4zDLdrAepVOj6U5QlU",
        "address_count": 0,
        "transaction_count": 0,
        "unspent_transaction_count": 0,
        "loaded": false,
        "datetime": "2021-01-10T09:14:23+00:00",
        "timestamp": 1610270063
    },
    "state": {
        "code": 200,
        "success": true
    }
}

Info

Returns information about a specific wallet.

HTTP Request

GET https://api.blocksdk.com/v2/btc/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/btc/wallets/470/load' \
    -H 'Content-Type: application/json' \
    -H 'X-API-Token: my-api-token' \
  -d '{
    "wif" : "L5PGqGxSA7zTyHdNSVCKN8jzt3RKz9nn2KvUjdzyfsW1Czvqu5BG",
    "password" : "abcdef123456"
    }'
$load = $btcClient->loadWallet([
    "wallet_id" => 470,
    "wif" => "L5PGqGxSA7zTyHdNSVCKN8jzt3RKz9nn2KvUjdzyfsW1Czvqu5BG",
    "password" => "abcdef123456"
]);
var load = btcClient.loadWallet({
    "wallet_id" : 470,
    "wif" : "L5PGqGxSA7zTyHdNSVCKN8jzt3RKz9nn2KvUjdzyfsW1Czvqu5BG",
    "password" : "abcdef123456"
})
load = btcClient.loadWallet({
    "wallet_id" => 470,
    "wif" => "L5PGqGxSA7zTyHdNSVCKN8jzt3RKz9nn2KvUjdzyfsW1Czvqu5BG",
    "password" => "abcdef123456"
})
load = btcClient.loadWallet({
    "wallet_id" : 470,
    "wif" : "L5PGqGxSA7zTyHdNSVCKN8jzt3RKz9nn2KvUjdzyfsW1Czvqu5BG",
    "password" : "abcdef123456"
})
load := btcClient.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/btc/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/btc/wallets/467/unload' \
    -H 'Content-Type: application/json' \
    -H 'X-API-Token: my-api-token'
$unload = $btcClient->unloadWallet([
    "wallet_id" => 467
]);
var unload = btcClient.unloadWallet({
    "wallet_id" : 467
})
unload = btcClient.unloadWallet({
    "wallet_id" => 467
})
unload = btcClient.unloadWallet({
    "wallet_id" : 467
})
unload := btcClient.UnloadWallet(map[string]interface{}{
      "wallet_id" : 467
})

Response Body

{
    "payload": {
        "id": 467,
        "loaded": false
    },
    "state": {
        "code": 201,
        "success": true
    }
}

Info

Unload the loaded wallet.

HTTP Request

POST https://api.blocksdk.com/v2/btc/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/btc/wallets/467/balance' \
    -H 'Content-Type: application/json' \
    -H 'X-API-Token: my-api-token'
$walletBalance = $btcClient->getWalletBalance([
    "wallet_id" => 467
]);
var walletBalance = btcClient.getWalletBalance({
    "wallet_id" : 467
})
walletBalance = btcClient.getWalletBalance({
    "wallet_id" => 467
})
walletBalance = btcClient.getWalletBalance({
    "wallet_id" : 467
})
walletBalance := btcClient.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/btc/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/btc/wallets/467/addresses' \
    -H 'Content-Type: application/json' \
    -H 'X-API-Token: my-api-token'
$wallet_addresses = $btcClient->getWalletAddresses([
    "wallet_id" => 467,
    "offset" => 0,
    "limit" => 10
]);
var wallet_addresses = btcClient.getWalletAddresses({
    "wallet_id" : 467,
    "offset" : 0,
    "limit" : 10
})
wallet_addresses = btcClient.getWalletAddresses({
    "wallet_id" => 467,
    "offset" => 0,
    "limit" => 10
})
wallet_addresses = btcClient.getWalletAddresses({
    "wallet_id" : 467,
    "offset" : 0,
    "limit" : 10
})
wallet_addresses := btcClient.GetWalletAddresses(map[string]interface{}{
      "wallet_id" : 467,
      "offset" : 0,
      "limit" : 10
})

Response Body

{
    "payload": [
        {
            "address": "1EEfKiWFqTDoGf9XBzoCVN4raM28WHgvQM",
            "hdkeypath": "m/0'/0'/0'",
            "datetime": "2021-01-10T10:37:26+00:00",
            "timestamp": 1610275046
        }
    ],
    "state": {
        "code": 200,
        "success": true
    }
}

Info

Returns a list of addresses generated by a specific wallet.

HTTP Request

GET https://api.blocksdk.com/v2/btc/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/btc/wallets/470/addresses' \
    -H 'Content-Type: application/json' \
    -H 'X-API-Token: my-api-token' \
    -d '{
        "wif" : "L5PGqGxSA7zTyHdNSVCKN8jzt3RKz9nn2KvUjdzyfsW1Czvqu5BG"
    }'
$address = $btcClient->createWalletAddress([
    "wallet_id" => 470,
    "wif" => "L5PGqGxSA7zTyHdNSVCKN8jzt3RKz9nn2KvUjdzyfsW1Czvqu5BG"
]);

or

$address = $btcClient->createWalletAddress([
    "wallet_id" => 470,
    "password" => "abcdefg"
]);
var address = btcClient.createWalletAddress({
    "wallet_id" : 470,
    "wif" : "L5PGqGxSA7zTyHdNSVCKN8jzt3RKz9nn2KvUjdzyfsW1Czvqu5BG"
})

or

var address = btcClient.createWalletAddress({
    "wallet_id" : 470,
    "password" : "abcdefg"
})
address = btcClient.createWalletAddress({
    "wallet_id" => 470,
    "wif" => "L5PGqGxSA7zTyHdNSVCKN8jzt3RKz9nn2KvUjdzyfsW1Czvqu5BG"
})

or

address = btcClient.createWalletAddress({
    "wallet_id" => 470,
    "password" => "abcdefg"
})
address = btcClient.createWalletAddress({
    "wallet_id" : 470,
    "wif" : "L5PGqGxSA7zTyHdNSVCKN8jzt3RKz9nn2KvUjdzyfsW1Czvqu5BG"
})

or

address = btcClient.createWalletAddress({
    "wallet_id" : 470,
    "password" : "abcdefg"
})
address := btcClient.CreateWalletAddress(map[string]interface{}{
      "wallet_id" : 470,
      "wif" : "L5PGqGxSA7zTyHdNSVCKN8jzt3RKz9nn2KvUjdzyfsW1Czvqu5BG"
})

or

address := btcClient.CreateWalletAddress(map[string]interface{}{
      "wallet_id" : 470,
      "password" : "abcdefg"
})

Response Body

{
    "payload": {
        "address": "1EEfKiWFqTDoGf9XBzoCVN4raM28WHgvQM",
        "hdkeypath": "m/0'/0'/0'",
        "datetime": "2021-01-10T10:37:26+00:00",
        "timestamp": 1610275046
    },
    "state": {
        "code": 201,
        "success": true
    }
}

Info

Create an address in a specific wallet.

HTTP Request

POST https://api.blocksdk.com/v2/btc/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/btc/wallets/215/transactions' \
    -H 'Content-Type: application/json' \
    -H 'X-API-Token: my-api-token'
$wallet_transactions = $btcClient->getWalletTransactions([
    "wallet_id" => 215,
    "type" => "all",
    "order" => "desc",
    "offset" => 0,
    "limit" => 10
]);
var wallet_transactions = btcClient.getWalletTransactions({
    "wallet_id" : 215,
    "type" : "all",
    "order" : "desc",
    "offset" : 0,
    "limit" : 10
})
wallet_transactions = btcClient.getWalletTransactions({
    "wallet_id" => 215,
    "type" => "all",
    "order" => "desc",
    "offset" => 0,
    "limit" => 10
})
wallet_transactions = btcClient.getWalletTransactions({
    "wallet_id" : 215,
    "type" : "all",
    "order" : "desc",
    "offset" : 0,
    "limit" : 10
})
wallet_transactions := btcClient.GetWalletTransactions(map[string]interface{}{
    "wallet_id" : 215,
    "type" : "all",
    "order" : "desc",
    "offset" : 0,
    "limit" : 10
})

Response Body

{
    "payload": [
        {
            "txid": "b7e98ec27b6fe51a1c1d7fc98ad0dd9c3f5953747901d4d3644fc3fc625c57a1",
            "type": "received",
            "address": "1AxZmuy1kMK4VXQzGuvzQNmqP2s9mS9vBu",
            "amount": 0.00006840,
            "confirmations": 71237
        },

        ...

    ],
    "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/btc/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/btc/wallets/125/sendtoaddress' \
    -H 'Content-Type: application/json' \
    -H 'X-API-Token: my-api-token' \
    -d '{
        "wif" : "L5PGqGxSA7zTyHdNSVCKN8jzt3RKz9nn2KvUjdzyfsW1Czvqu5BG",
        "address" : "1KWbGyMn9MMwQSRLYtWqszcpNST9TqC1vg",
        "amount" : 0.0001
    }'  
$tx = $btcClient->sendToAddress([
    "wallet_id" => 125,
    "wif" => "L5PGqGxSA7zTyHdNSVCKN8jzt3RKz9nn2KvUjdzyfsW1Czvqu5BG",
    "address" => "1KWbGyMn9MMwQSRLYtWqszcpNST9TqC1vg",
    "amount" =>  0.0001
])

or

$tx = $btcClient->sendToAddress([
    "wallet_id" => 125,
    "password" => "abcdefg",
    "address" => "1KWbGyMn9MMwQSRLYtWqszcpNST9TqC1vg",
    "amount" =>  0.0001
])
var tx = btcClient.sendToAddress({
    "wallet_id" : 125,
    "wif" : "L5PGqGxSA7zTyHdNSVCKN8jzt3RKz9nn2KvUjdzyfsW1Czvqu5BG",
    "address" : "1KWbGyMn9MMwQSRLYtWqszcpNST9TqC1vg",
    "amount" :  0.0001
})

or

var tx = btcClient.sendToAddress({
    "wallet_id" : 125,
    "password" : "abcdefg",
    "address" : "1KWbGyMn9MMwQSRLYtWqszcpNST9TqC1vg",
    "amount" :  0.0001
})
tx = btcClient.sendToAddress({
    "wallet_id" => 125,
    "wif" => "L5PGqGxSA7zTyHdNSVCKN8jzt3RKz9nn2KvUjdzyfsW1Czvqu5BG",
    "address" => "1KWbGyMn9MMwQSRLYtWqszcpNST9TqC1vg",
    "amount" =>  0.0001
})

or

tx = btcClient.sendToAddress({
    "wallet_id" => 125,
    "password" => "abcdefg",
    "address" => "1KWbGyMn9MMwQSRLYtWqszcpNST9TqC1vg",
    "amount" =>  0.0001
})
tx = btcClient.sendToAddress({
    "wallet_id" : 125,
    "wif" : "L5PGqGxSA7zTyHdNSVCKN8jzt3RKz9nn2KvUjdzyfsW1Czvqu5BG",
    "address" : "1KWbGyMn9MMwQSRLYtWqszcpNST9TqC1vg",
    "amount" :  0.0001
})

or

tx = btcClient.sendToAddress({
    "wallet_id" : 125,
    "password" : "abcdefg",
    "address" : "1KWbGyMn9MMwQSRLYtWqszcpNST9TqC1vg",
    "amount" :  0.0001
})
tx := btcClient.SendToAddress(map[string]interface{}{
    "wallet_id" : 125,
    "wif" : "L5PGqGxSA7zTyHdNSVCKN8jzt3RKz9nn2KvUjdzyfsW1Czvqu5BG",
    "address" : "1KWbGyMn9MMwQSRLYtWqszcpNST9TqC1vg",
    "amount" :  0.0001
})

or

tx := btcClient.SendToAddress(map[string]interface{}{
    "wallet_id" : 125,
    "password" : "abcdefg",
    "address" : "1KWbGyMn9MMwQSRLYtWqszcpNST9TqC1vg",
    "amount" :  0.0001
})

Response Body

{
    "payload": {
        "txid": "b7e98ec27b6fe51a1c1d7fc98ad0dd9c3f5953747901d4d3644fc3fc625c57a1",
        "version": 1,
        "size": 424,
        "inputs": [
            {
                "txid": "10a1a003ab9a99e50efb06c0a1548b2472b110f91631e02cef0096620a23970f",
                "output_index": 0,
                "script": {
                    "ams": "00142a7466cd986288292aa43a2c9e4874c6f2f9a7cc",
                    "hex": "1600142a7466cd986288292aa43a2c9e4874c6f2f9a7cc"
                },
                "addresses": [
                    "37aQKZ9PNzGVP2gYmqqoTxeDPtXd6GbCsZ"
                ],
                "value": 0.0001
            },
            {
                "txid": "a3533258ba4167cd7c121912d91130ea75599c32b8cc5cf7ecb664dd4ec2650e",
                "output_index": 0,
                "script": {
                    "ams": "0014760c51588eebf1d9f26c81335c70c42aea4f1a59",
                    "hex": "160014760c51588eebf1d9f26c81335c70c42aea4f1a59"
                },
                "addresses": [
                    "32TDFPUsa1FM9kdyJm9oE14MfZFy3JhS4v"
                ],
                "value": 0.0001
            }
        ],
        "total_input": 0.0002,
        "outputs": [
            {
                "value": 0.0001,
                "index": 0,
                "script": {
                    "type": "pubkeyhash",
                    "asm": "OP_DUP OP_HASH160 cb0af04acb1be057e1172119b94383f4653fa3b7 OP_EQUALVERIFY OP_CHECKSIG",
                    "hex": "76a914cb0af04acb1be057e1172119b94383f4653fa3b788ac"
                },
                "addresses": [
                    "1KWbGyMn9MMwQSRLYtWqszcpNST9TqC1vg"
                ]
            },
            {
                "value": 6.84e-5,
                "index": 1,
                "script": {
                    "type": "pubkeyhash",
                    "asm": "OP_DUP OP_HASH160 6d3b5e5d8d8bd035ce785d3bb27c332d7cfced1c OP_EQUALVERIFY OP_CHECKSIG",
                    "hex": "76a9146d3b5e5d8d8bd035ce785d3bb27c332d7cfced1c88ac"
                },
                "addresses": [
                    "1AxZmuy1kMK4VXQzGuvzQNmqP2s9mS9vBu"
                ]
            }
        ],
        "total_output": 0.0001684,
        "input_count": 2,
        "output_count": 2,
        "fee": 3.16e-5,
        "fee_per_kb": 7.453e-5,
        "locktime": 0,
        "block_hash": "00000000000000000006f272f7b8f2ba106632dbac06f578294f692db75d68be",
        "block_height": 594167,
        "datetime": "2019-09-10T12:30:35+00:00",
        "timestamp": 1568118635,
        "confirmations": 71237
    },
    "state": {
        "code": 200,
        "success": true
    }
}

Info

Send the amount to a specific address.

HTTP Request

POST https://api.blocksdk.com/v2/btc/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/btc/wallets/125/sendtoaddress' \
    -H 'Content-Type: application/json' \
    -H 'X-API-Token: my-api-token' \
    -d '{
        "wif" : "L5PGqGxSA7zTyHdNSVCKN8jzt3RKz9nn2KvUjdzyfsW1Czvqu5BG",
        "to" : { 
            "1KWbGyMn9MMwQSRLYtWqszcpNST9TqC1vg" : 0.0001,
            "1AxZmuy1kMK4VXQzGuvzQNmqP2s9mS9vBu" : 0.00006840 
        }
    }'  
$tx = $btcClient->sendMany([
    "wallet_id" => 125,
    "wif" => "L5PGqGxSA7zTyHdNSVCKN8jzt3RKz9nn2KvUjdzyfsW1Czvqu5BG",
    "to" => [
        "1KWbGyMn9MMwQSRLYtWqszcpNST9TqC1vg" => 0.0001,
        "1AxZmuy1kMK4VXQzGuvzQNmqP2s9mS9vBu" => 0.00006840
    ],
]);

or

$tx = $btcClient->sendMany([
    "wallet_id" => 125,
    "password" => "abcdefg",
    "to" => [
        "1KWbGyMn9MMwQSRLYtWqszcpNST9TqC1vg" => 0.0001,
        "1AxZmuy1kMK4VXQzGuvzQNmqP2s9mS9vBu" => 0.00006840
    ]
]);
var tx = btcClient.sendMany({
    "wallet_id" : 125,
    "wif" : "L5PGqGxSA7zTyHdNSVCKN8jzt3RKz9nn2KvUjdzyfsW1Czvqu5BG",
    "to" : {
        "1KWbGyMn9MMwQSRLYtWqszcpNST9TqC1vg" : 0.0001,
        "1AxZmuy1kMK4VXQzGuvzQNmqP2s9mS9vBu" : 0.00006840
    },
})

or

var tx = btcClient.sendMany({
    "wallet_id" : 125,
    "password" : "abcdefg",
    "to" : {
        "1KWbGyMn9MMwQSRLYtWqszcpNST9TqC1vg" : 0.0001,
        "1AxZmuy1kMK4VXQzGuvzQNmqP2s9mS9vBu" : 0.00006840
    }
})
tx = btcClient.sendMany({
    "wallet_id" => 125,
    "wif" => "L5PGqGxSA7zTyHdNSVCKN8jzt3RKz9nn2KvUjdzyfsW1Czvqu5BG",
    "to" => {
        "1KWbGyMn9MMwQSRLYtWqszcpNST9TqC1vg" => 0.0001,
        "1AxZmuy1kMK4VXQzGuvzQNmqP2s9mS9vBu" => 0.00006840
    },
})

or

tx = btcClient.sendMany({
    "wallet_id" => 125,
    "password" => "abcdefg",
    "to" => {
        "1KWbGyMn9MMwQSRLYtWqszcpNST9TqC1vg" => 0.0001,
        "1AxZmuy1kMK4VXQzGuvzQNmqP2s9mS9vBu" => 0.00006840
    }
})
tx = btcClient.sendMany({
    "wallet_id" : 125,
    "wif" : "L5PGqGxSA7zTyHdNSVCKN8jzt3RKz9nn2KvUjdzyfsW1Czvqu5BG",
    "to" : {
        "1KWbGyMn9MMwQSRLYtWqszcpNST9TqC1vg" : 0.0001,
        "1AxZmuy1kMK4VXQzGuvzQNmqP2s9mS9vBu" : 0.00006840
    },
})

or

tx = btcClient.sendMany({
    "wallet_id" : 125,
    "password" : "abcdefg",
    "to" : {
        "1KWbGyMn9MMwQSRLYtWqszcpNST9TqC1vg" : 0.0001,
        "1AxZmuy1kMK4VXQzGuvzQNmqP2s9mS9vBu" : 0.00006840
    }
})
tx := btcClient.SendMany(map[string]interface{}{
    "wallet_id" : 125,
    "wif" : "L5PGqGxSA7zTyHdNSVCKN8jzt3RKz9nn2KvUjdzyfsW1Czvqu5BG",
    "to" : {
        "1KWbGyMn9MMwQSRLYtWqszcpNST9TqC1vg" : 0.0001,
        "1AxZmuy1kMK4VXQzGuvzQNmqP2s9mS9vBu" : 0.00006840
    }
})

or

tx := btcClient.SendMany(map[string]interface{}{
    "wallet_id" : 125,
    "password" : "abcdefg",
    "to" : {
        "1KWbGyMn9MMwQSRLYtWqszcpNST9TqC1vg" : 0.0001,
        "1AxZmuy1kMK4VXQzGuvzQNmqP2s9mS9vBu" : 0.00006840
    }
})

Response Body

{
    "payload": {
        "txid": "b7e98ec27b6fe51a1c1d7fc98ad0dd9c3f5953747901d4d3644fc3fc625c57a1",
        "version": 1,
        "size": 424,
        "inputs": [
            {
                "txid": "10a1a003ab9a99e50efb06c0a1548b2472b110f91631e02cef0096620a23970f",
                "output_index": 0,
                "script": {
                    "ams": "00142a7466cd986288292aa43a2c9e4874c6f2f9a7cc",
                    "hex": "1600142a7466cd986288292aa43a2c9e4874c6f2f9a7cc"
                },
                "addresses": [
                    "37aQKZ9PNzGVP2gYmqqoTxeDPtXd6GbCsZ"
                ],
                "value": 0.0001
            },
            {
                "txid": "a3533258ba4167cd7c121912d91130ea75599c32b8cc5cf7ecb664dd4ec2650e",
                "output_index": 0,
                "script": {
                    "ams": "0014760c51588eebf1d9f26c81335c70c42aea4f1a59",
                    "hex": "160014760c51588eebf1d9f26c81335c70c42aea4f1a59"
                },
                "addresses": [
                    "32TDFPUsa1FM9kdyJm9oE14MfZFy3JhS4v"
                ],
                "value": 0.0001
            }
        ],
        "total_input": 0.0002,
        "outputs": [
            {
                "value": 0.0001,
                "index": 0,
                "script": {
                    "type": "pubkeyhash",
                    "asm": "OP_DUP OP_HASH160 cb0af04acb1be057e1172119b94383f4653fa3b7 OP_EQUALVERIFY OP_CHECKSIG",
                    "hex": "76a914cb0af04acb1be057e1172119b94383f4653fa3b788ac"
                },
                "addresses": [
                    "1KWbGyMn9MMwQSRLYtWqszcpNST9TqC1vg"
                ]
            },
            {
                "value": 6.84e-5,
                "index": 1,
                "script": {
                    "type": "pubkeyhash",
                    "asm": "OP_DUP OP_HASH160 6d3b5e5d8d8bd035ce785d3bb27c332d7cfced1c OP_EQUALVERIFY OP_CHECKSIG",
                    "hex": "76a9146d3b5e5d8d8bd035ce785d3bb27c332d7cfced1c88ac"
                },
                "addresses": [
                    "1AxZmuy1kMK4VXQzGuvzQNmqP2s9mS9vBu"
                ]
            }
        ],
        "total_output": 0.0001684,
        "input_count": 2,
        "output_count": 2,
        "fee": 3.16e-5,
        "fee_per_kb": 7.453e-5,
        "locktime": 0,
        "block_hash": "00000000000000000006f272f7b8f2ba106632dbac06f578294f692db75d68be",
        "block_height": 594167,
        "datetime": "2019-09-10T12:30:35+00:00",
        "timestamp": 1568118635,
        "confirmations": 71237
    },
    "state": {
        "code": 200,
        "success": true
    }
}

Info

Send money to multiple addresses.

HTTP Request

POST https://api.blocksdk.com/v2/btc/wallets/<wallet_id>/sendmany

URL Parameters

Parameter Type Description
wallet_id* int Wallet ID to transfer money 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

` {

"1CK6KHY6MHgYvmRQ4PAafKYDrg1ejbH1cE" : 0.0012 ,

"3L6ySzGMtkEGdZpE31fXzkDmc5aZ7w1Hcf" : 0.031

} `

Response

Transaction Object

Send Transaction

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

Response Body

{
    "payload": {
        "txid": "b7e98ec27b6fe51a1c1d7fc98ad0dd9c3f5953747901d4d3644fc3fc625c57a1",
        "version": 1,
        "size": 424,
        "inputs": [
            {
                "txid": "10a1a003ab9a99e50efb06c0a1548b2472b110f91631e02cef0096620a23970f",
                "output_index": 0,
                "script": {
                    "ams": "00142a7466cd986288292aa43a2c9e4874c6f2f9a7cc",
                    "hex": "1600142a7466cd986288292aa43a2c9e4874c6f2f9a7cc"
                },
                "addresses": [
                    "37aQKZ9PNzGVP2gYmqqoTxeDPtXd6GbCsZ"
                ],
                "value": 0.0001
            },
            {
                "txid": "a3533258ba4167cd7c121912d91130ea75599c32b8cc5cf7ecb664dd4ec2650e",
                "output_index": 0,
                "script": {
                    "ams": "0014760c51588eebf1d9f26c81335c70c42aea4f1a59",
                    "hex": "160014760c51588eebf1d9f26c81335c70c42aea4f1a59"
                },
                "addresses": [
                    "32TDFPUsa1FM9kdyJm9oE14MfZFy3JhS4v"
                ],
                "value": 0.0001
            }
        ],
        "total_input": 0.0002,
        "outputs": [
            {
                "value": 0.0001,
                "index": 0,
                "script": {
                    "type": "pubkeyhash",
                    "asm": "OP_DUP OP_HASH160 cb0af04acb1be057e1172119b94383f4653fa3b7 OP_EQUALVERIFY OP_CHECKSIG",
                    "hex": "76a914cb0af04acb1be057e1172119b94383f4653fa3b788ac"
                },
                "addresses": [
                    "1KWbGyMn9MMwQSRLYtWqszcpNST9TqC1vg"
                ]
            },
            {
                "value": 6.84e-5,
                "index": 1,
                "script": {
                    "type": "pubkeyhash",
                    "asm": "OP_DUP OP_HASH160 6d3b5e5d8d8bd035ce785d3bb27c332d7cfced1c OP_EQUALVERIFY OP_CHECKSIG",
                    "hex": "76a9146d3b5e5d8d8bd035ce785d3bb27c332d7cfced1c88ac"
                },
                "addresses": [
                    "1AxZmuy1kMK4VXQzGuvzQNmqP2s9mS9vBu"
                ]
            }
        ],
        "total_output": 0.0001684,
        "input_count": 2,
        "output_count": 2,
        "fee": 3.16e-5,
        "fee_per_kb": 7.453e-5,
        "locktime": 0,
        "block_hash": "00000000000000000006f272f7b8f2ba106632dbac06f578294f692db75d68be",
        "block_height": 594167,
        "datetime": "2019-09-10T12:30:35+00:00",
        "timestamp": 1568118635,
        "confirmations": 71237
    },
    "state": {
        "code": 200,
        "success": true
    }
}

Info

Send the signed transaction.

HTTP Request

POST https://api.blocksdk.com/v2/btc/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/btc/transactions/b7e98ec27b6fe51a1c1d7fc98ad0dd9c3f5953747901d4d3644fc3fc625c57a1' \
    -H 'Content-Type: application/json' \
    -H 'X-API-Token: my-api-token'
$tx = $btcClient->getTransaction([
    "tx_id" => "b7e98ec27b6fe51a1c1d7fc98ad0dd9c3f5953747901d4d3644fc3fc625c57a1"
]);
var tx = btcClient.getTransaction({
    "tx_id" : "b7e98ec27b6fe51a1c1d7fc98ad0dd9c3f5953747901d4d3644fc3fc625c57a1"
})
tx = btcClient.getTransaction({
    "tx_id" => "b7e98ec27b6fe51a1c1d7fc98ad0dd9c3f5953747901d4d3644fc3fc625c57a1"
})
tx = btcClient.getTransaction({
    "tx_id" : "b7e98ec27b6fe51a1c1d7fc98ad0dd9c3f5953747901d4d3644fc3fc625c57a1"
})
tx := btcClient.GetTransaction(map[string]interface{}{
    "tx_id" : "b7e98ec27b6fe51a1c1d7fc98ad0dd9c3f5953747901d4d3644fc3fc625c57a1"
})

Response Body

{
    "payload": {
        "txid": "b7e98ec27b6fe51a1c1d7fc98ad0dd9c3f5953747901d4d3644fc3fc625c57a1",
        "version": 1,
        "size": 424,
        "inputs": [
            {
                "txid": "10a1a003ab9a99e50efb06c0a1548b2472b110f91631e02cef0096620a23970f",
                "output_index": 0,
                "script": {
                    "ams": "00142a7466cd986288292aa43a2c9e4874c6f2f9a7cc",
                    "hex": "1600142a7466cd986288292aa43a2c9e4874c6f2f9a7cc"
                },
                "addresses": [
                    "37aQKZ9PNzGVP2gYmqqoTxeDPtXd6GbCsZ"
                ],
                "value": 0.0001
            },
            {
                "txid": "a3533258ba4167cd7c121912d91130ea75599c32b8cc5cf7ecb664dd4ec2650e",
                "output_index": 0,
                "script": {
                    "ams": "0014760c51588eebf1d9f26c81335c70c42aea4f1a59",
                    "hex": "160014760c51588eebf1d9f26c81335c70c42aea4f1a59"
                },
                "addresses": [
                    "32TDFPUsa1FM9kdyJm9oE14MfZFy3JhS4v"
                ],
                "value": 0.0001
            }
        ],
        "total_input": 0.0002,
        "outputs": [
            {
                "value": 0.0001,
                "index": 0,
                "script": {
                    "type": "pubkeyhash",
                    "asm": "OP_DUP OP_HASH160 cb0af04acb1be057e1172119b94383f4653fa3b7 OP_EQUALVERIFY OP_CHECKSIG",
                    "hex": "76a914cb0af04acb1be057e1172119b94383f4653fa3b788ac"
                },
                "addresses": [
                    "1KWbGyMn9MMwQSRLYtWqszcpNST9TqC1vg"
                ]
            },
            {
                "value": 6.84e-5,
                "index": 1,
                "script": {
                    "type": "pubkeyhash",
                    "asm": "OP_DUP OP_HASH160 6d3b5e5d8d8bd035ce785d3bb27c332d7cfced1c OP_EQUALVERIFY OP_CHECKSIG",
                    "hex": "76a9146d3b5e5d8d8bd035ce785d3bb27c332d7cfced1c88ac"
                },
                "addresses": [
                    "1AxZmuy1kMK4VXQzGuvzQNmqP2s9mS9vBu"
                ]
            }
        ],
        "total_output": 0.0001684,
        "input_count": 2,
        "output_count": 2,
        "fee": 3.16e-5,
        "fee_per_kb": 7.453e-5,
        "locktime": 0,
        "block_hash": "00000000000000000006f272f7b8f2ba106632dbac06f578294f692db75d68be",
        "block_height": 594167,
        "datetime": "2019-09-10T12:30:35+00:00",
        "timestamp": 1568118635,
        "confirmations": 71237
    },
    "state": {
        "code": 200,
        "success": true
    }
}

Info

Return information for a specific transaction.

HTTP Request

GET https://api.blocksdk.com/v2/btc/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