Installation
Initialising the client
- Use
base_url="https://staging-api.example"to point at alternative environments. - Pass a configured
requests.Sessionviasession=to reuse connections, retries, or proxies.
Session with retry behavior or proxy settings once and reuse it across wallet operations.
Wallet management
Walletobjects 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
Nonefields so you can branch onwallet.id.
raw_data for custom parsing.
Deleting wallets
delete_walletreturnsNoneon success and raisesrequests.HTTPErrorfor 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
metadatamapping 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.
Custom ERC-20 by contract
To send an ERC-20 not covered byasset, omit asset and provide the contract address via eth_erc20_contract as a string:
- For Ethereum, provide either
assetoreth_erc20_contract(not both). amountis in token units for ERC-20 transfers.
Tuning network fees
btc_feeaccepts the provider tiers ("low","normal","high") or a custom sat/kByte value; the SDK forwards the string as-is.eth_feeoverrides the gas limit; defaults are 21,000 for ETH and 65,000 for ERC-20 transfers.eth_max_priority_fee_per_gasandeth_max_fee_per_gasmap to the EIP-1559 fields in wei—ensure the max fee is greater than or equal to the priority fee.- Include
metadatawhen 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
destinationas a string withamount, or a mapping fordestinationwithoutamount. - 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_transactionaccepts either the 1151 transaction ID (tx_<uuid>) or the on-chain transaction hash.Transactionobjects exposeid,direction,asset,amount,destination,success,metadata, andraw_datafor the original payload.
Error handling
- Non-2xx responses raise
requests.HTTPErrorafter 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/exceptblocks to provide actionable feedback to operators when something goes wrong.