Skip to main content

Wallets

Your company's USDR balance and top-up history. A company has exactly one wallet β€” the currency in the path is contract shape, not a selector.

get_my_wallet​

Fetches the current balance.

Signature​

def get_my_wallet(self, currency: str) -> MyWallet:

Parameters​

NameTypeRequiredDescription
currencystrYes3 to 5 uppercase letters, e.g. "USDR". Contract shape, not a selector β€” a company has one wallet, returned for any well-formed currency code.

Returns​

MyWallet:

FieldTypeDescription
statusOptional[str]Wallet status, e.g. "ACTIVE".
currencyOptional[str]Echoes the requested currency.
amountOptional[str]Balance, as a decimal string β€” never do float math on it.

Example​

wallet = client.get_my_wallet("USDR")
print(wallet.status, wallet.currency, wallet.amount)

Errors​

  • B2B_WALLET_NOT_CONFIGURED β€” your company has no wallet provisioned yet.
  • B2B_WALLET_NOT_FOUND β€” the configured wallet doesn't exist at the provider.
  • B2B_UNAUTHORIZED β€” bad token or bad request signature.
  • ValueError β€” raised locally when currency doesn't match the 3–5 uppercase-letter shape.

Notes​

  • Print the fields you need rather than the whole object β€” this page deliberately does not document every field the wallet can carry on the wire.

API reference​

GET /me/wallets/{currency}

get_my_wallet_transactions​

Lists the wallet's top-up history, cursor-paginated.

Signature​

def get_my_wallet_transactions(
self,
currency: str,
transaction_type: WalletTransactionType,
params: Optional[ListWalletTransactionsParams] = None,
) -> WalletTransactionsResponse:

Parameters​

NameTypeRequiredDescription
currencystrYesSame shape as get_my_wallet.
transaction_typeWalletTransactionTypeYesCurrently only WalletTransactionType.TOP_UP, which returns every credit to the wallet: on-chain deposits and credits booked by treasury. Closed wire enum β€” a future unknown value raises rather than silently passing through.
paramsOptional[ListWalletTransactionsParams]NoCursor pagination.

ListWalletTransactionsParams (helper: ListWalletTransactionsParams.first_page(limit=...)):

FieldTypeDescription
cursorOptional[str]Opaque cursor from a previous page. Omit for the first page.
limitOptional[int]1 to 100.

Returns​

WalletTransactionsResponse:

FieldTypeDescription
paginationOptional[CursorPagination]next_cursor, has_more, limit, total. See Pagination.
dataOptional[List[WalletTransaction]]The page of transactions β€” id, external_id, type ("top_up" for an on-chain deposit, "b2b_manual_credit" for a credit booked by treasury), amount (decimal string with two decimals), currency, created_at, status. Print the fields you need.

Example​

from retorna_sdk import ListWalletTransactionsParams, WalletTransactionType

params = ListWalletTransactionsParams.first_page(limit=50)
while True:
page = client.get_my_wallet_transactions("USDR", WalletTransactionType.TOP_UP, params)
for tx in page.data or []:
print(tx.id, tx.external_id, tx.type, tx.amount, tx.currency)
if not page.pagination or not page.pagination.has_more:
break
params = ListWalletTransactionsParams(cursor=page.pagination.next_cursor, limit=50)

Errors​

  • B2B_WALLET_NOT_CONFIGURED β€” your company has no wallet provisioned yet.
  • B2B_INVALID_PAGINATION_CURSOR β€” the cursor was malformed or not issued by this listing.
  • B2B_UNAUTHORIZED β€” bad token or bad request signature.
  • ValueError β€” raised locally when transaction_type is None, currency doesn't match the wallet-currency shape, limit is outside 1..100, or cursor is present but blank.

Notes​

  • Top-up history paginates the same cursor-based way as orders β€” there is no page parameter, and sending one is a 400.
  • The transaction model carries fields beyond what this page prints; skip anything you do not need rather than dumping the whole object.

API reference​

GET /me/wallets/{currency}/transactions/{type}