client.auth is the API-key identity surface. It exposes me() and nested client.auth.profile.
let me = client.auth.me().await?;
println!("{} {:?}", me.account_id, me.api_key_id);
println!("{:?}", me.root_smart_account_address);The Account ID is sufficient identity for API-key auth. username may be absent/empty; do not
reject the identity or substitute "-" as though it were required.
me.api_key_id is the ak_... credential handle of the authenticated key, the same value as
request-signing Config.api_key_id and API-key metadata key_id (including key CRUD in session
clients that expose it).
Profile identity stream
The Rust SDK deliberately omits profile get/update/history methods. The API-key-safe operation is:
let mut updates = client.auth.profile.subscribe_identity().await?;
if let Some(identity) = updates.recv_result().await? {
println!("{} {}", identity.account_id, identity.username);
}Wallet login, JWT refresh, MFA enrollment, and account resolve are not wrapped. API-key
callers should configure default_account_id explicitly.
Related
Related Topics
Address book Saved destinations and whitelist views. API keys List, get, subscribe, and generate local API key material (no create on API-key SDKs). Balances List ledger balances via GetBalancesRequest, read held amounts and history, and subscribe to private updates. Candles Read and stream public spot OHLCV candles via market_data. Catalog Spot/Zipper catalog hydration with hydrate_catalogs and wait_for_catalogs. Chain helpers On-chain Funding → Trading and Funding withdraw helpers. Chain analytics Chain analytics read APIs. Client configuration Config fields, URLs, catalogs, wire format, and from_env behavior. Deposit Create and list per-account chain deposit addresses for funding your Polyester account. Errors Rust Error enum variants, API-key refusals, MFA auth codes, and queue overflow. Fees Read effective, reserve, and post-only reserve spot fee rates with the Rust FeeService. Guard signer Guard signer approval helpers. Heatmap L2 order book heatmap reads. Internal transfers Move trading balances between Polyester accounts without touching a chain. Lifecycle Deposit/withdraw lifecycle flows and subscribe. Market overview List and subscribe to per-market stats with optional snapshot-then-stream merge. Order book Depth snapshots and a stateful live order book that reconstructs the book for you. Orders Place, modify, cancel, batch, and stream spot orders with the Rust OrdersService. Policies Realtime API-key and subaccount-policy updates. Profile Profile identity reads and subscribe helpers. Public trades Public trade tape reads and subscribe via market_data. Realtime Shared Centrifugo client, observable failures, handshake-before-return, and fail-closed overflow. Social verification Social verification APIs (reference-only). Subaccounts Subaccount reads, members, invites, activity. User trades List and stream your private spot fills (not the public tape). Transfers Transfer history reads. Triggers Create, manage, pause/resume, and stream standalone triggers with the Rust TriggersService. Withdrawals Trading withdraw intents to funding or external chain destinations (signed payload). Zipper Deposit/withdraw config and related Zipper reads.