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β
| Name | Type | Required | Description |
|---|---|---|---|
currency | str | Yes | 3 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:
| Field | Type | Description |
|---|---|---|
status | Optional[str] | Wallet status, e.g. "ACTIVE". |
currency | Optional[str] | Echoes the requested currency. |
amount | Optional[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 whencurrencydoesn'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_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β
| Name | Type | Required | Description |
|---|---|---|---|
currency | str | Yes | Same shape as get_my_wallet. |
transaction_type | WalletTransactionType | Yes | Currently 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. |
params | Optional[ListWalletTransactionsParams] | No | Cursor pagination. |
ListWalletTransactionsParams (helper: ListWalletTransactionsParams.first_page(limit=...)):
| Field | Type | Description |
|---|---|---|
cursor | Optional[str] | Opaque cursor from a previous page. Omit for the first page. |
limit | Optional[int] | 1 to 100. |
Returnsβ
WalletTransactionsResponse:
| Field | Type | Description |
|---|---|---|
pagination | Optional[CursorPagination] | next_cursor, has_more, limit, total. See Pagination. |
data | Optional[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 whentransaction_typeisNone,currencydoesn't match the wallet-currency shape,limitis outside 1..100, orcursoris present but blank.
Notesβ
- Top-up history paginates the same cursor-based way as orders β there is no
pageparameter, and sending one is a400. - The transaction model carries fields beyond what this page prints; skip anything you do not need rather than dumping the whole object.