Wallet
Wallet lifecycle and read access: register a device key, resolve the multisig address, and read balances and UTXOs.
Register wallet
https://api.gobtcpay.com/public/api/v1.2/instant/wallet/registerRegisters the user's wallet public key and provisions their multisig wallet, the user's main wallet that all payments are spent from. Call this once after generating the key pair; returns the multisig address.
Authorization: walletAuth
Body required
application/jsonuserPubKeyHexstringrequiredPublic key of the user's Bitcoin wallet, compressed secp256k1 key, hex (33 bytes). Becomes a signer of the new multisig wallet.
02a1633cafcc01ebfb6d78e39f687a1f0995c62fc95f51ead10a02ee0be551b5dcResponses
idstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6resultobjectrequiredcurl -X POST "$BASE_URL/instant/wallet/register" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-d '{
"userPubKeyHex": "02a1633cafcc01ebfb6d78e39f687a1f0995c62fc95f51ead10a02ee0be551b5dc"
}'{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": {
"$case": "success",
"success": {
"address": "bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq",
"serverPubKeyHex": "02a1633cafcc01ebfb6d78e39f687a1f0995c62fc95f51ead10a02ee0be551b5dc"
}
}
}Get wallet address
https://api.gobtcpay.com/public/api/v1.2/instant/wallet/getReturns the authenticated user's multisig wallet address.
Authorization: walletAuth
Responses
idstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6resultobjectrequiredcurl -X POST "$BASE_URL/instant/wallet/get" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN"{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": {
"$case": "success",
"success": {
"address": "bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq",
"serverPubKeyHex": "02a1633cafcc01ebfb6d78e39f687a1f0995c62fc95f51ead10a02ee0be551b5dc"
}
}
}Get balances
https://api.gobtcpay.com/public/api/v1.2/instant/wallet/get-balancesReturns the wallet's balances broken down by state, on-chain (confirmed / unconfirmed), signed, locked, pending change, the spendable leftBalance and totalBalance, all in satoshis. leftBalance is confirmedOnChainBalance - lockedBalance - signedBalance (floored at 0) and the reservation buckets never overlap; totalBalance additionally includes pendingChangeBalance, our own change from an already broadcast but still unconfirmed transaction, which is not spendable yet. leftBalanceInUsd / leftBalanceInCurrency give the fiat equivalent (null when a rate is unavailable). Pass currency to choose the fiat conversion.
Authorization: walletAuth
Body required
application/jsoncurrencystringOptional fiat currency for the converted balance fields (e.g. USD).
USDResponses
idstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6resultobjectrequiredcurl -X POST "$BASE_URL/instant/wallet/get-balances" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-d '{
"currency": "USD"
}'{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": {
"$case": "success",
"success": {
"onChainBalance": "string",
"confirmedOnChainBalance": "string",
"unconfirmedOnChainBalance": "string",
"signedBalance": "string",
"lockedBalance": "string",
"pendingChangeBalance": "string",
"leftBalance": "string",
"totalBalance": "string",
"leftBalanceInUsd": 50000,
"leftBalanceInCurrency": 50000
}
}
}