Installation
Initialising the client
- Use
base_url="https://staging-api.example"
to point at alternative environments. - Pass a configured
requests.Session
viasession=
to reuse connections, retries, or proxies.
Session
with retry behavior or proxy settings once and reuse it across wallet operations.
Wallet management
Wallet
objects expose properties:id
,wallet_name
,address
,network
,testnet
,last_used
,metadata
, andraw_data
.client.get_wallet(wallet_id)
accepts a wallet ID (w_<uuid>
), wallet address, or wallet name when retrieving data.- If the resource does not exist the SDK returns a wallet object with
None
fields so you can branch onwallet.id
.
raw_data
for custom parsing.
Deleting wallets
delete_wallet
returnsNone
on success and raisesrequests.HTTPError
for missing or unauthorized wallets.- Pass either the wallet ID (
w_<uuid>
) or the on-chain address to remove the wallet.
Sending payments
- For ERC-20 and TRC-20 assets ensure the wallet holds enough native token to pay gas or energy.
- Include a
metadata
mapping to persist identifiers alongside the transaction; it is accessible later through the API or SDK helpers. - The tuple captures both success state and the transaction hash or provider error message.
client.send_from_wallet(wallet_id, ...)
accepts a wallet ID or address; thewallet.send(...)
helper reads the ID from the instance.
Tuning network fees
btc_fee
accepts the provider tiers ("low"
,"normal"
,"high"
) or a custom sat/kByte value; the SDK forwards the string as-is.eth_fee
overrides the gas limit; defaults are 21,000 for ETH and 65,000 for ERC-20 transfers.eth_max_priority_fee_per_gas
andeth_max_fee_per_gas
map to the EIP-1559 fields in wei—ensure the max fee is greater than or equal to the priority fee.- Include
metadata
when you want the transaction record to carry your internal references. - Skip any of the parameters to let the API choose the recommended values.
wallet.send(...)
, which simply delegates to client.send_from_wallet
.
BTC multi-output sends
For Bitcoin, you can send to multiple recipients in a single transaction by passing a mapping fordestination
and omitting amount
:
- Provide exactly one shape: either
destination
as a string withamount
, or a mapping fordestination
withoutamount
. - Multi-output is currently supported only for BTC.
Listing UTXOs
UTXO
helper exposes txid
, vout
, address
, amount_btc
, confirmations
, script
, and raw_data
.
Retrieving transactions
get_transaction
accepts either the 1151 transaction ID (tx_<uuid>
) or the on-chain transaction hash.Transaction
objects exposeid
,direction
,asset
,amount
,destination
,success
,metadata
, andraw_data
for the original payload.
Error handling
- Non-2xx responses raise
requests.HTTPError
after callingresponse.raise_for_status()
. - Timeouts raise
requests.Timeout
. - For
/wallet/send
, inspect the(success, tx_id)
tuple even when the HTTP status is 200. - Wrap calls in
try
/except
blocks to provide actionable feedback to operators when something goes wrong.