claimPayout
Claims the winner’s USDC payout from a resolved market. The Arcium MPC circuit verifies the encrypted position against the revealed outcome and computes the transfer amount.TypeScript
You do not need the local private key to claim. The Arcium reveal circuit
already decrypted the bet pools when the market resolved - the payout ratio is
now public on-chain. The claim circuit uses your position’s
netAmount field
(plaintext) to compute your share.Parameters
Transaction fee payer.
The bettor’s public key. Must match the position’s
user field.A resolved market in
claimable phase.Which position to claim. Defaults to
0n. Users who placed multiple bets on
the same market must pass the specific index. Check
EncryptedPositionAccount.betIndex on each position to find which ones to
claim.Arcium computation slot. Random by default.
Milliseconds to wait for the MPC callback. Defaults to
60_000.Progress stages:
validating → fetching-state → submitting → awaiting-callback → refetching → done.Return value
Transaction signature.
Updated position with
claimed: true.Updated market account.
Arcium callback result.
claimRefund
Claims a full refund when the market’s resolver never posted an outcome and the resolution deadline has passed.TypeScript
claimPayout. The market must be in refundable phase - past the resolution deadline with no outcome posted (state === Unresolved).
Refunds are available when the resolver fails to post within
DEFAULT_RESOLUTION_WINDOW_SECS (7 days after close time). The refunded
amount is the user’s original net stake.Claiming multiple bets
If a user placed multiple bets on the same market, each position must be claimed separately.TypeScript
Phase requirements
| Action | Market phase | Market state |
|---|---|---|
claimPayout | claimable | Resolved (2) |
claimRefund | refundable | Unresolved (3) |
marketPhase(market) from @cypher-zk/sdk to check the current phase before showing claim buttons.