Examples: Server Wallet
Worked custodial-wallet workflow patterns
Create a testnet wallet, fund it, and check the balance
account / getOrCreatewithaccountName: "demo-wallet"— creates the EVM account if it doesn't exist yet, and returns itsaddress.account / requestFaucetwith thataddressandtoken: "eth"(network defaults tobase-sepolia, testnet). RequireswalletSecretCredentialId.account / listBalanceswith the sameaddressandnetwork: "base-sepolia"(override the mainnet default) to confirm the faucet funds arrived.
Send funds out of a managed wallet
transfer / sendNativewithaccountName,toAddress, andamount. RequireswalletSecretCredentialId.- The idempotency key is generated once for this step and reused automatically on retry — safe to let the platform's transport retry a transient failure here, unlike
swap/execute. - Inspect the returned
transactionHashto track on-chain confirmation externally.
Quote before you swap
swap / quotewithfromToken,toToken,fromAmount— no wallet secret needed for this read-only step.- A condition node checks
liquidityAvailable === truebefore proceeding —falseis a normal response, not an error. - If liquidity is available,
swap / executewith the same accountName/tokens/amount. Because this operation has no confirmed idempotency mechanism, treat a timeout as an unknown outcome — checkbalance / listTokensfor the account before deciding whether to re-run the swap.
Enforce a spend policy on a smart account
account / getOrCreateto get an owner EVM address.smartAccount / getOrCreatewith thatownerAddressand anaccountName.policy / createwith apolicyJsondocument describing the allowed spend rules. RequireswalletSecretCredentialId.policy / listorpolicy / getlater to audit which policies are active — these two reads don't need the Wallet Secret.
Solana side-by-side
solanaAccount / getOrCreate and solanaAccount / requestFaucet mirror the EVM account lifecycle above one-for-one — same config shape, same fail-closed Wallet Secret requirement on the faucet call.