limitless-sdk 1.3.0 or later. Read the Partner Packs workflow for account ownership, durable retries, amounts, and recovery rules.
Configure a server-side client
async with create_client() as client to close the client after use. Reuse it across requests. The token needs trading and delegated_signing, plus account_creation for allowances. Do not configure a global x-on-behalf-of header.
Browse and check approval
await client.partner_accounts.retry_allowances(profile_id) and poll check_allowances with a bounded wait until the vault is confirmed. Repair uses the unlimited-approval policy. Complete this before creating the short-lived intent.
Prepare once, then submit the saved request
request.model_dump_json(by_alias=True) in your application store. Reload it with PackBuyParams.model_validate_json(saved_json). Keep the environment, partner identity, and managed account with the record.
On restart, submit the saved request; do not prepare a new one for the same purchase. Polling continues through position FAILED, stopping on VAULT_REVERTED. On an ambiguous result or timeout, retain the request and replay unchanged, including an expired deadline. See explicit renewal signals.
Read positions and claim
claim_once for one workflow step. interval is in seconds; cancel the async task to cancel a wait. After claiming, the position remains WON; verify claim_tx_hash or the claim response’s CLAIMED status.
Classify errors
classify_pack_error(error) returns a typed result with kind: ALLOWANCE_REQUIRED, NOT_SUBMITTED, PRICE_DRIFTED, INTENT_EXPIRED, WALLET_BUSY, RATE_LIMITED, SUBMISSION_UNKNOWN, TRANSACTION_REVERTED, or OTHER.
Allowance details include token_address, spender, and required_allowance; pre-broadcast failure details include submission_state, parlay_id, and recovery. The classifier does not retry.
The claim helper surfaces API errors. Back off on rate limits and wallet-busy conflicts, then resume the same position. For SUBMISSION_UNKNOWN, reconcile the mined redemption transaction and use confirm_claim; do not blindly resubmit.