Skip to main content
Requires limitless-exchange-rust-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

Use trading and delegated_signing scopes, plus account_creation for allowances. Reuse the client and do not configure a global x-on-behalf-of header.

Browse and check approval

Use client.packs.list().await?, search("football").await?, or get(pack_id).await? to browse. If approval is missing, call client.partner_accounts.retry_allowances(profile_id).await? and poll check_allowances with a bounded wait until the vault is confirmed. Repair uses the unlimited-approval policy.

Prepare once, then submit the saved request

Durably save the complete PackBuyParams before submission, using serde_json and your application store. Associate the record with the environment, partner, and managed account. On restart, reload it; do not call preparation again for the same purchase. Polling continues through position FAILED and stops on VAULT_REVERTED. Defaults are 60 attempts and a 5-second interval. On timeout or an ambiguous result, retain and replay the request unchanged, including its deadline. See explicit renewal signals.

Read positions and claim

Use list_positions(profile_id, 20, 0) to list purchases, claim_once(profile_id, position_id) for one workflow step, and confirm_claim(profile_id, position_id, redemption_tx_hash) to recover a lost submission response with the mined redemption receipt. All are async. After claiming, the position remains WON; verify claim_tx_hash or the claim response’s CLAIMED status. position.wallet identifies the managed recipient.

Classify errors

limitless_exchange_rust_sdk::classify_pack_error(&error) returns typed details. Its kind is a PackErrorKind: AllowanceRequired, NotSubmitted, PriceDrifted, IntentExpired, WalletBusy, RateLimited, SubmissionUnknown, TransactionReverted, or Other. The optional fields include token_address, spender, required_allowance, submission_state, parlay_id, and recovery. Classification does not retry. The claim helper surfaces API errors. Back off on rate limits and wallet-busy conflicts, then resume the same position. For SubmissionUnknown, reconcile the mined redemption transaction and use confirm_claim; do not blindly resubmit.