@useaccord/sdk 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/adapter.d.ts.map +1 -1
- package/dist/constants.d.ts +6 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/evidence/base64.d.ts +12 -0
- package/dist/evidence/base64.d.ts.map +1 -0
- package/dist/evidence/delivery-key.d.ts +82 -0
- package/dist/evidence/delivery-key.d.ts.map +1 -0
- package/dist/evidence/ecies.d.ts +5 -5
- package/dist/evidence/ecies.d.ts.map +1 -1
- package/dist/evidence/fetch.d.ts +34 -10
- package/dist/evidence/fetch.d.ts.map +1 -1
- package/dist/evidence/index.d.ts +1 -0
- package/dist/evidence/index.d.ts.map +1 -1
- package/dist/evidence/index.js +171 -14
- package/dist/evidence/index.js.map +1 -1
- package/dist/evidence/keys.d.ts.map +1 -1
- package/dist/evidence/parse.d.ts +3 -0
- package/dist/evidence/parse.d.ts.map +1 -1
- package/dist/evidence/publish.d.ts.map +1 -1
- package/dist/generated/accounts/appealBond.d.ts +16 -0
- package/dist/generated/accounts/appealBond.d.ts.map +1 -1
- package/dist/generated/accounts/dispute.d.ts +34 -8
- package/dist/generated/accounts/dispute.d.ts.map +1 -1
- package/dist/generated/accounts/jurorStake.d.ts +24 -0
- package/dist/generated/accounts/jurorStake.d.ts.map +1 -1
- package/dist/generated/errors/accord.d.ts +3 -1
- package/dist/generated/errors/accord.d.ts.map +1 -1
- package/dist/generated/instructions/claimFilingBounty.d.ts +82 -0
- package/dist/generated/instructions/claimFilingBounty.d.ts.map +1 -0
- package/dist/generated/instructions/index.d.ts +1 -0
- package/dist/generated/instructions/index.d.ts.map +1 -1
- package/dist/generated/instructions/settleRound.d.ts +1 -1
- package/dist/generated/programs/accord.d.ts +31 -27
- package/dist/generated/programs/accord.d.ts.map +1 -1
- package/dist/index.js +1021 -770
- package/dist/index.js.map +1 -1
- package/dist/methods/appeal.d.ts +9 -5
- package/dist/methods/appeal.d.ts.map +1 -1
- package/dist/methods/dispute.d.ts +6 -5
- package/dist/methods/dispute.d.ts.map +1 -1
- package/dist/methods/settlement.d.ts +24 -1
- package/dist/methods/settlement.d.ts.map +1 -1
- package/dist/methods/staking.d.ts +23 -5
- package/dist/methods/staking.d.ts.map +1 -1
- package/dist/methods/voting.d.ts +6 -7
- package/dist/methods/voting.d.ts.map +1 -1
- package/dist/methods/vrf.d.ts.map +1 -1
- package/dist/methods.d.ts +3 -2
- package/dist/methods.d.ts.map +1 -1
- package/package.json +17 -8
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/accord.ts","../src/generated/programs/accord.ts","../src/generated/accounts/accordState.ts","../src/generated/accounts/appealBond.ts","../src/generated/accounts/dispute.ts","../src/generated/types/aggregation.ts","../src/generated/types/caseTerms.ts","../src/generated/types/disputeState.ts","../src/generated/types/leafClaim.ts","../src/generated/types/mSTNode.ts","../src/generated/types/shortfallPolicy.ts","../src/generated/types/updatePayload.ts","../src/generated/accounts/jurorStake.ts","../src/generated/accounts/pendingUpdate.ts","../src/generated/accounts/round.ts","../src/generated/accounts/subaccord.ts","../src/generated/instructions/appeal.ts","../src/generated/pdas/accordState.ts","../src/generated/pdas/appealBond.ts","../src/generated/pdas/dispute.ts","../src/generated/pdas/jurorStake.ts","../src/generated/pdas/pendingUpdate.ts","../src/generated/pdas/programIdentity.ts","../src/generated/pdas/round.ts","../src/generated/pdas/subaccord.ts","../src/generated/instructions/cancelDispute.ts","../src/generated/instructions/claimAppealRefund.ts","../src/generated/instructions/commit.ts","../src/generated/instructions/commitVrfCallback.ts","../src/generated/instructions/createDispute.ts","../src/generated/instructions/createSubaccord.ts","../src/generated/instructions/drawSeat.ts","../src/generated/instructions/executeSubaccordUpdate.ts","../src/generated/instructions/executeUnpause.ts","../src/generated/instructions/finalizeDispute.ts","../src/generated/instructions/finalizeRound.ts","../src/generated/instructions/getRuling.ts","../src/generated/instructions/health.ts","../src/generated/instructions/initializePause.ts","../src/generated/instructions/pause.ts","../src/generated/instructions/proposeSubaccordUpdate.ts","../src/generated/instructions/proposeUnpause.ts","../src/generated/instructions/pruneJuror.ts","../src/generated/instructions/reclaimSlot.ts","../src/generated/instructions/reconcileStake.ts","../src/generated/instructions/redraw.ts","../src/generated/instructions/requestVrf.ts","../src/generated/instructions/requestWithdraw.ts","../src/generated/instructions/reveal.ts","../src/generated/instructions/settleRound.ts","../src/generated/instructions/stake.ts","../src/generated/instructions/withdraw.ts","../src/generated/instructions/withdrawFees.ts","../src/pda.ts","../src/adapter.ts","../src/methods/dispute.ts","../src/constants.ts","../src/methods/lifecycle.ts","../src/methods/staking.ts","../src/methods/settlement.ts","../src/methods/mst.ts","../src/methods/vrf.ts","../src/methods/voting.ts","../src/methods/appeal.ts","../src/methods.ts","../src/wallet.ts","../src/token.ts","../src/query.ts","../src/errors.ts","../src/methods/stakeFlow.ts","../src/methods/disputePhase.ts","../src/queries.ts","../src/domain.ts","../src/index.ts"],"sourcesContent":["/**\n * Accord facade — the primary consumer surface for the VeriDAO Accord SDK.\n *\n * Composes the generated Codama Kit client with domain-level orchestration.\n * Method-group modules (`src/methods/*.ts`) are standalone functions that take\n * the facade's client + args; this class pre-wires delegation to each group.\n *\n * @see ADR-0010\n */\n\nimport {\n createSolanaRpc,\n type Address,\n type Rpc,\n type SolanaRpcApi,\n type TransactionSigner,\n} from \"@solana/kit\";\n\nimport {\n accordProgram,\n type AccordPlugin,\n type AccordPluginRequirements,\n} from \"./generated/programs/accord\";\nimport { ACCORD_PROGRAM_ID } from \"./pda\";\nimport { createAccordAdapter, type AccordAdapter } from \"./adapter.js\";\nimport { createAccordMethods, type AccordMethods } from \"./methods.js\";\n\n/** A Kit client extended with the Accord plugin. */\nexport type AccordClient = ReturnType<ReturnType<typeof accordProgram>>;\n\nexport interface AccordConfig {\n /** JSON-RPC endpoint (e.g. \"http://localhost:8899\"). */\n endpoint: string;\n /** A Kit TransactionSigner (from wallet.ts or @solana/kit). */\n signer: TransactionSigner;\n}\n\nexport class Accord {\n /** The canonical Accord program address. */\n static readonly PROGRAM_ID = ACCORD_PROGRAM_ID;\n\n readonly rpc: Rpc<SolanaRpcApi>;\n readonly signer: TransactionSigner;\n readonly client: AccordClient;\n\n private _adapter?: AccordAdapter;\n\n constructor(config: AccordConfig) {\n this.rpc = createSolanaRpc(config.endpoint);\n this.signer = config.signer;\n // Extend the RPC with the Accord plugin (accounts, instructions, PDAs).\n // The RPC satisfies AccordPluginRequirements at runtime; the type assertion\n // bridges Kit's generic client interface for the shell.\n this.client = accordProgram()(\n this.rpc as unknown as AccordPluginRequirements,\n );\n }\n\n /**\n * The concrete seam adapter — implements all seven `Accord*Client` seams\n * against the generated Codama client. Pass to the pure orchestration\n * functions in `src/methods/*.ts`, or use {@link methods} for bound helpers.\n */\n get adapter(): AccordAdapter {\n if (!this._adapter) this._adapter = createAccordAdapter(this);\n return this._adapter;\n }\n\n /**\n * Bound orchestration namespace covering all eight method groups. Each helper\n * validates (pure) + builds the instruction via {@link adapter}; the caller\n * signs + sends the returned `Instruction` with `this.signer`.\n */\n get methods(): AccordMethods {\n return createAccordMethods(this.adapter, ACCORD_PROGRAM_ID, this.signer);\n }\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n assertIsInstructionWithAccounts,\n containsBytes,\n extendClient,\n fixEncoderSize,\n getBytesEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_ACCOUNT,\n SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION,\n SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE,\n SolanaError,\n type Address,\n type ClientWithRpc,\n type ClientWithTransactionPlanning,\n type ClientWithTransactionSending,\n type ExtendedClient,\n type GetAccountInfoApi,\n type GetMultipleAccountsApi,\n type Instruction,\n type InstructionWithData,\n type ReadonlyUint8Array,\n} from \"@solana/kit\";\nimport {\n addSelfFetchFunctions,\n addSelfPlanAndSendFunctions,\n type SelfFetchFunctions,\n type SelfPlanAndSendFunctions,\n} from \"@solana/kit/program-client-core\";\nimport {\n getAccordStateCodec,\n getAppealBondCodec,\n getDisputeCodec,\n getJurorStakeCodec,\n getPendingUpdateCodec,\n getRoundCodec,\n getSubaccordCodec,\n type AccordState,\n type AccordStateArgs,\n type AppealBond,\n type AppealBondArgs,\n type Dispute,\n type DisputeArgs,\n type JurorStake,\n type JurorStakeArgs,\n type PendingUpdate,\n type PendingUpdateArgs,\n type Round,\n type RoundArgs,\n type Subaccord,\n type SubaccordArgs,\n} from \"../accounts\";\nimport {\n getAppealInstructionAsync,\n getCancelDisputeInstructionAsync,\n getClaimAppealRefundInstructionAsync,\n getCommitInstruction,\n getCommitVrfCallbackInstruction,\n getCreateDisputeInstructionAsync,\n getCreateSubaccordInstructionAsync,\n getDrawSeatInstruction,\n getExecuteSubaccordUpdateInstruction,\n getExecuteUnpauseInstructionAsync,\n getFinalizeDisputeInstruction,\n getFinalizeRoundInstruction,\n getGetRulingInstruction,\n getHealthInstruction,\n getInitializePauseInstructionAsync,\n getPauseInstructionAsync,\n getProposeSubaccordUpdateInstructionAsync,\n getProposeUnpauseInstructionAsync,\n getPruneJurorInstructionAsync,\n getReclaimSlotInstruction,\n getReconcileStakeInstruction,\n getRedrawInstructionAsync,\n getRequestVrfInstructionAsync,\n getRequestWithdrawInstructionAsync,\n getRevealInstruction,\n getSettleRoundInstructionAsync,\n getStakeInstructionAsync,\n getWithdrawFeesInstructionAsync,\n getWithdrawInstructionAsync,\n parseAppealInstruction,\n parseCancelDisputeInstruction,\n parseClaimAppealRefundInstruction,\n parseCommitInstruction,\n parseCommitVrfCallbackInstruction,\n parseCreateDisputeInstruction,\n parseCreateSubaccordInstruction,\n parseDrawSeatInstruction,\n parseExecuteSubaccordUpdateInstruction,\n parseExecuteUnpauseInstruction,\n parseFinalizeDisputeInstruction,\n parseFinalizeRoundInstruction,\n parseGetRulingInstruction,\n parseHealthInstruction,\n parseInitializePauseInstruction,\n parsePauseInstruction,\n parseProposeSubaccordUpdateInstruction,\n parseProposeUnpauseInstruction,\n parsePruneJurorInstruction,\n parseReclaimSlotInstruction,\n parseReconcileStakeInstruction,\n parseRedrawInstruction,\n parseRequestVrfInstruction,\n parseRequestWithdrawInstruction,\n parseRevealInstruction,\n parseSettleRoundInstruction,\n parseStakeInstruction,\n parseWithdrawFeesInstruction,\n parseWithdrawInstruction,\n type AppealAsyncInput,\n type CancelDisputeAsyncInput,\n type ClaimAppealRefundAsyncInput,\n type CommitInput,\n type CommitVrfCallbackInput,\n type CreateDisputeAsyncInput,\n type CreateSubaccordAsyncInput,\n type DrawSeatInput,\n type ExecuteSubaccordUpdateInput,\n type ExecuteUnpauseAsyncInput,\n type FinalizeDisputeInput,\n type FinalizeRoundInput,\n type GetRulingInput,\n type HealthInput,\n type InitializePauseAsyncInput,\n type ParsedAppealInstruction,\n type ParsedCancelDisputeInstruction,\n type ParsedClaimAppealRefundInstruction,\n type ParsedCommitInstruction,\n type ParsedCommitVrfCallbackInstruction,\n type ParsedCreateDisputeInstruction,\n type ParsedCreateSubaccordInstruction,\n type ParsedDrawSeatInstruction,\n type ParsedExecuteSubaccordUpdateInstruction,\n type ParsedExecuteUnpauseInstruction,\n type ParsedFinalizeDisputeInstruction,\n type ParsedFinalizeRoundInstruction,\n type ParsedGetRulingInstruction,\n type ParsedHealthInstruction,\n type ParsedInitializePauseInstruction,\n type ParsedPauseInstruction,\n type ParsedProposeSubaccordUpdateInstruction,\n type ParsedProposeUnpauseInstruction,\n type ParsedPruneJurorInstruction,\n type ParsedReclaimSlotInstruction,\n type ParsedReconcileStakeInstruction,\n type ParsedRedrawInstruction,\n type ParsedRequestVrfInstruction,\n type ParsedRequestWithdrawInstruction,\n type ParsedRevealInstruction,\n type ParsedSettleRoundInstruction,\n type ParsedStakeInstruction,\n type ParsedWithdrawFeesInstruction,\n type ParsedWithdrawInstruction,\n type PauseAsyncInput,\n type ProposeSubaccordUpdateAsyncInput,\n type ProposeUnpauseAsyncInput,\n type PruneJurorAsyncInput,\n type ReclaimSlotInput,\n type ReconcileStakeInput,\n type RedrawAsyncInput,\n type RequestVrfAsyncInput,\n type RequestWithdrawAsyncInput,\n type RevealInput,\n type SettleRoundAsyncInput,\n type StakeAsyncInput,\n type WithdrawAsyncInput,\n type WithdrawFeesAsyncInput,\n} from \"../instructions\";\nimport {\n findAccordStatePda,\n findAppealBondPda,\n findDisputePda,\n findJurorStakePda,\n findPendingUpdatePda,\n findProgramIdentityPda,\n findRoundPda,\n findSubaccordPda,\n} from \"../pdas\";\n\nexport const ACCORD_PROGRAM_ADDRESS =\n \"cordhVoshqRV6kzGBmM89A66wuusJGsDCvLMHPLyKed\" as Address<\"cordhVoshqRV6kzGBmM89A66wuusJGsDCvLMHPLyKed\">;\n\nexport enum AccordAccount {\n AccordState,\n AppealBond,\n Dispute,\n JurorStake,\n PendingUpdate,\n Round,\n Subaccord,\n}\n\nexport function identifyAccordAccount(\n account: { data: ReadonlyUint8Array } | ReadonlyUint8Array,\n): AccordAccount {\n const data = \"data\" in account ? account.data : account;\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([218, 6, 196, 225, 25, 89, 50, 183]),\n ),\n 0,\n )\n ) {\n return AccordAccount.AccordState;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([84, 79, 238, 7, 49, 113, 35, 143]),\n ),\n 0,\n )\n ) {\n return AccordAccount.AppealBond;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([36, 49, 241, 67, 40, 36, 241, 74]),\n ),\n 0,\n )\n ) {\n return AccordAccount.Dispute;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([139, 114, 205, 73, 247, 175, 133, 122]),\n ),\n 0,\n )\n ) {\n return AccordAccount.JurorStake;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([24, 212, 61, 73, 130, 111, 15, 112]),\n ),\n 0,\n )\n ) {\n return AccordAccount.PendingUpdate;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([87, 127, 165, 51, 73, 78, 116, 174]),\n ),\n 0,\n )\n ) {\n return AccordAccount.Round;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([210, 63, 193, 190, 9, 166, 89, 170]),\n ),\n 0,\n )\n ) {\n return AccordAccount.Subaccord;\n }\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_ACCOUNT,\n { accountData: data, programName: \"accord\" },\n );\n}\n\nexport enum AccordInstruction {\n Appeal,\n CancelDispute,\n ClaimAppealRefund,\n Commit,\n CommitVrfCallback,\n CreateDispute,\n CreateSubaccord,\n DrawSeat,\n ExecuteSubaccordUpdate,\n ExecuteUnpause,\n FinalizeDispute,\n FinalizeRound,\n GetRuling,\n Health,\n InitializePause,\n Pause,\n ProposeSubaccordUpdate,\n ProposeUnpause,\n PruneJuror,\n ReclaimSlot,\n ReconcileStake,\n Redraw,\n RequestVrf,\n RequestWithdraw,\n Reveal,\n SettleRound,\n Stake,\n Withdraw,\n WithdrawFees,\n}\n\nexport function identifyAccordInstruction(\n instruction: { data: ReadonlyUint8Array } | ReadonlyUint8Array,\n): AccordInstruction {\n const data = \"data\" in instruction ? instruction.data : instruction;\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([250, 91, 1, 244, 179, 52, 75, 236]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.Appeal;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([23, 155, 220, 94, 76, 141, 231, 124]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.CancelDispute;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([210, 169, 229, 146, 187, 30, 61, 176]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.ClaimAppealRefund;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([223, 140, 142, 165, 229, 208, 156, 74]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.Commit;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([51, 127, 131, 85, 83, 117, 121, 59]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.CommitVrfCallback;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([161, 99, 53, 116, 60, 79, 149, 105]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.CreateDispute;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([135, 240, 91, 50, 192, 161, 177, 22]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.CreateSubaccord;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([52, 26, 56, 16, 128, 4, 149, 236]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.DrawSeat;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([145, 99, 105, 27, 63, 159, 254, 203]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.ExecuteSubaccordUpdate;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([55, 43, 56, 5, 154, 156, 52, 232]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.ExecuteUnpause;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([190, 211, 17, 122, 247, 157, 27, 223]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.FinalizeDispute;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([239, 160, 254, 11, 254, 144, 53, 148]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.FinalizeRound;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([196, 52, 54, 1, 180, 75, 86, 16]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.GetRuling;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([235, 42, 47, 99, 10, 7, 249, 16]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.Health;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([70, 32, 55, 248, 231, 46, 123, 153]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.InitializePause;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([211, 22, 221, 251, 74, 121, 193, 47]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.Pause;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([8, 224, 186, 131, 130, 76, 165, 172]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.ProposeSubaccordUpdate;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([45, 136, 163, 143, 156, 57, 113, 132]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.ProposeUnpause;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([49, 219, 100, 132, 202, 120, 18, 167]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.PruneJuror;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([44, 216, 234, 229, 129, 82, 98, 5]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.ReclaimSlot;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([40, 103, 128, 85, 211, 11, 34, 80]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.ReconcileStake;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([86, 111, 66, 164, 105, 158, 114, 164]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.Redraw;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([5, 87, 79, 152, 164, 176, 190, 226]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.RequestVrf;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([137, 95, 187, 96, 250, 138, 31, 182]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.RequestWithdraw;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([9, 35, 59, 190, 167, 249, 76, 115]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.Reveal;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([40, 101, 18, 1, 31, 129, 52, 77]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.SettleRound;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([206, 176, 202, 18, 200, 209, 179, 108]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.Stake;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([183, 18, 70, 156, 148, 109, 161, 34]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.Withdraw;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([198, 212, 171, 109, 144, 215, 174, 89]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.WithdrawFees;\n }\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION,\n { instructionData: data, programName: \"accord\" },\n );\n}\n\nexport type ParsedAccordInstruction<\n TProgram extends string = \"cordhVoshqRV6kzGBmM89A66wuusJGsDCvLMHPLyKed\",\n> =\n | ({\n instructionType: AccordInstruction.Appeal;\n } & ParsedAppealInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.CancelDispute;\n } & ParsedCancelDisputeInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.ClaimAppealRefund;\n } & ParsedClaimAppealRefundInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.Commit;\n } & ParsedCommitInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.CommitVrfCallback;\n } & ParsedCommitVrfCallbackInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.CreateDispute;\n } & ParsedCreateDisputeInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.CreateSubaccord;\n } & ParsedCreateSubaccordInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.DrawSeat;\n } & ParsedDrawSeatInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.ExecuteSubaccordUpdate;\n } & ParsedExecuteSubaccordUpdateInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.ExecuteUnpause;\n } & ParsedExecuteUnpauseInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.FinalizeDispute;\n } & ParsedFinalizeDisputeInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.FinalizeRound;\n } & ParsedFinalizeRoundInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.GetRuling;\n } & ParsedGetRulingInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.Health;\n } & ParsedHealthInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.InitializePause;\n } & ParsedInitializePauseInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.Pause;\n } & ParsedPauseInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.ProposeSubaccordUpdate;\n } & ParsedProposeSubaccordUpdateInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.ProposeUnpause;\n } & ParsedProposeUnpauseInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.PruneJuror;\n } & ParsedPruneJurorInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.ReclaimSlot;\n } & ParsedReclaimSlotInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.ReconcileStake;\n } & ParsedReconcileStakeInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.Redraw;\n } & ParsedRedrawInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.RequestVrf;\n } & ParsedRequestVrfInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.RequestWithdraw;\n } & ParsedRequestWithdrawInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.Reveal;\n } & ParsedRevealInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.SettleRound;\n } & ParsedSettleRoundInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.Stake;\n } & ParsedStakeInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.Withdraw;\n } & ParsedWithdrawInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.WithdrawFees;\n } & ParsedWithdrawFeesInstruction<TProgram>);\n\nexport function parseAccordInstruction<TProgram extends string>(\n instruction: Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array>,\n): ParsedAccordInstruction<TProgram> {\n const instructionType = identifyAccordInstruction(instruction);\n switch (instructionType) {\n case AccordInstruction.Appeal: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.Appeal,\n ...parseAppealInstruction(instruction),\n };\n }\n case AccordInstruction.CancelDispute: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.CancelDispute,\n ...parseCancelDisputeInstruction(instruction),\n };\n }\n case AccordInstruction.ClaimAppealRefund: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.ClaimAppealRefund,\n ...parseClaimAppealRefundInstruction(instruction),\n };\n }\n case AccordInstruction.Commit: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.Commit,\n ...parseCommitInstruction(instruction),\n };\n }\n case AccordInstruction.CommitVrfCallback: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.CommitVrfCallback,\n ...parseCommitVrfCallbackInstruction(instruction),\n };\n }\n case AccordInstruction.CreateDispute: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.CreateDispute,\n ...parseCreateDisputeInstruction(instruction),\n };\n }\n case AccordInstruction.CreateSubaccord: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.CreateSubaccord,\n ...parseCreateSubaccordInstruction(instruction),\n };\n }\n case AccordInstruction.DrawSeat: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.DrawSeat,\n ...parseDrawSeatInstruction(instruction),\n };\n }\n case AccordInstruction.ExecuteSubaccordUpdate: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.ExecuteSubaccordUpdate,\n ...parseExecuteSubaccordUpdateInstruction(instruction),\n };\n }\n case AccordInstruction.ExecuteUnpause: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.ExecuteUnpause,\n ...parseExecuteUnpauseInstruction(instruction),\n };\n }\n case AccordInstruction.FinalizeDispute: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.FinalizeDispute,\n ...parseFinalizeDisputeInstruction(instruction),\n };\n }\n case AccordInstruction.FinalizeRound: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.FinalizeRound,\n ...parseFinalizeRoundInstruction(instruction),\n };\n }\n case AccordInstruction.GetRuling: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.GetRuling,\n ...parseGetRulingInstruction(instruction),\n };\n }\n case AccordInstruction.Health: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.Health,\n ...parseHealthInstruction(instruction),\n };\n }\n case AccordInstruction.InitializePause: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.InitializePause,\n ...parseInitializePauseInstruction(instruction),\n };\n }\n case AccordInstruction.Pause: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.Pause,\n ...parsePauseInstruction(instruction),\n };\n }\n case AccordInstruction.ProposeSubaccordUpdate: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.ProposeSubaccordUpdate,\n ...parseProposeSubaccordUpdateInstruction(instruction),\n };\n }\n case AccordInstruction.ProposeUnpause: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.ProposeUnpause,\n ...parseProposeUnpauseInstruction(instruction),\n };\n }\n case AccordInstruction.PruneJuror: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.PruneJuror,\n ...parsePruneJurorInstruction(instruction),\n };\n }\n case AccordInstruction.ReclaimSlot: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.ReclaimSlot,\n ...parseReclaimSlotInstruction(instruction),\n };\n }\n case AccordInstruction.ReconcileStake: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.ReconcileStake,\n ...parseReconcileStakeInstruction(instruction),\n };\n }\n case AccordInstruction.Redraw: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.Redraw,\n ...parseRedrawInstruction(instruction),\n };\n }\n case AccordInstruction.RequestVrf: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.RequestVrf,\n ...parseRequestVrfInstruction(instruction),\n };\n }\n case AccordInstruction.RequestWithdraw: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.RequestWithdraw,\n ...parseRequestWithdrawInstruction(instruction),\n };\n }\n case AccordInstruction.Reveal: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.Reveal,\n ...parseRevealInstruction(instruction),\n };\n }\n case AccordInstruction.SettleRound: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.SettleRound,\n ...parseSettleRoundInstruction(instruction),\n };\n }\n case AccordInstruction.Stake: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.Stake,\n ...parseStakeInstruction(instruction),\n };\n }\n case AccordInstruction.Withdraw: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.Withdraw,\n ...parseWithdrawInstruction(instruction),\n };\n }\n case AccordInstruction.WithdrawFees: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.WithdrawFees,\n ...parseWithdrawFeesInstruction(instruction),\n };\n }\n default:\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE,\n { instructionType: instructionType as string, programName: \"accord\" },\n );\n }\n}\n\nexport type AccordPlugin = {\n accounts: AccordPluginAccounts;\n instructions: AccordPluginInstructions;\n pdas: AccordPluginPdas;\n identifyAccount: typeof identifyAccordAccount;\n identifyInstruction: typeof identifyAccordInstruction;\n parseInstruction: typeof parseAccordInstruction;\n};\n\nexport type AccordPluginAccounts = {\n accordState: ReturnType<typeof getAccordStateCodec> &\n SelfFetchFunctions<AccordStateArgs, AccordState>;\n appealBond: ReturnType<typeof getAppealBondCodec> &\n SelfFetchFunctions<AppealBondArgs, AppealBond>;\n dispute: ReturnType<typeof getDisputeCodec> &\n SelfFetchFunctions<DisputeArgs, Dispute>;\n jurorStake: ReturnType<typeof getJurorStakeCodec> &\n SelfFetchFunctions<JurorStakeArgs, JurorStake>;\n pendingUpdate: ReturnType<typeof getPendingUpdateCodec> &\n SelfFetchFunctions<PendingUpdateArgs, PendingUpdate>;\n round: ReturnType<typeof getRoundCodec> &\n SelfFetchFunctions<RoundArgs, Round>;\n subaccord: ReturnType<typeof getSubaccordCodec> &\n SelfFetchFunctions<SubaccordArgs, Subaccord>;\n};\n\nexport type AccordPluginInstructions = {\n appeal: (\n input: AppealAsyncInput,\n ) => ReturnType<typeof getAppealInstructionAsync> & SelfPlanAndSendFunctions;\n cancelDispute: (\n input: CancelDisputeAsyncInput,\n ) => ReturnType<typeof getCancelDisputeInstructionAsync> &\n SelfPlanAndSendFunctions;\n claimAppealRefund: (\n input: ClaimAppealRefundAsyncInput,\n ) => ReturnType<typeof getClaimAppealRefundInstructionAsync> &\n SelfPlanAndSendFunctions;\n commit: (\n input: CommitInput,\n ) => ReturnType<typeof getCommitInstruction> & SelfPlanAndSendFunctions;\n commitVrfCallback: (\n input: CommitVrfCallbackInput,\n ) => ReturnType<typeof getCommitVrfCallbackInstruction> &\n SelfPlanAndSendFunctions;\n createDispute: (\n input: CreateDisputeAsyncInput,\n ) => ReturnType<typeof getCreateDisputeInstructionAsync> &\n SelfPlanAndSendFunctions;\n createSubaccord: (\n input: CreateSubaccordAsyncInput,\n ) => ReturnType<typeof getCreateSubaccordInstructionAsync> &\n SelfPlanAndSendFunctions;\n drawSeat: (\n input: DrawSeatInput,\n ) => ReturnType<typeof getDrawSeatInstruction> & SelfPlanAndSendFunctions;\n executeSubaccordUpdate: (\n input: ExecuteSubaccordUpdateInput,\n ) => ReturnType<typeof getExecuteSubaccordUpdateInstruction> &\n SelfPlanAndSendFunctions;\n executeUnpause: (\n input: ExecuteUnpauseAsyncInput,\n ) => ReturnType<typeof getExecuteUnpauseInstructionAsync> &\n SelfPlanAndSendFunctions;\n finalizeDispute: (\n input: FinalizeDisputeInput,\n ) => ReturnType<typeof getFinalizeDisputeInstruction> &\n SelfPlanAndSendFunctions;\n finalizeRound: (\n input: FinalizeRoundInput,\n ) => ReturnType<typeof getFinalizeRoundInstruction> &\n SelfPlanAndSendFunctions;\n getRuling: (\n input: GetRulingInput,\n ) => ReturnType<typeof getGetRulingInstruction> & SelfPlanAndSendFunctions;\n health: (\n input: HealthInput,\n ) => ReturnType<typeof getHealthInstruction> & SelfPlanAndSendFunctions;\n initializePause: (\n input: InitializePauseAsyncInput,\n ) => ReturnType<typeof getInitializePauseInstructionAsync> &\n SelfPlanAndSendFunctions;\n pause: (\n input: PauseAsyncInput,\n ) => ReturnType<typeof getPauseInstructionAsync> & SelfPlanAndSendFunctions;\n proposeSubaccordUpdate: (\n input: ProposeSubaccordUpdateAsyncInput,\n ) => ReturnType<typeof getProposeSubaccordUpdateInstructionAsync> &\n SelfPlanAndSendFunctions;\n proposeUnpause: (\n input: ProposeUnpauseAsyncInput,\n ) => ReturnType<typeof getProposeUnpauseInstructionAsync> &\n SelfPlanAndSendFunctions;\n pruneJuror: (\n input: PruneJurorAsyncInput,\n ) => ReturnType<typeof getPruneJurorInstructionAsync> &\n SelfPlanAndSendFunctions;\n reclaimSlot: (\n input: ReclaimSlotInput,\n ) => ReturnType<typeof getReclaimSlotInstruction> & SelfPlanAndSendFunctions;\n reconcileStake: (\n input: ReconcileStakeInput,\n ) => ReturnType<typeof getReconcileStakeInstruction> &\n SelfPlanAndSendFunctions;\n redraw: (\n input: RedrawAsyncInput,\n ) => ReturnType<typeof getRedrawInstructionAsync> & SelfPlanAndSendFunctions;\n requestVrf: (\n input: RequestVrfAsyncInput,\n ) => ReturnType<typeof getRequestVrfInstructionAsync> &\n SelfPlanAndSendFunctions;\n requestWithdraw: (\n input: RequestWithdrawAsyncInput,\n ) => ReturnType<typeof getRequestWithdrawInstructionAsync> &\n SelfPlanAndSendFunctions;\n reveal: (\n input: RevealInput,\n ) => ReturnType<typeof getRevealInstruction> & SelfPlanAndSendFunctions;\n settleRound: (\n input: SettleRoundAsyncInput,\n ) => ReturnType<typeof getSettleRoundInstructionAsync> &\n SelfPlanAndSendFunctions;\n stake: (\n input: StakeAsyncInput,\n ) => ReturnType<typeof getStakeInstructionAsync> & SelfPlanAndSendFunctions;\n withdraw: (\n input: WithdrawAsyncInput,\n ) => ReturnType<typeof getWithdrawInstructionAsync> &\n SelfPlanAndSendFunctions;\n withdrawFees: (\n input: WithdrawFeesAsyncInput,\n ) => ReturnType<typeof getWithdrawFeesInstructionAsync> &\n SelfPlanAndSendFunctions;\n};\n\nexport type AccordPluginPdas = {\n accordState: typeof findAccordStatePda;\n appealBond: typeof findAppealBondPda;\n dispute: typeof findDisputePda;\n subaccord: typeof findSubaccordPda;\n pendingUpdate: typeof findPendingUpdatePda;\n jurorStake: typeof findJurorStakePda;\n programIdentity: typeof findProgramIdentityPda;\n round: typeof findRoundPda;\n};\n\nexport type AccordPluginRequirements = ClientWithRpc<\n GetAccountInfoApi & GetMultipleAccountsApi\n> &\n ClientWithTransactionPlanning &\n ClientWithTransactionSending;\n\nexport function accordProgram() {\n return <T extends AccordPluginRequirements>(\n client: T,\n ): ExtendedClient<T, { accord: AccordPlugin }> => {\n return extendClient(client, {\n accord: <AccordPlugin>{\n accounts: {\n accordState: addSelfFetchFunctions(client, getAccordStateCodec()),\n appealBond: addSelfFetchFunctions(client, getAppealBondCodec()),\n dispute: addSelfFetchFunctions(client, getDisputeCodec()),\n jurorStake: addSelfFetchFunctions(client, getJurorStakeCodec()),\n pendingUpdate: addSelfFetchFunctions(client, getPendingUpdateCodec()),\n round: addSelfFetchFunctions(client, getRoundCodec()),\n subaccord: addSelfFetchFunctions(client, getSubaccordCodec()),\n },\n instructions: {\n appeal: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getAppealInstructionAsync(input),\n ),\n cancelDispute: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getCancelDisputeInstructionAsync(input),\n ),\n claimAppealRefund: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getClaimAppealRefundInstructionAsync(input),\n ),\n commit: (input) =>\n addSelfPlanAndSendFunctions(client, getCommitInstruction(input)),\n commitVrfCallback: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getCommitVrfCallbackInstruction(input),\n ),\n createDispute: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getCreateDisputeInstructionAsync(input),\n ),\n createSubaccord: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getCreateSubaccordInstructionAsync(input),\n ),\n drawSeat: (input) =>\n addSelfPlanAndSendFunctions(client, getDrawSeatInstruction(input)),\n executeSubaccordUpdate: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getExecuteSubaccordUpdateInstruction(input),\n ),\n executeUnpause: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getExecuteUnpauseInstructionAsync(input),\n ),\n finalizeDispute: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getFinalizeDisputeInstruction(input),\n ),\n finalizeRound: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getFinalizeRoundInstruction(input),\n ),\n getRuling: (input) =>\n addSelfPlanAndSendFunctions(client, getGetRulingInstruction(input)),\n health: (input) =>\n addSelfPlanAndSendFunctions(client, getHealthInstruction(input)),\n initializePause: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getInitializePauseInstructionAsync(input),\n ),\n pause: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getPauseInstructionAsync(input),\n ),\n proposeSubaccordUpdate: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getProposeSubaccordUpdateInstructionAsync(input),\n ),\n proposeUnpause: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getProposeUnpauseInstructionAsync(input),\n ),\n pruneJuror: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getPruneJurorInstructionAsync(input),\n ),\n reclaimSlot: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getReclaimSlotInstruction(input),\n ),\n reconcileStake: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getReconcileStakeInstruction(input),\n ),\n redraw: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getRedrawInstructionAsync(input),\n ),\n requestVrf: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getRequestVrfInstructionAsync(input),\n ),\n requestWithdraw: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getRequestWithdrawInstructionAsync(input),\n ),\n reveal: (input) =>\n addSelfPlanAndSendFunctions(client, getRevealInstruction(input)),\n settleRound: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getSettleRoundInstructionAsync(input),\n ),\n stake: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getStakeInstructionAsync(input),\n ),\n withdraw: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getWithdrawInstructionAsync(input),\n ),\n withdrawFees: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getWithdrawFeesInstructionAsync(input),\n ),\n },\n pdas: {\n accordState: findAccordStatePda,\n appealBond: findAppealBondPda,\n dispute: findDisputePda,\n subaccord: findSubaccordPda,\n pendingUpdate: findPendingUpdatePda,\n jurorStake: findJurorStakePda,\n programIdentity: findProgramIdentityPda,\n round: findRoundPda,\n },\n identifyAccount: identifyAccordAccount,\n identifyInstruction: identifyAccordInstruction,\n parseInstruction: parseAccordInstruction,\n },\n });\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n assertAccountExists,\n assertAccountsExist,\n combineCodec,\n decodeAccount,\n fetchEncodedAccount,\n fetchEncodedAccounts,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getBooleanDecoder,\n getBooleanEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getOptionDecoder,\n getOptionEncoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n transformEncoder,\n type Account,\n type Address,\n type Codec,\n type Decoder,\n type EncodedAccount,\n type Encoder,\n type FetchAccountConfig,\n type FetchAccountsConfig,\n type MaybeAccount,\n type MaybeEncodedAccount,\n type Option,\n type OptionOrNullable,\n type ReadonlyUint8Array,\n} from \"@solana/kit\";\n\nexport const ACCORD_STATE_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 218, 6, 196, 225, 25, 89, 50, 183,\n]);\n\nexport function getAccordStateDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n ACCORD_STATE_DISCRIMINATOR,\n );\n}\n\nexport type AccordState = {\n discriminator: ReadonlyUint8Array;\n /** The multisig/upgrade-authority permitted to pause and propose unpause. */\n authority: Address;\n paused: boolean;\n /**\n * `Some(slot)` once `propose_unpause` has armed an unpause; cleared on\n * `execute_unpause` (or on a fresh `pause`).\n */\n pendingUnpauseAfter: Option<bigint>;\n bump: number;\n /**\n * Reserved tail space for future field extensions. Zeroed at `init`;\n * must stay the last field — new fields are carved out of it without\n * moving existing offsets or resizing the account.\n */\n padding: ReadonlyUint8Array;\n};\n\nexport type AccordStateArgs = {\n /** The multisig/upgrade-authority permitted to pause and propose unpause. */\n authority: Address;\n paused: boolean;\n /**\n * `Some(slot)` once `propose_unpause` has armed an unpause; cleared on\n * `execute_unpause` (or on a fresh `pause`).\n */\n pendingUnpauseAfter: OptionOrNullable<number | bigint>;\n bump: number;\n /**\n * Reserved tail space for future field extensions. Zeroed at `init`;\n * must stay the last field — new fields are carved out of it without\n * moving existing offsets or resizing the account.\n */\n padding: ReadonlyUint8Array;\n};\n\n/** Gets the encoder for {@link AccordStateArgs} account data. */\nexport function getAccordStateEncoder(): Encoder<AccordStateArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"authority\", getAddressEncoder()],\n [\"paused\", getBooleanEncoder()],\n [\"pendingUnpauseAfter\", getOptionEncoder(getU64Encoder())],\n [\"bump\", getU8Encoder()],\n [\"padding\", fixEncoderSize(getBytesEncoder(), 64)],\n ]),\n (value) => ({ ...value, discriminator: ACCORD_STATE_DISCRIMINATOR }),\n );\n}\n\n/** Gets the decoder for {@link AccordState} account data. */\nexport function getAccordStateDecoder(): Decoder<AccordState> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"authority\", getAddressDecoder()],\n [\"paused\", getBooleanDecoder()],\n [\"pendingUnpauseAfter\", getOptionDecoder(getU64Decoder())],\n [\"bump\", getU8Decoder()],\n [\"padding\", fixDecoderSize(getBytesDecoder(), 64)],\n ]);\n}\n\n/** Gets the codec for {@link AccordState} account data. */\nexport function getAccordStateCodec(): Codec<AccordStateArgs, AccordState> {\n return combineCodec(getAccordStateEncoder(), getAccordStateDecoder());\n}\n\nexport function decodeAccordState<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress>,\n): Account<AccordState, TAddress>;\nexport function decodeAccordState<TAddress extends string = string>(\n encodedAccount: MaybeEncodedAccount<TAddress>,\n): MaybeAccount<AccordState, TAddress>;\nexport function decodeAccordState<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress> | MaybeEncodedAccount<TAddress>,\n): Account<AccordState, TAddress> | MaybeAccount<AccordState, TAddress> {\n return decodeAccount(\n encodedAccount as MaybeEncodedAccount<TAddress>,\n getAccordStateDecoder(),\n );\n}\n\nexport async function fetchAccordState<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<Account<AccordState, TAddress>> {\n const maybeAccount = await fetchMaybeAccordState(rpc, address, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeAccordState<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<MaybeAccount<AccordState, TAddress>> {\n const maybeAccount = await fetchEncodedAccount(rpc, address, config);\n return decodeAccordState(maybeAccount);\n}\n\nexport async function fetchAllAccordState(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<Account<AccordState>[]> {\n const maybeAccounts = await fetchAllMaybeAccordState(rpc, addresses, config);\n assertAccountsExist(maybeAccounts);\n return maybeAccounts;\n}\n\nexport async function fetchAllMaybeAccordState(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<MaybeAccount<AccordState>[]> {\n const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n return maybeAccounts.map((maybeAccount) => decodeAccordState(maybeAccount));\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n assertAccountExists,\n assertAccountsExist,\n combineCodec,\n decodeAccount,\n fetchEncodedAccount,\n fetchEncodedAccounts,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n getU32Decoder,\n getU32Encoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n transformEncoder,\n type Account,\n type Address,\n type EncodedAccount,\n type FetchAccountConfig,\n type FetchAccountsConfig,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type MaybeAccount,\n type MaybeEncodedAccount,\n type ReadonlyUint8Array,\n} from \"@solana/kit\";\n\nexport const APPEAL_BOND_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 84, 79, 238, 7, 49, 113, 35, 143,\n]);\n\nexport function getAppealBondDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(APPEAL_BOND_DISCRIMINATOR);\n}\n\nexport type AppealBond = {\n discriminator: ReadonlyUint8Array;\n dispute: Address;\n roundIdx: number;\n appellant: Address;\n amount: bigint;\n /**\n * Winning value of the round being appealed (set at `appeal` time).\n * Option index for `Plurality`, median for `Median` (u64 since ADR-0025).\n */\n priorResult: bigint;\n bump: number;\n /**\n * Reserved tail space for future field extensions. Zeroed at `init`;\n * must stay the last field — new fields are carved out of it without\n * moving existing offsets or resizing the account.\n */\n padding: ReadonlyUint8Array;\n};\n\nexport type AppealBondArgs = {\n dispute: Address;\n roundIdx: number;\n appellant: Address;\n amount: number | bigint;\n /**\n * Winning value of the round being appealed (set at `appeal` time).\n * Option index for `Plurality`, median for `Median` (u64 since ADR-0025).\n */\n priorResult: number | bigint;\n bump: number;\n /**\n * Reserved tail space for future field extensions. Zeroed at `init`;\n * must stay the last field — new fields are carved out of it without\n * moving existing offsets or resizing the account.\n */\n padding: ReadonlyUint8Array;\n};\n\n/** Gets the encoder for {@link AppealBondArgs} account data. */\nexport function getAppealBondEncoder(): FixedSizeEncoder<AppealBondArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"dispute\", getAddressEncoder()],\n [\"roundIdx\", getU32Encoder()],\n [\"appellant\", getAddressEncoder()],\n [\"amount\", getU64Encoder()],\n [\"priorResult\", getU64Encoder()],\n [\"bump\", getU8Encoder()],\n [\"padding\", fixEncoderSize(getBytesEncoder(), 64)],\n ]),\n (value) => ({ ...value, discriminator: APPEAL_BOND_DISCRIMINATOR }),\n );\n}\n\n/** Gets the decoder for {@link AppealBond} account data. */\nexport function getAppealBondDecoder(): FixedSizeDecoder<AppealBond> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"dispute\", getAddressDecoder()],\n [\"roundIdx\", getU32Decoder()],\n [\"appellant\", getAddressDecoder()],\n [\"amount\", getU64Decoder()],\n [\"priorResult\", getU64Decoder()],\n [\"bump\", getU8Decoder()],\n [\"padding\", fixDecoderSize(getBytesDecoder(), 64)],\n ]);\n}\n\n/** Gets the codec for {@link AppealBond} account data. */\nexport function getAppealBondCodec(): FixedSizeCodec<\n AppealBondArgs,\n AppealBond\n> {\n return combineCodec(getAppealBondEncoder(), getAppealBondDecoder());\n}\n\nexport function decodeAppealBond<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress>,\n): Account<AppealBond, TAddress>;\nexport function decodeAppealBond<TAddress extends string = string>(\n encodedAccount: MaybeEncodedAccount<TAddress>,\n): MaybeAccount<AppealBond, TAddress>;\nexport function decodeAppealBond<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress> | MaybeEncodedAccount<TAddress>,\n): Account<AppealBond, TAddress> | MaybeAccount<AppealBond, TAddress> {\n return decodeAccount(\n encodedAccount as MaybeEncodedAccount<TAddress>,\n getAppealBondDecoder(),\n );\n}\n\nexport async function fetchAppealBond<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<Account<AppealBond, TAddress>> {\n const maybeAccount = await fetchMaybeAppealBond(rpc, address, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeAppealBond<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<MaybeAccount<AppealBond, TAddress>> {\n const maybeAccount = await fetchEncodedAccount(rpc, address, config);\n return decodeAppealBond(maybeAccount);\n}\n\nexport async function fetchAllAppealBond(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<Account<AppealBond>[]> {\n const maybeAccounts = await fetchAllMaybeAppealBond(rpc, addresses, config);\n assertAccountsExist(maybeAccounts);\n return maybeAccounts;\n}\n\nexport async function fetchAllMaybeAppealBond(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<MaybeAccount<AppealBond>[]> {\n const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n return maybeAccounts.map((maybeAccount) => decodeAppealBond(maybeAccount));\n}\n\nexport function getAppealBondSize(): number {\n return 157;\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n assertAccountExists,\n assertAccountsExist,\n combineCodec,\n decodeAccount,\n fetchEncodedAccount,\n fetchEncodedAccounts,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getArrayDecoder,\n getArrayEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getI64Decoder,\n getI64Encoder,\n getOptionDecoder,\n getOptionEncoder,\n getStructDecoder,\n getStructEncoder,\n getU32Decoder,\n getU32Encoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n transformEncoder,\n type Account,\n type Address,\n type Codec,\n type Decoder,\n type EncodedAccount,\n type Encoder,\n type FetchAccountConfig,\n type FetchAccountsConfig,\n type MaybeAccount,\n type MaybeEncodedAccount,\n type Option,\n type OptionOrNullable,\n type ReadonlyUint8Array,\n} from \"@solana/kit\";\nimport {\n getCaseTermsDecoder,\n getCaseTermsEncoder,\n getDisputeStateDecoder,\n getDisputeStateEncoder,\n type CaseTerms,\n type CaseTermsArgs,\n type DisputeState,\n type DisputeStateArgs,\n} from \"../types\";\n\nexport const DISPUTE_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 36, 49, 241, 67, 40, 36, 241, 74,\n]);\n\nexport function getDisputeDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(DISPUTE_DISCRIMINATOR);\n}\n\nexport type Dispute = {\n discriminator: ReadonlyUint8Array;\n subaccord: Address;\n filer: Address;\n nonce: bigint;\n numOptions: number;\n options: Array<ReadonlyUint8Array>;\n /**\n * Per-round evidence commitments (ADR-0006 / milestone accord-qp7c).\n * Index 0 = round-0 (filing); each appeal round may optionally bring new\n * evidence at `[current_round + 1]`. `[0u8; 32]` sentinel = no new\n * evidence that round (jurors reuse prior rounds').\n */\n evidenceHashes: Array<ReadonlyUint8Array>;\n state: DisputeState;\n currentRound: number;\n /**\n * Filing-time snapshot of the Subaccord's economics (Ugly 6). Immutable\n * for the dispute's life; governance changes via ADR-0005 affect only\n * disputes filed after the change lands.\n */\n terms: CaseTerms;\n /**\n * The round's winning value once `state == Final`; `u64::MAX` until\n * then. For `Plurality` disputes this is the winning option index; for\n * `Median` disputes (ADR-0025) it is the final median — a u64\n * fixed-point value the Arbitrable interprets (e.g. base units of the\n * settlement mint, 6 decimals for USDC). Sentinel (not `Option<u64>`):\n * keeps the account fixed-size — the SBF `InitSpace` for `Option<T>`\n * undercounts its `Some` variant by the option tag, which made\n * `finalize_dispute`'s `Some` write overflow the account (Anchor\n * `AccountDidNotSerialize` #3004). Mirrors `Round`'s u64::MAX sentinels\n * for `reveals`/`result`.\n */\n finalRuling: bigint;\n /**\n * Unix timestamp stamped at the single `Final` transition\n * (`finalize_dispute`); `0` until then. Canonical \"verdict time\" anchor\n * for downstream consumers (e.g. the Betline primitive's bettor reveal\n * window, which must open exactly when the dispute finalizes). `0` is a\n * safe sentinel: real Unix time is never 0 for on-chain disputes.\n */\n finalizedAt: bigint;\n /**\n * Round-0 filing fee deposited by the filer (`N · fee_per_juror` at\n * creation). Decremented as round-0 jurors earn (`finalize_round`). This\n * is the filer's refundable pool on cancel/redraw-exhaustion. Appeal-round\n * fees live in their `AppealBond`, NOT here (bean accord-xftx).\n */\n feePaid: bigint;\n /**\n * VRF result committed once via `commit_vrf` (ADR-0009). `None` until\n * committed; `Some(vrf_result)` after. The draw reads this; the caller\n * cannot swap it between retries.\n */\n committedVrf: Option<ReadonlyUint8Array>;\n /**\n * Accumulator root frozen atomically when the VRF lands in\n * `commit_vrf_callback` (ADR-0012). All `draw_seat` calls for every round\n * of this dispute select against this one root (per-seat coherence +\n * manipulation resistance). `[0;32]` until frozen; readable once\n * `committed_vrf.is_some()`.\n */\n frozenRoot: ReadonlyUint8Array;\n /**\n * Total stake captured with `frozen_root` at freeze time. Drives\n * sortition (`r_i % frozen_total_stake`).\n */\n frozenTotalStake: bigint;\n /**\n * Unix timestamp at `create_dispute` (Ugly 4). Drives the pre-draw\n * `cancel_dispute` timeout: if the dispute has not been drawn within\n * `PRE_DRAW_CANCEL_TIMEOUT_SECS`, any cranker may cancel + refund the filer.\n */\n filedAt: bigint;\n bump: number;\n /**\n * Seats landed for the CURRENT round so far (H-2, security review\n * 2026-08-19). Maintained by `draw_seat` (mirrors `round.juror_count`\n * after each seat) and reset to 0 by `appeal` (fresh round) and the\n * `redraw` clear. It is the on-chain PROOF that a partially drawn Round\n * account exists while the dispute still sits in `Created` — without it,\n * `cancel_dispute`'s pre-draw branch cannot tell \"no seats drawn\" (no\n * Round PDA exists, nothing to pass) from \"cranker omitted the accounts\"\n * (jurors strand), so it cannot safely require them. Carved out of the\n * former padding: account size and all prior field offsets unchanged.\n */\n drawnSeats: number;\n /**\n * Reserved tail space for future field extensions. Zeroed at `init`;\n * must stay the last field — new fields are carved out of it without\n * moving existing offsets or resizing the account.\n */\n padding: ReadonlyUint8Array;\n};\n\nexport type DisputeArgs = {\n subaccord: Address;\n filer: Address;\n nonce: number | bigint;\n numOptions: number;\n options: Array<ReadonlyUint8Array>;\n /**\n * Per-round evidence commitments (ADR-0006 / milestone accord-qp7c).\n * Index 0 = round-0 (filing); each appeal round may optionally bring new\n * evidence at `[current_round + 1]`. `[0u8; 32]` sentinel = no new\n * evidence that round (jurors reuse prior rounds').\n */\n evidenceHashes: Array<ReadonlyUint8Array>;\n state: DisputeStateArgs;\n currentRound: number;\n /**\n * Filing-time snapshot of the Subaccord's economics (Ugly 6). Immutable\n * for the dispute's life; governance changes via ADR-0005 affect only\n * disputes filed after the change lands.\n */\n terms: CaseTermsArgs;\n /**\n * The round's winning value once `state == Final`; `u64::MAX` until\n * then. For `Plurality` disputes this is the winning option index; for\n * `Median` disputes (ADR-0025) it is the final median — a u64\n * fixed-point value the Arbitrable interprets (e.g. base units of the\n * settlement mint, 6 decimals for USDC). Sentinel (not `Option<u64>`):\n * keeps the account fixed-size — the SBF `InitSpace` for `Option<T>`\n * undercounts its `Some` variant by the option tag, which made\n * `finalize_dispute`'s `Some` write overflow the account (Anchor\n * `AccountDidNotSerialize` #3004). Mirrors `Round`'s u64::MAX sentinels\n * for `reveals`/`result`.\n */\n finalRuling: number | bigint;\n /**\n * Unix timestamp stamped at the single `Final` transition\n * (`finalize_dispute`); `0` until then. Canonical \"verdict time\" anchor\n * for downstream consumers (e.g. the Betline primitive's bettor reveal\n * window, which must open exactly when the dispute finalizes). `0` is a\n * safe sentinel: real Unix time is never 0 for on-chain disputes.\n */\n finalizedAt: number | bigint;\n /**\n * Round-0 filing fee deposited by the filer (`N · fee_per_juror` at\n * creation). Decremented as round-0 jurors earn (`finalize_round`). This\n * is the filer's refundable pool on cancel/redraw-exhaustion. Appeal-round\n * fees live in their `AppealBond`, NOT here (bean accord-xftx).\n */\n feePaid: number | bigint;\n /**\n * VRF result committed once via `commit_vrf` (ADR-0009). `None` until\n * committed; `Some(vrf_result)` after. The draw reads this; the caller\n * cannot swap it between retries.\n */\n committedVrf: OptionOrNullable<ReadonlyUint8Array>;\n /**\n * Accumulator root frozen atomically when the VRF lands in\n * `commit_vrf_callback` (ADR-0012). All `draw_seat` calls for every round\n * of this dispute select against this one root (per-seat coherence +\n * manipulation resistance). `[0;32]` until frozen; readable once\n * `committed_vrf.is_some()`.\n */\n frozenRoot: ReadonlyUint8Array;\n /**\n * Total stake captured with `frozen_root` at freeze time. Drives\n * sortition (`r_i % frozen_total_stake`).\n */\n frozenTotalStake: number | bigint;\n /**\n * Unix timestamp at `create_dispute` (Ugly 4). Drives the pre-draw\n * `cancel_dispute` timeout: if the dispute has not been drawn within\n * `PRE_DRAW_CANCEL_TIMEOUT_SECS`, any cranker may cancel + refund the filer.\n */\n filedAt: number | bigint;\n bump: number;\n /**\n * Seats landed for the CURRENT round so far (H-2, security review\n * 2026-08-19). Maintained by `draw_seat` (mirrors `round.juror_count`\n * after each seat) and reset to 0 by `appeal` (fresh round) and the\n * `redraw` clear. It is the on-chain PROOF that a partially drawn Round\n * account exists while the dispute still sits in `Created` — without it,\n * `cancel_dispute`'s pre-draw branch cannot tell \"no seats drawn\" (no\n * Round PDA exists, nothing to pass) from \"cranker omitted the accounts\"\n * (jurors strand), so it cannot safely require them. Carved out of the\n * former padding: account size and all prior field offsets unchanged.\n */\n drawnSeats: number;\n /**\n * Reserved tail space for future field extensions. Zeroed at `init`;\n * must stay the last field — new fields are carved out of it without\n * moving existing offsets or resizing the account.\n */\n padding: ReadonlyUint8Array;\n};\n\n/** Gets the encoder for {@link DisputeArgs} account data. */\nexport function getDisputeEncoder(): Encoder<DisputeArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"subaccord\", getAddressEncoder()],\n [\"filer\", getAddressEncoder()],\n [\"nonce\", getU64Encoder()],\n [\"numOptions\", getU8Encoder()],\n [\n \"options\",\n getArrayEncoder(fixEncoderSize(getBytesEncoder(), 32), { size: 8 }),\n ],\n [\n \"evidenceHashes\",\n getArrayEncoder(fixEncoderSize(getBytesEncoder(), 32), { size: 4 }),\n ],\n [\"state\", getDisputeStateEncoder()],\n [\"currentRound\", getU32Encoder()],\n [\"terms\", getCaseTermsEncoder()],\n [\"finalRuling\", getU64Encoder()],\n [\"finalizedAt\", getI64Encoder()],\n [\"feePaid\", getU64Encoder()],\n [\"committedVrf\", getOptionEncoder(fixEncoderSize(getBytesEncoder(), 32))],\n [\"frozenRoot\", fixEncoderSize(getBytesEncoder(), 32)],\n [\"frozenTotalStake\", getU64Encoder()],\n [\"filedAt\", getI64Encoder()],\n [\"bump\", getU8Encoder()],\n [\"drawnSeats\", getU32Encoder()],\n [\"padding\", fixEncoderSize(getBytesEncoder(), 60)],\n ]),\n (value) => ({ ...value, discriminator: DISPUTE_DISCRIMINATOR }),\n );\n}\n\n/** Gets the decoder for {@link Dispute} account data. */\nexport function getDisputeDecoder(): Decoder<Dispute> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"subaccord\", getAddressDecoder()],\n [\"filer\", getAddressDecoder()],\n [\"nonce\", getU64Decoder()],\n [\"numOptions\", getU8Decoder()],\n [\n \"options\",\n getArrayDecoder(fixDecoderSize(getBytesDecoder(), 32), { size: 8 }),\n ],\n [\n \"evidenceHashes\",\n getArrayDecoder(fixDecoderSize(getBytesDecoder(), 32), { size: 4 }),\n ],\n [\"state\", getDisputeStateDecoder()],\n [\"currentRound\", getU32Decoder()],\n [\"terms\", getCaseTermsDecoder()],\n [\"finalRuling\", getU64Decoder()],\n [\"finalizedAt\", getI64Decoder()],\n [\"feePaid\", getU64Decoder()],\n [\"committedVrf\", getOptionDecoder(fixDecoderSize(getBytesDecoder(), 32))],\n [\"frozenRoot\", fixDecoderSize(getBytesDecoder(), 32)],\n [\"frozenTotalStake\", getU64Decoder()],\n [\"filedAt\", getI64Decoder()],\n [\"bump\", getU8Decoder()],\n [\"drawnSeats\", getU32Decoder()],\n [\"padding\", fixDecoderSize(getBytesDecoder(), 60)],\n ]);\n}\n\n/** Gets the codec for {@link Dispute} account data. */\nexport function getDisputeCodec(): Codec<DisputeArgs, Dispute> {\n return combineCodec(getDisputeEncoder(), getDisputeDecoder());\n}\n\nexport function decodeDispute<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress>,\n): Account<Dispute, TAddress>;\nexport function decodeDispute<TAddress extends string = string>(\n encodedAccount: MaybeEncodedAccount<TAddress>,\n): MaybeAccount<Dispute, TAddress>;\nexport function decodeDispute<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress> | MaybeEncodedAccount<TAddress>,\n): Account<Dispute, TAddress> | MaybeAccount<Dispute, TAddress> {\n return decodeAccount(\n encodedAccount as MaybeEncodedAccount<TAddress>,\n getDisputeDecoder(),\n );\n}\n\nexport async function fetchDispute<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<Account<Dispute, TAddress>> {\n const maybeAccount = await fetchMaybeDispute(rpc, address, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeDispute<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<MaybeAccount<Dispute, TAddress>> {\n const maybeAccount = await fetchEncodedAccount(rpc, address, config);\n return decodeDispute(maybeAccount);\n}\n\nexport async function fetchAllDispute(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<Account<Dispute>[]> {\n const maybeAccounts = await fetchAllMaybeDispute(rpc, addresses, config);\n assertAccountsExist(maybeAccounts);\n return maybeAccounts;\n}\n\nexport async function fetchAllMaybeDispute(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<MaybeAccount<Dispute>[]> {\n const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n return maybeAccounts.map((maybeAccount) => decodeDispute(maybeAccount));\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n getEnumDecoder,\n getEnumEncoder,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n} from \"@solana/kit\";\n\n/**\n * Dispute-kit aggregation rule (ADR-0019). `Plurality` counts option-index\n * votes; `Median` (ADR-0025) tallies scalar u64 votes by median. The rule\n * is frozen onto `CaseTerms` at filing time and `finalize_round` tallies off\n * it (`match dispute.terms.aggregation`). The match carries no wildcard arm,\n * so adding a variant is a compile error until its tally arm lands — the\n * extension seam is real and machine-checked, not aspirational.\n */\nexport enum Aggregation {\n Plurality,\n Median,\n}\n\nexport type AggregationArgs = Aggregation;\n\nexport function getAggregationEncoder(): FixedSizeEncoder<AggregationArgs> {\n return getEnumEncoder(Aggregation);\n}\n\nexport function getAggregationDecoder(): FixedSizeDecoder<Aggregation> {\n return getEnumDecoder(Aggregation);\n}\n\nexport function getAggregationCodec(): FixedSizeCodec<\n AggregationArgs,\n Aggregation\n> {\n return combineCodec(getAggregationEncoder(), getAggregationDecoder());\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n getStructDecoder,\n getStructEncoder,\n getU16Decoder,\n getU16Encoder,\n getU32Decoder,\n getU32Encoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n} from \"@solana/kit\";\nimport {\n getAggregationDecoder,\n getAggregationEncoder,\n getShortfallPolicyDecoder,\n getShortfallPolicyEncoder,\n type Aggregation,\n type AggregationArgs,\n type ShortfallPolicy,\n type ShortfallPolicyArgs,\n} from \".\";\n\n/**\n * Economics-relevant Subaccord params **frozen at `create_dispute` time**\n * (CONCEPT-REVIEW Ugly 6 / bean accord-4e7p). Every post-filing instruction\n * (`post_snapshot`, `draw`, `finalize_dispute`, `appeal`) reads this frozen\n * copy, never the live `Subaccord`. The 48h timelock (ADR-0005) then governs\n * only FUTURE disputes; an active case is immune to governance changes for\n * its entire life. This is the arbitration-contract principle: parties cannot\n * consent to a process whose economically load-bearing rules may shift\n * ex-post.\n */\nexport type CaseTerms = {\n alphaBps: number;\n minStake: bigint;\n feePerJuror: bigint;\n reviewWindow: bigint;\n commitWindow: bigint;\n revealWindow: bigint;\n /** Appeal window (ADR-0022). Per-Subaccord, frozen at filing. */\n appealWindow: bigint;\n maxAppeals: number;\n /**\n * Frozen round-1 panel size (accord-9q3e). Mirrors `Subaccord.min_jury_size`\n * at filing time; drives `panel_size_for_round` for every round of this dispute.\n */\n minJurySize: number;\n aggregation: Aggregation;\n /**\n * Frozen reveal-quorum fraction (ADR-0021). Mirrors\n * `Subaccord.reveal_threshold_bps` at filing time.\n */\n revealThresholdBps: number;\n /** Frozen shortfall policy (ADR-0021). */\n shortfallPolicy: ShortfallPolicy;\n /** Frozen redraw cap (ADR-0021). */\n maxDrawAttempts: number;\n /**\n * Frozen coherence tolerance (ADR-0025). Mirrors\n * `Subaccord.coherence_tol_bps` at filing time; read only on the\n * `Median` path by `settle_round_accounts`.\n */\n coherenceTolBps: number;\n};\n\nexport type CaseTermsArgs = {\n alphaBps: number;\n minStake: number | bigint;\n feePerJuror: number | bigint;\n reviewWindow: number | bigint;\n commitWindow: number | bigint;\n revealWindow: number | bigint;\n /** Appeal window (ADR-0022). Per-Subaccord, frozen at filing. */\n appealWindow: number | bigint;\n maxAppeals: number;\n /**\n * Frozen round-1 panel size (accord-9q3e). Mirrors `Subaccord.min_jury_size`\n * at filing time; drives `panel_size_for_round` for every round of this dispute.\n */\n minJurySize: number;\n aggregation: AggregationArgs;\n /**\n * Frozen reveal-quorum fraction (ADR-0021). Mirrors\n * `Subaccord.reveal_threshold_bps` at filing time.\n */\n revealThresholdBps: number;\n /** Frozen shortfall policy (ADR-0021). */\n shortfallPolicy: ShortfallPolicyArgs;\n /** Frozen redraw cap (ADR-0021). */\n maxDrawAttempts: number;\n /**\n * Frozen coherence tolerance (ADR-0025). Mirrors\n * `Subaccord.coherence_tol_bps` at filing time; read only on the\n * `Median` path by `settle_round_accounts`.\n */\n coherenceTolBps: number;\n};\n\nexport function getCaseTermsEncoder(): FixedSizeEncoder<CaseTermsArgs> {\n return getStructEncoder([\n [\"alphaBps\", getU16Encoder()],\n [\"minStake\", getU64Encoder()],\n [\"feePerJuror\", getU64Encoder()],\n [\"reviewWindow\", getU64Encoder()],\n [\"commitWindow\", getU64Encoder()],\n [\"revealWindow\", getU64Encoder()],\n [\"appealWindow\", getU64Encoder()],\n [\"maxAppeals\", getU8Encoder()],\n [\"minJurySize\", getU32Encoder()],\n [\"aggregation\", getAggregationEncoder()],\n [\"revealThresholdBps\", getU16Encoder()],\n [\"shortfallPolicy\", getShortfallPolicyEncoder()],\n [\"maxDrawAttempts\", getU8Encoder()],\n [\"coherenceTolBps\", getU16Encoder()],\n ]);\n}\n\nexport function getCaseTermsDecoder(): FixedSizeDecoder<CaseTerms> {\n return getStructDecoder([\n [\"alphaBps\", getU16Decoder()],\n [\"minStake\", getU64Decoder()],\n [\"feePerJuror\", getU64Decoder()],\n [\"reviewWindow\", getU64Decoder()],\n [\"commitWindow\", getU64Decoder()],\n [\"revealWindow\", getU64Decoder()],\n [\"appealWindow\", getU64Decoder()],\n [\"maxAppeals\", getU8Decoder()],\n [\"minJurySize\", getU32Decoder()],\n [\"aggregation\", getAggregationDecoder()],\n [\"revealThresholdBps\", getU16Decoder()],\n [\"shortfallPolicy\", getShortfallPolicyDecoder()],\n [\"maxDrawAttempts\", getU8Decoder()],\n [\"coherenceTolBps\", getU16Decoder()],\n ]);\n}\n\nexport function getCaseTermsCodec(): FixedSizeCodec<CaseTermsArgs, CaseTerms> {\n return combineCodec(getCaseTermsEncoder(), getCaseTermsDecoder());\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n getEnumDecoder,\n getEnumEncoder,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n} from \"@solana/kit\";\n\n/**\n * Dispute lifecycle (SPEC state machine). A permissionless crank advances\n * states when their windows elapse.\n *\n * `Failed` is the liveness-escape terminal state (CONCEPT-REVIEW Ugly 4 /\n * bean accord-18fb): `cancel_dispute` transitions a stalled dispute here,\n * refunds the filer's round-1 fee, and releases the current round's\n * `active_draws`. It is terminal — no lifecycle instruction accepts it.\n */\nexport enum DisputeState {\n Created,\n Drawn,\n Review,\n Commit,\n Reveal,\n RoundResolved,\n Final,\n Closed,\n Failed,\n RedrawEligible,\n}\n\nexport type DisputeStateArgs = DisputeState;\n\nexport function getDisputeStateEncoder(): FixedSizeEncoder<DisputeStateArgs> {\n return getEnumEncoder(DisputeState);\n}\n\nexport function getDisputeStateDecoder(): FixedSizeDecoder<DisputeState> {\n return getEnumDecoder(DisputeState);\n}\n\nexport function getDisputeStateCodec(): FixedSizeCodec<\n DisputeStateArgs,\n DisputeState\n> {\n return combineCodec(getDisputeStateEncoder(), getDisputeStateDecoder());\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n getAddressDecoder,\n getAddressEncoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n} from \"@solana/kit\";\n\n/**\n * A single leaf of the subtree-sum accumulator (ADR-0012). The leaf is hashed\n * as `H(juror || stake_le)`. The cumulative-from-left prefix used for\n * sortition is reconstructed on-chain from the authenticated sibling sums\n * along the proof path (no `cum_after` carried on the leaf — the subtree-sum\n * form makes it derivable, unlike ADR-0009's O(N) cumulative form).\n */\nexport type LeafClaim = { juror: Address; stake: bigint };\n\nexport type LeafClaimArgs = { juror: Address; stake: number | bigint };\n\nexport function getLeafClaimEncoder(): FixedSizeEncoder<LeafClaimArgs> {\n return getStructEncoder([\n [\"juror\", getAddressEncoder()],\n [\"stake\", getU64Encoder()],\n ]);\n}\n\nexport function getLeafClaimDecoder(): FixedSizeDecoder<LeafClaim> {\n return getStructDecoder([\n [\"juror\", getAddressDecoder()],\n [\"stake\", getU64Decoder()],\n ]);\n}\n\nexport function getLeafClaimCodec(): FixedSizeCodec<LeafClaimArgs, LeafClaim> {\n return combineCodec(getLeafClaimEncoder(), getLeafClaimDecoder());\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type ReadonlyUint8Array,\n} from \"@solana/kit\";\n\n/**\n * Merkle-Sum Tree proof element (ADR-0012 subtree-sum form). Each level of the\n * proof carries the sibling subtree's hash AND its stake sum. Sums are bound\n * into every node hash, so stake-weighted ranges are cryptographically\n * authenticated (CONCEPT-REVIEW Bad 5 fixed by construction).\n */\nexport type MSTNode = { siblingHash: ReadonlyUint8Array; siblingSum: bigint };\n\nexport type MSTNodeArgs = {\n siblingHash: ReadonlyUint8Array;\n siblingSum: number | bigint;\n};\n\nexport function getMSTNodeEncoder(): FixedSizeEncoder<MSTNodeArgs> {\n return getStructEncoder([\n [\"siblingHash\", fixEncoderSize(getBytesEncoder(), 32)],\n [\"siblingSum\", getU64Encoder()],\n ]);\n}\n\nexport function getMSTNodeDecoder(): FixedSizeDecoder<MSTNode> {\n return getStructDecoder([\n [\"siblingHash\", fixDecoderSize(getBytesDecoder(), 32)],\n [\"siblingSum\", getU64Decoder()],\n ]);\n}\n\nexport function getMSTNodeCodec(): FixedSizeCodec<MSTNodeArgs, MSTNode> {\n return combineCodec(getMSTNodeEncoder(), getMSTNodeDecoder());\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n getEnumDecoder,\n getEnumEncoder,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n} from \"@solana/kit\";\n\n/**\n * What happens when a round falls short of its reveal quorum (ADR-0021). v1\n * ships a single variant — `Redraw` reconvenes the same-size panel with fresh\n * seats (via an orthogonal `draw_attempt`), slashing the no-shows; after\n * `max_draw_attempts` the dispute transitions to `Failed`. Future variants\n * (e.g. `Fail`) ship as new enum entries.\n */\nexport enum ShortfallPolicy {\n Redraw,\n}\n\nexport type ShortfallPolicyArgs = ShortfallPolicy;\n\nexport function getShortfallPolicyEncoder(): FixedSizeEncoder<ShortfallPolicyArgs> {\n return getEnumEncoder(ShortfallPolicy);\n}\n\nexport function getShortfallPolicyDecoder(): FixedSizeDecoder<ShortfallPolicy> {\n return getEnumDecoder(ShortfallPolicy);\n}\n\nexport function getShortfallPolicyCodec(): FixedSizeCodec<\n ShortfallPolicyArgs,\n ShortfallPolicy\n> {\n return combineCodec(getShortfallPolicyEncoder(), getShortfallPolicyDecoder());\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n getAddressDecoder,\n getAddressEncoder,\n getDiscriminatedUnionDecoder,\n getDiscriminatedUnionEncoder,\n getStructDecoder,\n getStructEncoder,\n getTupleDecoder,\n getTupleEncoder,\n getU16Decoder,\n getU16Encoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n type GetDiscriminatedUnionVariant,\n type GetDiscriminatedUnionVariantContent,\n} from \"@solana/kit\";\n\n/**\n * Tagged Subaccord parameter update. `domain_ref` and `evidence_spec` are\n * immutable and intentionally absent (ADR-0005). Variants are append-only:\n * borsh encodes the variant index, so a new variant MUST be added at the END\n * (ADR-0028) — in-flight `PendingUpdate` accounts deserialize by index.\n */\nexport type UpdatePayload =\n | { __kind: \"MinStake\"; fields: readonly [bigint] }\n | { __kind: \"AlphaBps\"; fields: readonly [number] }\n | { __kind: \"ReviewWindow\"; fields: readonly [bigint] }\n | { __kind: \"CommitWindow\"; fields: readonly [bigint] }\n | { __kind: \"RevealWindow\"; fields: readonly [bigint] }\n | { __kind: \"AppealWindow\"; fields: readonly [bigint] }\n | { __kind: \"MaxAppeals\"; fields: readonly [number] }\n | { __kind: \"FeePerJuror\"; fields: readonly [bigint] }\n | { __kind: \"Authority\"; fields: readonly [Address] }\n | { __kind: \"EvidenceOperator\"; fields: readonly [Address] }\n | { __kind: \"RevealThresholdBps\"; fields: readonly [number] }\n | { __kind: \"MaxDrawAttempts\"; fields: readonly [number] };\n\nexport type UpdatePayloadArgs =\n | { __kind: \"MinStake\"; fields: readonly [number | bigint] }\n | { __kind: \"AlphaBps\"; fields: readonly [number] }\n | { __kind: \"ReviewWindow\"; fields: readonly [number | bigint] }\n | { __kind: \"CommitWindow\"; fields: readonly [number | bigint] }\n | { __kind: \"RevealWindow\"; fields: readonly [number | bigint] }\n | { __kind: \"AppealWindow\"; fields: readonly [number | bigint] }\n | { __kind: \"MaxAppeals\"; fields: readonly [number] }\n | { __kind: \"FeePerJuror\"; fields: readonly [number | bigint] }\n | { __kind: \"Authority\"; fields: readonly [Address] }\n | { __kind: \"EvidenceOperator\"; fields: readonly [Address] }\n | { __kind: \"RevealThresholdBps\"; fields: readonly [number] }\n | { __kind: \"MaxDrawAttempts\"; fields: readonly [number] };\n\nexport function getUpdatePayloadEncoder(): Encoder<UpdatePayloadArgs> {\n return getDiscriminatedUnionEncoder([\n [\n \"MinStake\",\n getStructEncoder([[\"fields\", getTupleEncoder([getU64Encoder()])]]),\n ],\n [\n \"AlphaBps\",\n getStructEncoder([[\"fields\", getTupleEncoder([getU16Encoder()])]]),\n ],\n [\n \"ReviewWindow\",\n getStructEncoder([[\"fields\", getTupleEncoder([getU64Encoder()])]]),\n ],\n [\n \"CommitWindow\",\n getStructEncoder([[\"fields\", getTupleEncoder([getU64Encoder()])]]),\n ],\n [\n \"RevealWindow\",\n getStructEncoder([[\"fields\", getTupleEncoder([getU64Encoder()])]]),\n ],\n [\n \"AppealWindow\",\n getStructEncoder([[\"fields\", getTupleEncoder([getU64Encoder()])]]),\n ],\n [\n \"MaxAppeals\",\n getStructEncoder([[\"fields\", getTupleEncoder([getU8Encoder()])]]),\n ],\n [\n \"FeePerJuror\",\n getStructEncoder([[\"fields\", getTupleEncoder([getU64Encoder()])]]),\n ],\n [\n \"Authority\",\n getStructEncoder([[\"fields\", getTupleEncoder([getAddressEncoder()])]]),\n ],\n [\n \"EvidenceOperator\",\n getStructEncoder([[\"fields\", getTupleEncoder([getAddressEncoder()])]]),\n ],\n [\n \"RevealThresholdBps\",\n getStructEncoder([[\"fields\", getTupleEncoder([getU16Encoder()])]]),\n ],\n [\n \"MaxDrawAttempts\",\n getStructEncoder([[\"fields\", getTupleEncoder([getU8Encoder()])]]),\n ],\n ]);\n}\n\nexport function getUpdatePayloadDecoder(): Decoder<UpdatePayload> {\n return getDiscriminatedUnionDecoder([\n [\n \"MinStake\",\n getStructDecoder([[\"fields\", getTupleDecoder([getU64Decoder()])]]),\n ],\n [\n \"AlphaBps\",\n getStructDecoder([[\"fields\", getTupleDecoder([getU16Decoder()])]]),\n ],\n [\n \"ReviewWindow\",\n getStructDecoder([[\"fields\", getTupleDecoder([getU64Decoder()])]]),\n ],\n [\n \"CommitWindow\",\n getStructDecoder([[\"fields\", getTupleDecoder([getU64Decoder()])]]),\n ],\n [\n \"RevealWindow\",\n getStructDecoder([[\"fields\", getTupleDecoder([getU64Decoder()])]]),\n ],\n [\n \"AppealWindow\",\n getStructDecoder([[\"fields\", getTupleDecoder([getU64Decoder()])]]),\n ],\n [\n \"MaxAppeals\",\n getStructDecoder([[\"fields\", getTupleDecoder([getU8Decoder()])]]),\n ],\n [\n \"FeePerJuror\",\n getStructDecoder([[\"fields\", getTupleDecoder([getU64Decoder()])]]),\n ],\n [\n \"Authority\",\n getStructDecoder([[\"fields\", getTupleDecoder([getAddressDecoder()])]]),\n ],\n [\n \"EvidenceOperator\",\n getStructDecoder([[\"fields\", getTupleDecoder([getAddressDecoder()])]]),\n ],\n [\n \"RevealThresholdBps\",\n getStructDecoder([[\"fields\", getTupleDecoder([getU16Decoder()])]]),\n ],\n [\n \"MaxDrawAttempts\",\n getStructDecoder([[\"fields\", getTupleDecoder([getU8Decoder()])]]),\n ],\n ]);\n}\n\nexport function getUpdatePayloadCodec(): Codec<\n UpdatePayloadArgs,\n UpdatePayload\n> {\n return combineCodec(getUpdatePayloadEncoder(), getUpdatePayloadDecoder());\n}\n\n// Data Enum Helpers.\nexport function updatePayload(\n kind: \"MinStake\",\n data: GetDiscriminatedUnionVariantContent<\n UpdatePayloadArgs,\n \"__kind\",\n \"MinStake\"\n >[\"fields\"],\n): GetDiscriminatedUnionVariant<UpdatePayloadArgs, \"__kind\", \"MinStake\">;\nexport function updatePayload(\n kind: \"AlphaBps\",\n data: GetDiscriminatedUnionVariantContent<\n UpdatePayloadArgs,\n \"__kind\",\n \"AlphaBps\"\n >[\"fields\"],\n): GetDiscriminatedUnionVariant<UpdatePayloadArgs, \"__kind\", \"AlphaBps\">;\nexport function updatePayload(\n kind: \"ReviewWindow\",\n data: GetDiscriminatedUnionVariantContent<\n UpdatePayloadArgs,\n \"__kind\",\n \"ReviewWindow\"\n >[\"fields\"],\n): GetDiscriminatedUnionVariant<UpdatePayloadArgs, \"__kind\", \"ReviewWindow\">;\nexport function updatePayload(\n kind: \"CommitWindow\",\n data: GetDiscriminatedUnionVariantContent<\n UpdatePayloadArgs,\n \"__kind\",\n \"CommitWindow\"\n >[\"fields\"],\n): GetDiscriminatedUnionVariant<UpdatePayloadArgs, \"__kind\", \"CommitWindow\">;\nexport function updatePayload(\n kind: \"RevealWindow\",\n data: GetDiscriminatedUnionVariantContent<\n UpdatePayloadArgs,\n \"__kind\",\n \"RevealWindow\"\n >[\"fields\"],\n): GetDiscriminatedUnionVariant<UpdatePayloadArgs, \"__kind\", \"RevealWindow\">;\nexport function updatePayload(\n kind: \"AppealWindow\",\n data: GetDiscriminatedUnionVariantContent<\n UpdatePayloadArgs,\n \"__kind\",\n \"AppealWindow\"\n >[\"fields\"],\n): GetDiscriminatedUnionVariant<UpdatePayloadArgs, \"__kind\", \"AppealWindow\">;\nexport function updatePayload(\n kind: \"MaxAppeals\",\n data: GetDiscriminatedUnionVariantContent<\n UpdatePayloadArgs,\n \"__kind\",\n \"MaxAppeals\"\n >[\"fields\"],\n): GetDiscriminatedUnionVariant<UpdatePayloadArgs, \"__kind\", \"MaxAppeals\">;\nexport function updatePayload(\n kind: \"FeePerJuror\",\n data: GetDiscriminatedUnionVariantContent<\n UpdatePayloadArgs,\n \"__kind\",\n \"FeePerJuror\"\n >[\"fields\"],\n): GetDiscriminatedUnionVariant<UpdatePayloadArgs, \"__kind\", \"FeePerJuror\">;\nexport function updatePayload(\n kind: \"Authority\",\n data: GetDiscriminatedUnionVariantContent<\n UpdatePayloadArgs,\n \"__kind\",\n \"Authority\"\n >[\"fields\"],\n): GetDiscriminatedUnionVariant<UpdatePayloadArgs, \"__kind\", \"Authority\">;\nexport function updatePayload(\n kind: \"EvidenceOperator\",\n data: GetDiscriminatedUnionVariantContent<\n UpdatePayloadArgs,\n \"__kind\",\n \"EvidenceOperator\"\n >[\"fields\"],\n): GetDiscriminatedUnionVariant<\n UpdatePayloadArgs,\n \"__kind\",\n \"EvidenceOperator\"\n>;\nexport function updatePayload(\n kind: \"RevealThresholdBps\",\n data: GetDiscriminatedUnionVariantContent<\n UpdatePayloadArgs,\n \"__kind\",\n \"RevealThresholdBps\"\n >[\"fields\"],\n): GetDiscriminatedUnionVariant<\n UpdatePayloadArgs,\n \"__kind\",\n \"RevealThresholdBps\"\n>;\nexport function updatePayload(\n kind: \"MaxDrawAttempts\",\n data: GetDiscriminatedUnionVariantContent<\n UpdatePayloadArgs,\n \"__kind\",\n \"MaxDrawAttempts\"\n >[\"fields\"],\n): GetDiscriminatedUnionVariant<UpdatePayloadArgs, \"__kind\", \"MaxDrawAttempts\">;\nexport function updatePayload<K extends UpdatePayloadArgs[\"__kind\"], Data>(\n kind: K,\n data?: Data,\n) {\n return Array.isArray(data)\n ? { __kind: kind, fields: data }\n : { __kind: kind, ...(data ?? {}) };\n}\n\nexport function isUpdatePayload<K extends UpdatePayload[\"__kind\"]>(\n kind: K,\n value: UpdatePayload,\n): value is UpdatePayload & { __kind: K } {\n return value.__kind === kind;\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n assertAccountExists,\n assertAccountsExist,\n combineCodec,\n decodeAccount,\n fetchEncodedAccount,\n fetchEncodedAccounts,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getI64Decoder,\n getI64Encoder,\n getStructDecoder,\n getStructEncoder,\n getU32Decoder,\n getU32Encoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n transformEncoder,\n type Account,\n type Address,\n type EncodedAccount,\n type FetchAccountConfig,\n type FetchAccountsConfig,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type MaybeAccount,\n type MaybeEncodedAccount,\n type ReadonlyUint8Array,\n} from \"@solana/kit\";\n\nexport const JUROR_STAKE_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 139, 114, 205, 73, 247, 175, 133, 122,\n]);\n\nexport function getJurorStakeDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(JUROR_STAKE_DISCRIMINATOR);\n}\n\nexport type JurorStake = {\n discriminator: ReadonlyUint8Array;\n subaccord: Address;\n juror: Address;\n /** Collateral (stake_token). Sortition weight + slash exposure. */\n staked: bigint;\n activeDraws: number;\n bump: number;\n /** Leaf position in the Subaccord accumulator (assigned at first stake). */\n treeIndex: number;\n /**\n * Net slash(-)/reward(+) accumulated from settlements, in `stake_token`.\n * Written by settlement instead of mutating `staked` — keeps the\n * accumulator root canonical. Folded into `staked` by the permissionless\n * `reconcile_stake` crank (which updates the root via a Merkle proof).\n */\n stakeDelta: bigint;\n /**\n * Pending slash exposure from all active draws. Incremented by\n * `draw_seat` (by `α·min_stake` from the dispute's terms), decremented\n * by settlement or cancel. Ensures the juror can always cover every\n * concurrent slash. `staked - slash_reserve` is the truly free stake.\n */\n slashReserve: bigint;\n /**\n * Timestamp of `request_withdraw` (0 = no pending request). The\n * accumulator root is already updated at request time; `withdraw` just\n * transfers tokens after `WITHDRAWAL_DELAY` + `active_draws == 0`.\n */\n withdrawRequestedAt: bigint;\n /**\n * Tokens locked in the vault pending `withdraw`. Set at `request_withdraw`,\n * consumed at `withdraw`.\n */\n pendingWithdrawal: bigint;\n /**\n * Aggregate earned fees (`fee_token`, ADR-0020). Credited at\n * `finalize_round` + settlement; withdrawn via the ungated\n * `withdraw_fees` instruction. No `active_draws` gate (fees are earned,\n * not at-risk capital).\n */\n feesEarned: bigint;\n /**\n * Next free index in the free-slot linked list (RECLAIM-LEAF).\n * `u32::MAX` = this account is NOT a free-list node (active juror, or never\n * reclaimed). Any other value = this slot is reclaimed and `next_free` is\n * the next free index after this one. Set by `reclaim_slot`, consumed by\n * `stake`.\n */\n nextFree: number;\n /**\n * Reserved tail space for future field extensions. Zeroed at `init`;\n * must stay the last field — new fields are carved out of it without\n * moving existing offsets or resizing the account.\n */\n padding: ReadonlyUint8Array;\n};\n\nexport type JurorStakeArgs = {\n subaccord: Address;\n juror: Address;\n /** Collateral (stake_token). Sortition weight + slash exposure. */\n staked: number | bigint;\n activeDraws: number;\n bump: number;\n /** Leaf position in the Subaccord accumulator (assigned at first stake). */\n treeIndex: number;\n /**\n * Net slash(-)/reward(+) accumulated from settlements, in `stake_token`.\n * Written by settlement instead of mutating `staked` — keeps the\n * accumulator root canonical. Folded into `staked` by the permissionless\n * `reconcile_stake` crank (which updates the root via a Merkle proof).\n */\n stakeDelta: number | bigint;\n /**\n * Pending slash exposure from all active draws. Incremented by\n * `draw_seat` (by `α·min_stake` from the dispute's terms), decremented\n * by settlement or cancel. Ensures the juror can always cover every\n * concurrent slash. `staked - slash_reserve` is the truly free stake.\n */\n slashReserve: number | bigint;\n /**\n * Timestamp of `request_withdraw` (0 = no pending request). The\n * accumulator root is already updated at request time; `withdraw` just\n * transfers tokens after `WITHDRAWAL_DELAY` + `active_draws == 0`.\n */\n withdrawRequestedAt: number | bigint;\n /**\n * Tokens locked in the vault pending `withdraw`. Set at `request_withdraw`,\n * consumed at `withdraw`.\n */\n pendingWithdrawal: number | bigint;\n /**\n * Aggregate earned fees (`fee_token`, ADR-0020). Credited at\n * `finalize_round` + settlement; withdrawn via the ungated\n * `withdraw_fees` instruction. No `active_draws` gate (fees are earned,\n * not at-risk capital).\n */\n feesEarned: number | bigint;\n /**\n * Next free index in the free-slot linked list (RECLAIM-LEAF).\n * `u32::MAX` = this account is NOT a free-list node (active juror, or never\n * reclaimed). Any other value = this slot is reclaimed and `next_free` is\n * the next free index after this one. Set by `reclaim_slot`, consumed by\n * `stake`.\n */\n nextFree: number;\n /**\n * Reserved tail space for future field extensions. Zeroed at `init`;\n * must stay the last field — new fields are carved out of it without\n * moving existing offsets or resizing the account.\n */\n padding: ReadonlyUint8Array;\n};\n\n/** Gets the encoder for {@link JurorStakeArgs} account data. */\nexport function getJurorStakeEncoder(): FixedSizeEncoder<JurorStakeArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"subaccord\", getAddressEncoder()],\n [\"juror\", getAddressEncoder()],\n [\"staked\", getU64Encoder()],\n [\"activeDraws\", getU32Encoder()],\n [\"bump\", getU8Encoder()],\n [\"treeIndex\", getU32Encoder()],\n [\"stakeDelta\", getI64Encoder()],\n [\"slashReserve\", getU64Encoder()],\n [\"withdrawRequestedAt\", getI64Encoder()],\n [\"pendingWithdrawal\", getU64Encoder()],\n [\"feesEarned\", getU64Encoder()],\n [\"nextFree\", getU32Encoder()],\n [\"padding\", fixEncoderSize(getBytesEncoder(), 64)],\n ]),\n (value) => ({ ...value, discriminator: JUROR_STAKE_DISCRIMINATOR }),\n );\n}\n\n/** Gets the decoder for {@link JurorStake} account data. */\nexport function getJurorStakeDecoder(): FixedSizeDecoder<JurorStake> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"subaccord\", getAddressDecoder()],\n [\"juror\", getAddressDecoder()],\n [\"staked\", getU64Decoder()],\n [\"activeDraws\", getU32Decoder()],\n [\"bump\", getU8Decoder()],\n [\"treeIndex\", getU32Decoder()],\n [\"stakeDelta\", getI64Decoder()],\n [\"slashReserve\", getU64Decoder()],\n [\"withdrawRequestedAt\", getI64Decoder()],\n [\"pendingWithdrawal\", getU64Decoder()],\n [\"feesEarned\", getU64Decoder()],\n [\"nextFree\", getU32Decoder()],\n [\"padding\", fixDecoderSize(getBytesDecoder(), 64)],\n ]);\n}\n\n/** Gets the codec for {@link JurorStake} account data. */\nexport function getJurorStakeCodec(): FixedSizeCodec<\n JurorStakeArgs,\n JurorStake\n> {\n return combineCodec(getJurorStakeEncoder(), getJurorStakeDecoder());\n}\n\nexport function decodeJurorStake<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress>,\n): Account<JurorStake, TAddress>;\nexport function decodeJurorStake<TAddress extends string = string>(\n encodedAccount: MaybeEncodedAccount<TAddress>,\n): MaybeAccount<JurorStake, TAddress>;\nexport function decodeJurorStake<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress> | MaybeEncodedAccount<TAddress>,\n): Account<JurorStake, TAddress> | MaybeAccount<JurorStake, TAddress> {\n return decodeAccount(\n encodedAccount as MaybeEncodedAccount<TAddress>,\n getJurorStakeDecoder(),\n );\n}\n\nexport async function fetchJurorStake<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<Account<JurorStake, TAddress>> {\n const maybeAccount = await fetchMaybeJurorStake(rpc, address, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeJurorStake<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<MaybeAccount<JurorStake, TAddress>> {\n const maybeAccount = await fetchEncodedAccount(rpc, address, config);\n return decodeJurorStake(maybeAccount);\n}\n\nexport async function fetchAllJurorStake(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<Account<JurorStake>[]> {\n const maybeAccounts = await fetchAllMaybeJurorStake(rpc, addresses, config);\n assertAccountsExist(maybeAccounts);\n return maybeAccounts;\n}\n\nexport async function fetchAllMaybeJurorStake(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<MaybeAccount<JurorStake>[]> {\n const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n return maybeAccounts.map((maybeAccount) => decodeJurorStake(maybeAccount));\n}\n\nexport function getJurorStakeSize(): number {\n return 197;\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n assertAccountExists,\n assertAccountsExist,\n combineCodec,\n decodeAccount,\n fetchEncodedAccount,\n fetchEncodedAccounts,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n transformEncoder,\n type Account,\n type Address,\n type Codec,\n type Decoder,\n type EncodedAccount,\n type Encoder,\n type FetchAccountConfig,\n type FetchAccountsConfig,\n type MaybeAccount,\n type MaybeEncodedAccount,\n type ReadonlyUint8Array,\n} from \"@solana/kit\";\nimport {\n getUpdatePayloadDecoder,\n getUpdatePayloadEncoder,\n type UpdatePayload,\n type UpdatePayloadArgs,\n} from \"../types\";\n\nexport const PENDING_UPDATE_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 24, 212, 61, 73, 130, 111, 15, 112,\n]);\n\nexport function getPendingUpdateDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n PENDING_UPDATE_DISCRIMINATOR,\n );\n}\n\nexport type PendingUpdate = {\n discriminator: ReadonlyUint8Array;\n subaccord: Address;\n nonce: bigint;\n proposed: UpdatePayload;\n proposedBy: Address;\n /** Earliest slot at which `execute_subaccord_update` may land. */\n executeAfterSlot: bigint;\n bump: number;\n};\n\nexport type PendingUpdateArgs = {\n subaccord: Address;\n nonce: number | bigint;\n proposed: UpdatePayloadArgs;\n proposedBy: Address;\n /** Earliest slot at which `execute_subaccord_update` may land. */\n executeAfterSlot: number | bigint;\n bump: number;\n};\n\n/** Gets the encoder for {@link PendingUpdateArgs} account data. */\nexport function getPendingUpdateEncoder(): Encoder<PendingUpdateArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"subaccord\", getAddressEncoder()],\n [\"nonce\", getU64Encoder()],\n [\"proposed\", getUpdatePayloadEncoder()],\n [\"proposedBy\", getAddressEncoder()],\n [\"executeAfterSlot\", getU64Encoder()],\n [\"bump\", getU8Encoder()],\n ]),\n (value) => ({ ...value, discriminator: PENDING_UPDATE_DISCRIMINATOR }),\n );\n}\n\n/** Gets the decoder for {@link PendingUpdate} account data. */\nexport function getPendingUpdateDecoder(): Decoder<PendingUpdate> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"subaccord\", getAddressDecoder()],\n [\"nonce\", getU64Decoder()],\n [\"proposed\", getUpdatePayloadDecoder()],\n [\"proposedBy\", getAddressDecoder()],\n [\"executeAfterSlot\", getU64Decoder()],\n [\"bump\", getU8Decoder()],\n ]);\n}\n\n/** Gets the codec for {@link PendingUpdate} account data. */\nexport function getPendingUpdateCodec(): Codec<\n PendingUpdateArgs,\n PendingUpdate\n> {\n return combineCodec(getPendingUpdateEncoder(), getPendingUpdateDecoder());\n}\n\nexport function decodePendingUpdate<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress>,\n): Account<PendingUpdate, TAddress>;\nexport function decodePendingUpdate<TAddress extends string = string>(\n encodedAccount: MaybeEncodedAccount<TAddress>,\n): MaybeAccount<PendingUpdate, TAddress>;\nexport function decodePendingUpdate<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress> | MaybeEncodedAccount<TAddress>,\n): Account<PendingUpdate, TAddress> | MaybeAccount<PendingUpdate, TAddress> {\n return decodeAccount(\n encodedAccount as MaybeEncodedAccount<TAddress>,\n getPendingUpdateDecoder(),\n );\n}\n\nexport async function fetchPendingUpdate<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<Account<PendingUpdate, TAddress>> {\n const maybeAccount = await fetchMaybePendingUpdate(rpc, address, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybePendingUpdate<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<MaybeAccount<PendingUpdate, TAddress>> {\n const maybeAccount = await fetchEncodedAccount(rpc, address, config);\n return decodePendingUpdate(maybeAccount);\n}\n\nexport async function fetchAllPendingUpdate(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<Account<PendingUpdate>[]> {\n const maybeAccounts = await fetchAllMaybePendingUpdate(\n rpc,\n addresses,\n config,\n );\n assertAccountsExist(maybeAccounts);\n return maybeAccounts;\n}\n\nexport async function fetchAllMaybePendingUpdate(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<MaybeAccount<PendingUpdate>[]> {\n const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n return maybeAccounts.map((maybeAccount) => decodePendingUpdate(maybeAccount));\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n assertAccountExists,\n assertAccountsExist,\n combineCodec,\n decodeAccount,\n fetchEncodedAccount,\n fetchEncodedAccounts,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getArrayDecoder,\n getArrayEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getI64Decoder,\n getI64Encoder,\n getStructDecoder,\n getStructEncoder,\n getU32Decoder,\n getU32Encoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n transformEncoder,\n type Account,\n type Address,\n type EncodedAccount,\n type FetchAccountConfig,\n type FetchAccountsConfig,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type MaybeAccount,\n type MaybeEncodedAccount,\n type ReadonlyUint8Array,\n} from \"@solana/kit\";\n\nexport const ROUND_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 87, 127, 165, 51, 73, 78, 116, 174,\n]);\n\nexport function getRoundDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(ROUND_DISCRIMINATOR);\n}\n\nexport type Round = {\n discriminator: ReadonlyUint8Array;\n roundIdx: number;\n jurorCount: number;\n commitCount: number;\n revealCount: number;\n /**\n * Same-size redraw counter within this round (ADR-0021). Orthogonal to\n * `round_idx`: bumping it changes only the sortition seed, never the panel\n * size or the appeal budget. `(0,0)` = initial draw; resets implicitly on a\n * new appeal round (fresh `Round` PDA keyed by the new `round_idx`).\n */\n drawAttempt: number;\n /**\n * Whether this round's coherence settlement has been applied\n * (CONCEPT-REVIEW Ugly 5 / bean accord-r6ti). 0 until\n * `finalize_dispute` (final round) or `settle_round` (prior rounds)\n * processes it; 1 after. Idempotency guard against double-settlement.\n * (`u8` not `bool` — `bool` is not `Pod`.)\n */\n settled: number;\n bump: number;\n pad0: ReadonlyUint8Array;\n /** Commit opens at this timestamp (= draw_time + review_window). */\n reviewEnd: bigint;\n /** Reveal opens at this timestamp (= review_end + commit_window). */\n commitEnd: bigint;\n /** Round can be finalized after this timestamp (= commit_end + reveal_window). */\n revealEnd: bigint;\n /**\n * The tallied round result; `u64::MAX` = not set. `Plurality`: winning\n * option index. `Median` (ADR-0025): the median of revealed scalar votes.\n */\n result: bigint;\n dispute: Address;\n jurors: Array<Address>;\n /**\n * `hash(vote_le, salt, juror_pubkey)` per drawn Juror; `[0;32]` until\n * committed. `vote_le` = the 8-byte little-endian vote (ADR-0025).\n */\n commits: Array<ReadonlyUint8Array>;\n /**\n * Cumulative-from-left prefix per drawn seat (bean accord-tzo0). Filled\n * when the seat lands; later seats read these to verify that every prior\n * sortition retry genuinely collided with an already-drawn juror —\n * eliminating caller choice (no draw_attempt grind).\n */\n seatPrefix: Array<bigint>;\n /**\n * Leaf stake per drawn seat. With `seat_prefix`, defines the sortition\n * range `[prefix, prefix+stake)` used for deterministic collision checks.\n */\n seatStake: Array<bigint>;\n /**\n * Revealed vote per drawn Juror; `u64::MAX` until revealed. Option index\n * for `Plurality`, fixed-point scalar (settlement-mint base units) for\n * `Median` (ADR-0025). Tail field — struct size stays a multiple of 8.\n */\n reveals: Array<bigint>;\n};\n\nexport type RoundArgs = {\n roundIdx: number;\n jurorCount: number;\n commitCount: number;\n revealCount: number;\n /**\n * Same-size redraw counter within this round (ADR-0021). Orthogonal to\n * `round_idx`: bumping it changes only the sortition seed, never the panel\n * size or the appeal budget. `(0,0)` = initial draw; resets implicitly on a\n * new appeal round (fresh `Round` PDA keyed by the new `round_idx`).\n */\n drawAttempt: number;\n /**\n * Whether this round's coherence settlement has been applied\n * (CONCEPT-REVIEW Ugly 5 / bean accord-r6ti). 0 until\n * `finalize_dispute` (final round) or `settle_round` (prior rounds)\n * processes it; 1 after. Idempotency guard against double-settlement.\n * (`u8` not `bool` — `bool` is not `Pod`.)\n */\n settled: number;\n bump: number;\n pad0: ReadonlyUint8Array;\n /** Commit opens at this timestamp (= draw_time + review_window). */\n reviewEnd: number | bigint;\n /** Reveal opens at this timestamp (= review_end + commit_window). */\n commitEnd: number | bigint;\n /** Round can be finalized after this timestamp (= commit_end + reveal_window). */\n revealEnd: number | bigint;\n /**\n * The tallied round result; `u64::MAX` = not set. `Plurality`: winning\n * option index. `Median` (ADR-0025): the median of revealed scalar votes.\n */\n result: number | bigint;\n dispute: Address;\n jurors: Array<Address>;\n /**\n * `hash(vote_le, salt, juror_pubkey)` per drawn Juror; `[0;32]` until\n * committed. `vote_le` = the 8-byte little-endian vote (ADR-0025).\n */\n commits: Array<ReadonlyUint8Array>;\n /**\n * Cumulative-from-left prefix per drawn seat (bean accord-tzo0). Filled\n * when the seat lands; later seats read these to verify that every prior\n * sortition retry genuinely collided with an already-drawn juror —\n * eliminating caller choice (no draw_attempt grind).\n */\n seatPrefix: Array<number | bigint>;\n /**\n * Leaf stake per drawn seat. With `seat_prefix`, defines the sortition\n * range `[prefix, prefix+stake)` used for deterministic collision checks.\n */\n seatStake: Array<number | bigint>;\n /**\n * Revealed vote per drawn Juror; `u64::MAX` until revealed. Option index\n * for `Plurality`, fixed-point scalar (settlement-mint base units) for\n * `Median` (ADR-0025). Tail field — struct size stays a multiple of 8.\n */\n reveals: Array<number | bigint>;\n};\n\n/** Gets the encoder for {@link RoundArgs} account data. */\nexport function getRoundEncoder(): FixedSizeEncoder<RoundArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"roundIdx\", getU32Encoder()],\n [\"jurorCount\", getU32Encoder()],\n [\"commitCount\", getU32Encoder()],\n [\"revealCount\", getU32Encoder()],\n [\"drawAttempt\", getU32Encoder()],\n [\"settled\", getU8Encoder()],\n [\"bump\", getU8Encoder()],\n [\"pad0\", fixEncoderSize(getBytesEncoder(), 2)],\n [\"reviewEnd\", getI64Encoder()],\n [\"commitEnd\", getI64Encoder()],\n [\"revealEnd\", getI64Encoder()],\n [\"result\", getU64Encoder()],\n [\"dispute\", getAddressEncoder()],\n [\"jurors\", getArrayEncoder(getAddressEncoder(), { size: 31 })],\n [\n \"commits\",\n getArrayEncoder(fixEncoderSize(getBytesEncoder(), 32), { size: 31 }),\n ],\n [\"seatPrefix\", getArrayEncoder(getU64Encoder(), { size: 31 })],\n [\"seatStake\", getArrayEncoder(getU64Encoder(), { size: 31 })],\n [\"reveals\", getArrayEncoder(getU64Encoder(), { size: 31 })],\n ]),\n (value) => ({ ...value, discriminator: ROUND_DISCRIMINATOR }),\n );\n}\n\n/** Gets the decoder for {@link Round} account data. */\nexport function getRoundDecoder(): FixedSizeDecoder<Round> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"roundIdx\", getU32Decoder()],\n [\"jurorCount\", getU32Decoder()],\n [\"commitCount\", getU32Decoder()],\n [\"revealCount\", getU32Decoder()],\n [\"drawAttempt\", getU32Decoder()],\n [\"settled\", getU8Decoder()],\n [\"bump\", getU8Decoder()],\n [\"pad0\", fixDecoderSize(getBytesDecoder(), 2)],\n [\"reviewEnd\", getI64Decoder()],\n [\"commitEnd\", getI64Decoder()],\n [\"revealEnd\", getI64Decoder()],\n [\"result\", getU64Decoder()],\n [\"dispute\", getAddressDecoder()],\n [\"jurors\", getArrayDecoder(getAddressDecoder(), { size: 31 })],\n [\n \"commits\",\n getArrayDecoder(fixDecoderSize(getBytesDecoder(), 32), { size: 31 }),\n ],\n [\"seatPrefix\", getArrayDecoder(getU64Decoder(), { size: 31 })],\n [\"seatStake\", getArrayDecoder(getU64Decoder(), { size: 31 })],\n [\"reveals\", getArrayDecoder(getU64Decoder(), { size: 31 })],\n ]);\n}\n\n/** Gets the codec for {@link Round} account data. */\nexport function getRoundCodec(): FixedSizeCodec<RoundArgs, Round> {\n return combineCodec(getRoundEncoder(), getRoundDecoder());\n}\n\nexport function decodeRound<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress>,\n): Account<Round, TAddress>;\nexport function decodeRound<TAddress extends string = string>(\n encodedAccount: MaybeEncodedAccount<TAddress>,\n): MaybeAccount<Round, TAddress>;\nexport function decodeRound<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress> | MaybeEncodedAccount<TAddress>,\n): Account<Round, TAddress> | MaybeAccount<Round, TAddress> {\n return decodeAccount(\n encodedAccount as MaybeEncodedAccount<TAddress>,\n getRoundDecoder(),\n );\n}\n\nexport async function fetchRound<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<Account<Round, TAddress>> {\n const maybeAccount = await fetchMaybeRound(rpc, address, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeRound<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<MaybeAccount<Round, TAddress>> {\n const maybeAccount = await fetchEncodedAccount(rpc, address, config);\n return decodeRound(maybeAccount);\n}\n\nexport async function fetchAllRound(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<Account<Round>[]> {\n const maybeAccounts = await fetchAllMaybeRound(rpc, addresses, config);\n assertAccountsExist(maybeAccounts);\n return maybeAccounts;\n}\n\nexport async function fetchAllMaybeRound(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<MaybeAccount<Round>[]> {\n const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n return maybeAccounts.map((maybeAccount) => decodeRound(maybeAccount));\n}\n\nexport function getRoundSize(): number {\n return 2824;\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n assertAccountExists,\n assertAccountsExist,\n combineCodec,\n decodeAccount,\n fetchEncodedAccount,\n fetchEncodedAccounts,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n getU16Decoder,\n getU16Encoder,\n getU32Decoder,\n getU32Encoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n transformEncoder,\n type Account,\n type Address,\n type EncodedAccount,\n type FetchAccountConfig,\n type FetchAccountsConfig,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type MaybeAccount,\n type MaybeEncodedAccount,\n type ReadonlyUint8Array,\n} from \"@solana/kit\";\nimport {\n getAggregationDecoder,\n getAggregationEncoder,\n getShortfallPolicyDecoder,\n getShortfallPolicyEncoder,\n type Aggregation,\n type AggregationArgs,\n type ShortfallPolicy,\n type ShortfallPolicyArgs,\n} from \"../types\";\n\nexport const SUBACCORD_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 210, 63, 193, 190, 9, 166, 89, 170,\n]);\n\nexport function getSubaccordDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(SUBACCORD_DISCRIMINATOR);\n}\n\nexport type Subaccord = {\n discriminator: ReadonlyUint8Array;\n creator: Address;\n stakingToken: Address;\n /**\n * Compensation mint — fees + appeal bonds (ADR-0020). Distinct from\n * `staking_token` so collateral and compensation are decoupled.\n */\n feeToken: Address;\n minStake: bigint;\n /**\n * Slash factor in basis points (10% = 1000). Incoherent Juror loses\n * `alpha_bps * min_stake / 10_000` (flat — ADR-0003 consequence).\n */\n alphaBps: number;\n reviewWindow: bigint;\n commitWindow: bigint;\n revealWindow: bigint;\n /**\n * Appeal window after a round resolves before the dispute goes final\n * (ADR-0022). Per-Subaccord; frozen onto `CaseTerms` at filing.\n */\n appealWindow: bigint;\n maxAppeals: number;\n /**\n * Round-1 (round-0) juror panel size (accord-9q3e, supersedes ADR-0019's\n * fixed constant). Immutable at creation — determines the appeal-ladder\n * geometry `(J+1)·2^k − 1`. Must be odd (tie avoidance) and the ladder top\n * `(J+1)·2^max_appeals − 1` must fit `MAX_JURORS`. Default 3. Frozen onto\n * `CaseTerms` at filing so governance cannot shift panel size mid-dispute.\n * A pool wanting a single juror sets `min_jury_size = 1` + `max_appeals = 0`.\n */\n minJurySize: number;\n /** Per-Subaccord aggregation rule (ADR-0019). v1 = `Plurality`. */\n aggregation: Aggregation;\n feePerJuror: bigint;\n /**\n * Reveal-quorum fraction in basis points (ADR-0021). A round is\n * authoritative only if `reveal_count >= ceil(panel × bps / 10_000)`.\n * Default 6666 (= 2/3); the absolute commitment escalates per appeal\n * for free via panel growth.\n */\n revealThresholdBps: number;\n /** What to do on a shortfall (ADR-0021). v1 = `Redraw`. */\n shortfallPolicy: ShortfallPolicy;\n /**\n * Maximum same-size redraws per round before the dispute fails (ADR-0021).\n * `(round_idx, draw_attempt)` with `draw_attempt` reaching this bound ⇒\n * `Failed`. Orthogonal to `max_appeals` (which bounds `round_idx`).\n */\n maxDrawAttempts: number;\n /**\n * Coherence tolerance for `Median` pools (ADR-0025), in bps of the final\n * median: a revealed vote is coherent iff\n * `|vote − ruling| · 10_000 ≤ ruling · coherence_tol_bps`. `0` = exact\n * match. Inert for `Plurality` (exact option equality). Frozen onto\n * `CaseTerms` at filing; immutable on the Subaccord (not in\n * `UpdatePayload`) — it defines the pool's coherence game.\n */\n coherenceTolBps: number;\n /** `Pubkey::default()` => immutable. Otherwise signs propose/execute updates. */\n authority: Address;\n evidenceOperator: Address;\n /** Immutable identity hash: what class of dispute this pool adjudicates. */\n domainRef: ReadonlyUint8Array;\n /** Immutable evidence-format spec hash (ADR-0006). */\n evidenceSpec: ReadonlyUint8Array;\n /**\n * Attestation-gated juror pool (PROG-ATTESTTION). When both are\n * `Pubkey::default()` the Subaccord is stake-only (today's behavior,\n * unchanged). When set, jurors must hold a valid SAS attestation from\n * `juror_credential` under `juror_schema` to stake and be drawn. Immutable\n * at creation — joins `domain_ref` + `evidence_spec` as the identity\n * triplet (ADR-0005). Both-or-neither: a half-bound Subaccord is rejected\n * at `create_subaccord` (`AttestationBindingPartial`).\n */\n jurorCredential: Address;\n jurorSchema: Address;\n /**\n * Count of **distinct Jurors with any stake** (`JurorStake.staked > 0`).\n * Maintained O(1) by `stake`/`unstake` (0→positive increments,\n * positive→0 decrements). This is a *coarse* intake gate for\n * `create_dispute`/`appeal` (SPEC edge case: revert if fewer active\n * distinct stakers than the required panel). It deliberately does NOT track\n * `min_stake` eligibility — that changes via the 48h timelock and cannot be\n * recomputed without the O(n) ledger ADR-0003 rejected. Precise eligibility\n * (amount ≥ min_stake, distinctness) is verified at `draw` against the\n * finalized Merkle Snapshot.\n */\n stakerCount: number;\n /**\n * On-chain stake accumulator root (ADR-0012). Maintained incrementally on\n * every `stake`/`unstake` via client-supplied Merkle paths; canonical by\n * construction — there is no posted root to withhold or fabricate.\n */\n rootHash: ReadonlyUint8Array;\n /** Total stake committed to by the accumulator tree (= root node sum). */\n totalStake: bigint;\n /**\n * Next free leaf index in the append-only tree. Incremented once per\n * first-time staker; never reused (full unstake zeros the leaf weight but\n * keeps its `tree_index`).\n */\n nextIndex: number;\n /** Fixed tree depth (bounds the pool at `2^depth`). Set at `create_subaccord`. */\n depth: number;\n /**\n * Parallel vault ledger — fee side (bean accord-fdad). Tracks every\n * `fee_token` SPL transfer in/out of the `fee_vault`, independent of the\n * vault's live balance. The vault balance is a *derivable consequence*:\n * `fee_vault.amount == fee_vault_deposited - fee_vault_withdrawn`\n * (separate-mint) or the fee portion of a shared ATA (same-mint).\n */\n feeVaultDeposited: bigint;\n feeVaultWithdrawn: bigint;\n /**\n * Parallel vault ledger — stake side (bean accord-fdad). Tracks every\n * `staking_token` SPL transfer in/out of the `stake_vault`. Bumped only by\n * `stake` (in) and `withdraw` (out); slashing and `request_withdraw` are\n * ledger-only and never touch these.\n */\n stakeVaultDeposited: bigint;\n stakeVaultWithdrawn: bigint;\n /**\n * Head of the free-slot linked list (RECLAIM-LEAF). `u32::MAX` = list empty.\n * When non-MAX, points to a JurorStake whose slot has been reclaimed and is\n * available for reuse by a new staker. Maintained by `reclaim_slot` (push)\n * and `stake` (pop).\n */\n freeHead: number;\n bump: number;\n /**\n * Reserved tail space for future field extensions. Zeroed at `init`;\n * must stay the last field — new fields are carved out of it without\n * moving existing offsets or resizing the account.\n */\n padding: ReadonlyUint8Array;\n};\n\nexport type SubaccordArgs = {\n creator: Address;\n stakingToken: Address;\n /**\n * Compensation mint — fees + appeal bonds (ADR-0020). Distinct from\n * `staking_token` so collateral and compensation are decoupled.\n */\n feeToken: Address;\n minStake: number | bigint;\n /**\n * Slash factor in basis points (10% = 1000). Incoherent Juror loses\n * `alpha_bps * min_stake / 10_000` (flat — ADR-0003 consequence).\n */\n alphaBps: number;\n reviewWindow: number | bigint;\n commitWindow: number | bigint;\n revealWindow: number | bigint;\n /**\n * Appeal window after a round resolves before the dispute goes final\n * (ADR-0022). Per-Subaccord; frozen onto `CaseTerms` at filing.\n */\n appealWindow: number | bigint;\n maxAppeals: number;\n /**\n * Round-1 (round-0) juror panel size (accord-9q3e, supersedes ADR-0019's\n * fixed constant). Immutable at creation — determines the appeal-ladder\n * geometry `(J+1)·2^k − 1`. Must be odd (tie avoidance) and the ladder top\n * `(J+1)·2^max_appeals − 1` must fit `MAX_JURORS`. Default 3. Frozen onto\n * `CaseTerms` at filing so governance cannot shift panel size mid-dispute.\n * A pool wanting a single juror sets `min_jury_size = 1` + `max_appeals = 0`.\n */\n minJurySize: number;\n /** Per-Subaccord aggregation rule (ADR-0019). v1 = `Plurality`. */\n aggregation: AggregationArgs;\n feePerJuror: number | bigint;\n /**\n * Reveal-quorum fraction in basis points (ADR-0021). A round is\n * authoritative only if `reveal_count >= ceil(panel × bps / 10_000)`.\n * Default 6666 (= 2/3); the absolute commitment escalates per appeal\n * for free via panel growth.\n */\n revealThresholdBps: number;\n /** What to do on a shortfall (ADR-0021). v1 = `Redraw`. */\n shortfallPolicy: ShortfallPolicyArgs;\n /**\n * Maximum same-size redraws per round before the dispute fails (ADR-0021).\n * `(round_idx, draw_attempt)` with `draw_attempt` reaching this bound ⇒\n * `Failed`. Orthogonal to `max_appeals` (which bounds `round_idx`).\n */\n maxDrawAttempts: number;\n /**\n * Coherence tolerance for `Median` pools (ADR-0025), in bps of the final\n * median: a revealed vote is coherent iff\n * `|vote − ruling| · 10_000 ≤ ruling · coherence_tol_bps`. `0` = exact\n * match. Inert for `Plurality` (exact option equality). Frozen onto\n * `CaseTerms` at filing; immutable on the Subaccord (not in\n * `UpdatePayload`) — it defines the pool's coherence game.\n */\n coherenceTolBps: number;\n /** `Pubkey::default()` => immutable. Otherwise signs propose/execute updates. */\n authority: Address;\n evidenceOperator: Address;\n /** Immutable identity hash: what class of dispute this pool adjudicates. */\n domainRef: ReadonlyUint8Array;\n /** Immutable evidence-format spec hash (ADR-0006). */\n evidenceSpec: ReadonlyUint8Array;\n /**\n * Attestation-gated juror pool (PROG-ATTESTTION). When both are\n * `Pubkey::default()` the Subaccord is stake-only (today's behavior,\n * unchanged). When set, jurors must hold a valid SAS attestation from\n * `juror_credential` under `juror_schema` to stake and be drawn. Immutable\n * at creation — joins `domain_ref` + `evidence_spec` as the identity\n * triplet (ADR-0005). Both-or-neither: a half-bound Subaccord is rejected\n * at `create_subaccord` (`AttestationBindingPartial`).\n */\n jurorCredential: Address;\n jurorSchema: Address;\n /**\n * Count of **distinct Jurors with any stake** (`JurorStake.staked > 0`).\n * Maintained O(1) by `stake`/`unstake` (0→positive increments,\n * positive→0 decrements). This is a *coarse* intake gate for\n * `create_dispute`/`appeal` (SPEC edge case: revert if fewer active\n * distinct stakers than the required panel). It deliberately does NOT track\n * `min_stake` eligibility — that changes via the 48h timelock and cannot be\n * recomputed without the O(n) ledger ADR-0003 rejected. Precise eligibility\n * (amount ≥ min_stake, distinctness) is verified at `draw` against the\n * finalized Merkle Snapshot.\n */\n stakerCount: number;\n /**\n * On-chain stake accumulator root (ADR-0012). Maintained incrementally on\n * every `stake`/`unstake` via client-supplied Merkle paths; canonical by\n * construction — there is no posted root to withhold or fabricate.\n */\n rootHash: ReadonlyUint8Array;\n /** Total stake committed to by the accumulator tree (= root node sum). */\n totalStake: number | bigint;\n /**\n * Next free leaf index in the append-only tree. Incremented once per\n * first-time staker; never reused (full unstake zeros the leaf weight but\n * keeps its `tree_index`).\n */\n nextIndex: number;\n /** Fixed tree depth (bounds the pool at `2^depth`). Set at `create_subaccord`. */\n depth: number;\n /**\n * Parallel vault ledger — fee side (bean accord-fdad). Tracks every\n * `fee_token` SPL transfer in/out of the `fee_vault`, independent of the\n * vault's live balance. The vault balance is a *derivable consequence*:\n * `fee_vault.amount == fee_vault_deposited - fee_vault_withdrawn`\n * (separate-mint) or the fee portion of a shared ATA (same-mint).\n */\n feeVaultDeposited: number | bigint;\n feeVaultWithdrawn: number | bigint;\n /**\n * Parallel vault ledger — stake side (bean accord-fdad). Tracks every\n * `staking_token` SPL transfer in/out of the `stake_vault`. Bumped only by\n * `stake` (in) and `withdraw` (out); slashing and `request_withdraw` are\n * ledger-only and never touch these.\n */\n stakeVaultDeposited: number | bigint;\n stakeVaultWithdrawn: number | bigint;\n /**\n * Head of the free-slot linked list (RECLAIM-LEAF). `u32::MAX` = list empty.\n * When non-MAX, points to a JurorStake whose slot has been reclaimed and is\n * available for reuse by a new staker. Maintained by `reclaim_slot` (push)\n * and `stake` (pop).\n */\n freeHead: number;\n bump: number;\n /**\n * Reserved tail space for future field extensions. Zeroed at `init`;\n * must stay the last field — new fields are carved out of it without\n * moving existing offsets or resizing the account.\n */\n padding: ReadonlyUint8Array;\n};\n\n/** Gets the encoder for {@link SubaccordArgs} account data. */\nexport function getSubaccordEncoder(): FixedSizeEncoder<SubaccordArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"creator\", getAddressEncoder()],\n [\"stakingToken\", getAddressEncoder()],\n [\"feeToken\", getAddressEncoder()],\n [\"minStake\", getU64Encoder()],\n [\"alphaBps\", getU16Encoder()],\n [\"reviewWindow\", getU64Encoder()],\n [\"commitWindow\", getU64Encoder()],\n [\"revealWindow\", getU64Encoder()],\n [\"appealWindow\", getU64Encoder()],\n [\"maxAppeals\", getU8Encoder()],\n [\"minJurySize\", getU32Encoder()],\n [\"aggregation\", getAggregationEncoder()],\n [\"feePerJuror\", getU64Encoder()],\n [\"revealThresholdBps\", getU16Encoder()],\n [\"shortfallPolicy\", getShortfallPolicyEncoder()],\n [\"maxDrawAttempts\", getU8Encoder()],\n [\"coherenceTolBps\", getU16Encoder()],\n [\"authority\", getAddressEncoder()],\n [\"evidenceOperator\", getAddressEncoder()],\n [\"domainRef\", fixEncoderSize(getBytesEncoder(), 32)],\n [\"evidenceSpec\", fixEncoderSize(getBytesEncoder(), 32)],\n [\"jurorCredential\", getAddressEncoder()],\n [\"jurorSchema\", getAddressEncoder()],\n [\"stakerCount\", getU32Encoder()],\n [\"rootHash\", fixEncoderSize(getBytesEncoder(), 32)],\n [\"totalStake\", getU64Encoder()],\n [\"nextIndex\", getU32Encoder()],\n [\"depth\", getU8Encoder()],\n [\"feeVaultDeposited\", getU64Encoder()],\n [\"feeVaultWithdrawn\", getU64Encoder()],\n [\"stakeVaultDeposited\", getU64Encoder()],\n [\"stakeVaultWithdrawn\", getU64Encoder()],\n [\"freeHead\", getU32Encoder()],\n [\"bump\", getU8Encoder()],\n [\"padding\", fixEncoderSize(getBytesEncoder(), 64)],\n ]),\n (value) => ({ ...value, discriminator: SUBACCORD_DISCRIMINATOR }),\n );\n}\n\n/** Gets the decoder for {@link Subaccord} account data. */\nexport function getSubaccordDecoder(): FixedSizeDecoder<Subaccord> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"creator\", getAddressDecoder()],\n [\"stakingToken\", getAddressDecoder()],\n [\"feeToken\", getAddressDecoder()],\n [\"minStake\", getU64Decoder()],\n [\"alphaBps\", getU16Decoder()],\n [\"reviewWindow\", getU64Decoder()],\n [\"commitWindow\", getU64Decoder()],\n [\"revealWindow\", getU64Decoder()],\n [\"appealWindow\", getU64Decoder()],\n [\"maxAppeals\", getU8Decoder()],\n [\"minJurySize\", getU32Decoder()],\n [\"aggregation\", getAggregationDecoder()],\n [\"feePerJuror\", getU64Decoder()],\n [\"revealThresholdBps\", getU16Decoder()],\n [\"shortfallPolicy\", getShortfallPolicyDecoder()],\n [\"maxDrawAttempts\", getU8Decoder()],\n [\"coherenceTolBps\", getU16Decoder()],\n [\"authority\", getAddressDecoder()],\n [\"evidenceOperator\", getAddressDecoder()],\n [\"domainRef\", fixDecoderSize(getBytesDecoder(), 32)],\n [\"evidenceSpec\", fixDecoderSize(getBytesDecoder(), 32)],\n [\"jurorCredential\", getAddressDecoder()],\n [\"jurorSchema\", getAddressDecoder()],\n [\"stakerCount\", getU32Decoder()],\n [\"rootHash\", fixDecoderSize(getBytesDecoder(), 32)],\n [\"totalStake\", getU64Decoder()],\n [\"nextIndex\", getU32Decoder()],\n [\"depth\", getU8Decoder()],\n [\"feeVaultDeposited\", getU64Decoder()],\n [\"feeVaultWithdrawn\", getU64Decoder()],\n [\"stakeVaultDeposited\", getU64Decoder()],\n [\"stakeVaultWithdrawn\", getU64Decoder()],\n [\"freeHead\", getU32Decoder()],\n [\"bump\", getU8Decoder()],\n [\"padding\", fixDecoderSize(getBytesDecoder(), 64)],\n ]);\n}\n\n/** Gets the codec for {@link Subaccord} account data. */\nexport function getSubaccordCodec(): FixedSizeCodec<SubaccordArgs, Subaccord> {\n return combineCodec(getSubaccordEncoder(), getSubaccordDecoder());\n}\n\nexport function decodeSubaccord<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress>,\n): Account<Subaccord, TAddress>;\nexport function decodeSubaccord<TAddress extends string = string>(\n encodedAccount: MaybeEncodedAccount<TAddress>,\n): MaybeAccount<Subaccord, TAddress>;\nexport function decodeSubaccord<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress> | MaybeEncodedAccount<TAddress>,\n): Account<Subaccord, TAddress> | MaybeAccount<Subaccord, TAddress> {\n return decodeAccount(\n encodedAccount as MaybeEncodedAccount<TAddress>,\n getSubaccordDecoder(),\n );\n}\n\nexport async function fetchSubaccord<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<Account<Subaccord, TAddress>> {\n const maybeAccount = await fetchMaybeSubaccord(rpc, address, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeSubaccord<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<MaybeAccount<Subaccord, TAddress>> {\n const maybeAccount = await fetchEncodedAccount(rpc, address, config);\n return decodeSubaccord(maybeAccount);\n}\n\nexport async function fetchAllSubaccord(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<Account<Subaccord>[]> {\n const maybeAccounts = await fetchAllMaybeSubaccord(rpc, addresses, config);\n assertAccountsExist(maybeAccounts);\n return maybeAccounts;\n}\n\nexport async function fetchAllMaybeSubaccord(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<MaybeAccount<Subaccord>[]> {\n const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n return maybeAccounts.map((maybeAccount) => decodeSubaccord(maybeAccount));\n}\n\nexport function getSubaccordSize(): number {\n return 508;\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getAddressEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n getAddressFromResolvedInstructionAccount,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { findAccordStatePda } from \"../pdas\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\n\nexport const APPEAL_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 250, 91, 1, 244, 179, 52, 75, 236,\n]);\n\nexport function getAppealDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(APPEAL_DISCRIMINATOR);\n}\n\nexport type AppealInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountAppellant extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountAccordState extends string | AccountMeta<string> = string,\n TAccountDispute extends string | AccountMeta<string> = string,\n TAccountRound extends string | AccountMeta<string> = string,\n TAccountAppealBond extends string | AccountMeta<string> = string,\n TAccountFeeToken extends string | AccountMeta<string> = string,\n TAccountAppellantTokenAccount extends string | AccountMeta<string> = string,\n TAccountFeeVault extends string | AccountMeta<string> = string,\n TAccountTokenProgram extends string | AccountMeta<string> =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\",\n TAccountAssociatedTokenProgram extends string | AccountMeta<string> =\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\",\n TAccountSystemProgram extends string | AccountMeta<string> =\n \"11111111111111111111111111111111\",\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountAppellant extends string\n ? WritableSignerAccount<TAccountAppellant> &\n AccountSignerMeta<TAccountAppellant>\n : TAccountAppellant,\n TAccountSubaccord extends string\n ? WritableAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountAccordState extends string\n ? ReadonlyAccount<TAccountAccordState>\n : TAccountAccordState,\n TAccountDispute extends string\n ? WritableAccount<TAccountDispute>\n : TAccountDispute,\n TAccountRound extends string\n ? ReadonlyAccount<TAccountRound>\n : TAccountRound,\n TAccountAppealBond extends string\n ? WritableAccount<TAccountAppealBond>\n : TAccountAppealBond,\n TAccountFeeToken extends string\n ? ReadonlyAccount<TAccountFeeToken>\n : TAccountFeeToken,\n TAccountAppellantTokenAccount extends string\n ? WritableAccount<TAccountAppellantTokenAccount>\n : TAccountAppellantTokenAccount,\n TAccountFeeVault extends string\n ? WritableAccount<TAccountFeeVault>\n : TAccountFeeVault,\n TAccountTokenProgram extends string\n ? ReadonlyAccount<TAccountTokenProgram>\n : TAccountTokenProgram,\n TAccountAssociatedTokenProgram extends string\n ? ReadonlyAccount<TAccountAssociatedTokenProgram>\n : TAccountAssociatedTokenProgram,\n TAccountSystemProgram extends string\n ? ReadonlyAccount<TAccountSystemProgram>\n : TAccountSystemProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type AppealInstructionData = {\n discriminator: ReadonlyUint8Array;\n newEvidenceHash: ReadonlyUint8Array;\n};\n\nexport type AppealInstructionDataArgs = { newEvidenceHash: ReadonlyUint8Array };\n\nexport function getAppealInstructionDataEncoder(): FixedSizeEncoder<AppealInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"newEvidenceHash\", fixEncoderSize(getBytesEncoder(), 32)],\n ]),\n (value) => ({ ...value, discriminator: APPEAL_DISCRIMINATOR }),\n );\n}\n\nexport function getAppealInstructionDataDecoder(): FixedSizeDecoder<AppealInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"newEvidenceHash\", fixDecoderSize(getBytesDecoder(), 32)],\n ]);\n}\n\nexport function getAppealInstructionDataCodec(): FixedSizeCodec<\n AppealInstructionDataArgs,\n AppealInstructionData\n> {\n return combineCodec(\n getAppealInstructionDataEncoder(),\n getAppealInstructionDataDecoder(),\n );\n}\n\nexport type AppealAsyncInput<\n TAccountAppellant extends string = string,\n TAccountSubaccord extends string = string,\n TAccountAccordState extends string = string,\n TAccountDispute extends string = string,\n TAccountRound extends string = string,\n TAccountAppealBond extends string = string,\n TAccountFeeToken extends string = string,\n TAccountAppellantTokenAccount extends string = string,\n TAccountFeeVault extends string = string,\n TAccountTokenProgram extends string = string,\n TAccountAssociatedTokenProgram extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n appellant: TransactionSigner<TAccountAppellant>;\n subaccord: Address<TAccountSubaccord>;\n accordState?: Address<TAccountAccordState>;\n dispute: Address<TAccountDispute>;\n /**\n * The round just resolved (`dispute.current_round`) — read-only; supplies\n * `reveal_end` for the appeal-window check and `result` (the prior ruling).\n */\n round: Address<TAccountRound>;\n /** Per-appeal bond custody (ADR-0004). Keyed by the round being appealed. */\n appealBond: Address<TAccountAppealBond>;\n feeToken: Address<TAccountFeeToken>;\n appellantTokenAccount?: Address<TAccountAppellantTokenAccount>;\n feeVault?: Address<TAccountFeeVault>;\n tokenProgram?: Address<TAccountTokenProgram>;\n associatedTokenProgram?: Address<TAccountAssociatedTokenProgram>;\n systemProgram?: Address<TAccountSystemProgram>;\n newEvidenceHash: AppealInstructionDataArgs[\"newEvidenceHash\"];\n};\n\nexport async function getAppealInstructionAsync<\n TAccountAppellant extends string,\n TAccountSubaccord extends string,\n TAccountAccordState extends string,\n TAccountDispute extends string,\n TAccountRound extends string,\n TAccountAppealBond extends string,\n TAccountFeeToken extends string,\n TAccountAppellantTokenAccount extends string,\n TAccountFeeVault extends string,\n TAccountTokenProgram extends string,\n TAccountAssociatedTokenProgram extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: AppealAsyncInput<\n TAccountAppellant,\n TAccountSubaccord,\n TAccountAccordState,\n TAccountDispute,\n TAccountRound,\n TAccountAppealBond,\n TAccountFeeToken,\n TAccountAppellantTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram,\n TAccountAssociatedTokenProgram,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n AppealInstruction<\n TProgramAddress,\n TAccountAppellant,\n TAccountSubaccord,\n TAccountAccordState,\n TAccountDispute,\n TAccountRound,\n TAccountAppealBond,\n TAccountFeeToken,\n TAccountAppellantTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram,\n TAccountAssociatedTokenProgram,\n TAccountSystemProgram\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n appellant: { value: input.appellant ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n accordState: { value: input.accordState ?? null, isWritable: false },\n dispute: { value: input.dispute ?? null, isWritable: true },\n round: { value: input.round ?? null, isWritable: false },\n appealBond: { value: input.appealBond ?? null, isWritable: true },\n feeToken: { value: input.feeToken ?? null, isWritable: false },\n appellantTokenAccount: {\n value: input.appellantTokenAccount ?? null,\n isWritable: true,\n },\n feeVault: { value: input.feeVault ?? null, isWritable: true },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n associatedTokenProgram: {\n value: input.associatedTokenProgram ?? null,\n isWritable: false,\n },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.accordState.value) {\n accounts.accordState.value = await findAccordStatePda();\n }\n if (!accounts.appellantTokenAccount.value) {\n accounts.appellantTokenAccount.value = await getProgramDerivedAddress({\n programAddress:\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\" as Address<\"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\">,\n seeds: [\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"appellant\",\n accounts.appellant.value,\n ),\n ),\n getBytesEncoder().encode(\n new Uint8Array([\n 6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206, 235,\n 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140, 245, 133,\n 126, 255, 0, 169,\n ]),\n ),\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"feeToken\",\n accounts.feeToken.value,\n ),\n ),\n ],\n });\n }\n if (!accounts.feeVault.value) {\n accounts.feeVault.value = await getProgramDerivedAddress({\n programAddress:\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\" as Address<\"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\">,\n seeds: [\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"subaccord\",\n accounts.subaccord.value,\n ),\n ),\n getBytesEncoder().encode(\n new Uint8Array([\n 6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206, 235,\n 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140, 245, 133,\n 126, 255, 0, 169,\n ]),\n ),\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"feeToken\",\n accounts.feeToken.value,\n ),\n ),\n ],\n });\n }\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\" as Address<\"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\">;\n }\n if (!accounts.associatedTokenProgram.value) {\n accounts.associatedTokenProgram.value =\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\" as Address<\"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\">;\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n \"11111111111111111111111111111111\" as Address<\"11111111111111111111111111111111\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"appellant\", accounts.appellant),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"accordState\", accounts.accordState),\n getAccountMeta(\"dispute\", accounts.dispute),\n getAccountMeta(\"round\", accounts.round),\n getAccountMeta(\"appealBond\", accounts.appealBond),\n getAccountMeta(\"feeToken\", accounts.feeToken),\n getAccountMeta(\"appellantTokenAccount\", accounts.appellantTokenAccount),\n getAccountMeta(\"feeVault\", accounts.feeVault),\n getAccountMeta(\"tokenProgram\", accounts.tokenProgram),\n getAccountMeta(\"associatedTokenProgram\", accounts.associatedTokenProgram),\n getAccountMeta(\"systemProgram\", accounts.systemProgram),\n ],\n data: getAppealInstructionDataEncoder().encode(\n args as AppealInstructionDataArgs,\n ),\n programAddress,\n } as AppealInstruction<\n TProgramAddress,\n TAccountAppellant,\n TAccountSubaccord,\n TAccountAccordState,\n TAccountDispute,\n TAccountRound,\n TAccountAppealBond,\n TAccountFeeToken,\n TAccountAppellantTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram,\n TAccountAssociatedTokenProgram,\n TAccountSystemProgram\n >);\n}\n\nexport type AppealInput<\n TAccountAppellant extends string = string,\n TAccountSubaccord extends string = string,\n TAccountAccordState extends string = string,\n TAccountDispute extends string = string,\n TAccountRound extends string = string,\n TAccountAppealBond extends string = string,\n TAccountFeeToken extends string = string,\n TAccountAppellantTokenAccount extends string = string,\n TAccountFeeVault extends string = string,\n TAccountTokenProgram extends string = string,\n TAccountAssociatedTokenProgram extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n appellant: TransactionSigner<TAccountAppellant>;\n subaccord: Address<TAccountSubaccord>;\n accordState: Address<TAccountAccordState>;\n dispute: Address<TAccountDispute>;\n /**\n * The round just resolved (`dispute.current_round`) — read-only; supplies\n * `reveal_end` for the appeal-window check and `result` (the prior ruling).\n */\n round: Address<TAccountRound>;\n /** Per-appeal bond custody (ADR-0004). Keyed by the round being appealed. */\n appealBond: Address<TAccountAppealBond>;\n feeToken: Address<TAccountFeeToken>;\n appellantTokenAccount: Address<TAccountAppellantTokenAccount>;\n feeVault: Address<TAccountFeeVault>;\n tokenProgram?: Address<TAccountTokenProgram>;\n associatedTokenProgram?: Address<TAccountAssociatedTokenProgram>;\n systemProgram?: Address<TAccountSystemProgram>;\n newEvidenceHash: AppealInstructionDataArgs[\"newEvidenceHash\"];\n};\n\nexport function getAppealInstruction<\n TAccountAppellant extends string,\n TAccountSubaccord extends string,\n TAccountAccordState extends string,\n TAccountDispute extends string,\n TAccountRound extends string,\n TAccountAppealBond extends string,\n TAccountFeeToken extends string,\n TAccountAppellantTokenAccount extends string,\n TAccountFeeVault extends string,\n TAccountTokenProgram extends string,\n TAccountAssociatedTokenProgram extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: AppealInput<\n TAccountAppellant,\n TAccountSubaccord,\n TAccountAccordState,\n TAccountDispute,\n TAccountRound,\n TAccountAppealBond,\n TAccountFeeToken,\n TAccountAppellantTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram,\n TAccountAssociatedTokenProgram,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): AppealInstruction<\n TProgramAddress,\n TAccountAppellant,\n TAccountSubaccord,\n TAccountAccordState,\n TAccountDispute,\n TAccountRound,\n TAccountAppealBond,\n TAccountFeeToken,\n TAccountAppellantTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram,\n TAccountAssociatedTokenProgram,\n TAccountSystemProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n appellant: { value: input.appellant ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n accordState: { value: input.accordState ?? null, isWritable: false },\n dispute: { value: input.dispute ?? null, isWritable: true },\n round: { value: input.round ?? null, isWritable: false },\n appealBond: { value: input.appealBond ?? null, isWritable: true },\n feeToken: { value: input.feeToken ?? null, isWritable: false },\n appellantTokenAccount: {\n value: input.appellantTokenAccount ?? null,\n isWritable: true,\n },\n feeVault: { value: input.feeVault ?? null, isWritable: true },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n associatedTokenProgram: {\n value: input.associatedTokenProgram ?? null,\n isWritable: false,\n },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\" as Address<\"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\">;\n }\n if (!accounts.associatedTokenProgram.value) {\n accounts.associatedTokenProgram.value =\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\" as Address<\"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\">;\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n \"11111111111111111111111111111111\" as Address<\"11111111111111111111111111111111\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"appellant\", accounts.appellant),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"accordState\", accounts.accordState),\n getAccountMeta(\"dispute\", accounts.dispute),\n getAccountMeta(\"round\", accounts.round),\n getAccountMeta(\"appealBond\", accounts.appealBond),\n getAccountMeta(\"feeToken\", accounts.feeToken),\n getAccountMeta(\"appellantTokenAccount\", accounts.appellantTokenAccount),\n getAccountMeta(\"feeVault\", accounts.feeVault),\n getAccountMeta(\"tokenProgram\", accounts.tokenProgram),\n getAccountMeta(\"associatedTokenProgram\", accounts.associatedTokenProgram),\n getAccountMeta(\"systemProgram\", accounts.systemProgram),\n ],\n data: getAppealInstructionDataEncoder().encode(\n args as AppealInstructionDataArgs,\n ),\n programAddress,\n } as AppealInstruction<\n TProgramAddress,\n TAccountAppellant,\n TAccountSubaccord,\n TAccountAccordState,\n TAccountDispute,\n TAccountRound,\n TAccountAppealBond,\n TAccountFeeToken,\n TAccountAppellantTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram,\n TAccountAssociatedTokenProgram,\n TAccountSystemProgram\n >);\n}\n\nexport type ParsedAppealInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n appellant: TAccountMetas[0];\n subaccord: TAccountMetas[1];\n accordState: TAccountMetas[2];\n dispute: TAccountMetas[3];\n /**\n * The round just resolved (`dispute.current_round`) — read-only; supplies\n * `reveal_end` for the appeal-window check and `result` (the prior ruling).\n */\n round: TAccountMetas[4];\n /** Per-appeal bond custody (ADR-0004). Keyed by the round being appealed. */\n appealBond: TAccountMetas[5];\n feeToken: TAccountMetas[6];\n appellantTokenAccount: TAccountMetas[7];\n feeVault: TAccountMetas[8];\n tokenProgram: TAccountMetas[9];\n associatedTokenProgram: TAccountMetas[10];\n systemProgram: TAccountMetas[11];\n };\n data: AppealInstructionData;\n};\n\nexport function parseAppealInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedAppealInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 12) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 12,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n appellant: getNextAccount(),\n subaccord: getNextAccount(),\n accordState: getNextAccount(),\n dispute: getNextAccount(),\n round: getNextAccount(),\n appealBond: getNextAccount(),\n feeToken: getNextAccount(),\n appellantTokenAccount: getNextAccount(),\n feeVault: getNextAccount(),\n tokenProgram: getNextAccount(),\n associatedTokenProgram: getNextAccount(),\n systemProgram: getNextAccount(),\n },\n data: getAppealInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n getBytesEncoder,\n getProgramDerivedAddress,\n type Address,\n type ProgramDerivedAddress,\n} from \"@solana/kit\";\n\nexport async function findAccordStatePda(\n config: { programAddress?: Address | undefined } = {},\n): Promise<ProgramDerivedAddress> {\n const {\n programAddress = \"cordhVoshqRV6kzGBmM89A66wuusJGsDCvLMHPLyKed\" as Address<\"cordhVoshqRV6kzGBmM89A66wuusJGsDCvLMHPLyKed\">,\n } = config;\n return await getProgramDerivedAddress({\n programAddress,\n seeds: [getBytesEncoder().encode(new Uint8Array([115, 116, 97, 116, 101]))],\n });\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n getAddressEncoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n getU32Encoder,\n type Address,\n type ProgramDerivedAddress,\n} from \"@solana/kit\";\n\nexport type AppealBondSeeds = {\n dispute: Address;\n roundIdx: number;\n};\n\nexport async function findAppealBondPda(\n seeds: AppealBondSeeds,\n config: { programAddress?: Address | undefined } = {},\n): Promise<ProgramDerivedAddress> {\n const {\n programAddress = \"cordhVoshqRV6kzGBmM89A66wuusJGsDCvLMHPLyKed\" as Address<\"cordhVoshqRV6kzGBmM89A66wuusJGsDCvLMHPLyKed\">,\n } = config;\n return await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getBytesEncoder().encode(new Uint8Array([98, 111, 110, 100])),\n getAddressEncoder().encode(seeds.dispute),\n getU32Encoder().encode(seeds.roundIdx),\n ],\n });\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n getAddressEncoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n getU64Encoder,\n type Address,\n type ProgramDerivedAddress,\n} from \"@solana/kit\";\n\nexport type DisputeSeeds = {\n filer: Address;\n nonce: number | bigint;\n};\n\nexport async function findDisputePda(\n seeds: DisputeSeeds,\n config: { programAddress?: Address | undefined } = {},\n): Promise<ProgramDerivedAddress> {\n const {\n programAddress = \"cordhVoshqRV6kzGBmM89A66wuusJGsDCvLMHPLyKed\" as Address<\"cordhVoshqRV6kzGBmM89A66wuusJGsDCvLMHPLyKed\">,\n } = config;\n return await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getBytesEncoder().encode(\n new Uint8Array([100, 105, 115, 112, 117, 116, 101]),\n ),\n getAddressEncoder().encode(seeds.filer),\n getU64Encoder().encode(seeds.nonce),\n ],\n });\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n getAddressEncoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n type Address,\n type ProgramDerivedAddress,\n} from \"@solana/kit\";\n\nexport type JurorStakeSeeds = {\n subaccord: Address;\n juror: Address;\n};\n\nexport async function findJurorStakePda(\n seeds: JurorStakeSeeds,\n config: { programAddress?: Address | undefined } = {},\n): Promise<ProgramDerivedAddress> {\n const {\n programAddress = \"cordhVoshqRV6kzGBmM89A66wuusJGsDCvLMHPLyKed\" as Address<\"cordhVoshqRV6kzGBmM89A66wuusJGsDCvLMHPLyKed\">,\n } = config;\n return await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getBytesEncoder().encode(new Uint8Array([115, 116, 97, 107, 101])),\n getAddressEncoder().encode(seeds.subaccord),\n getAddressEncoder().encode(seeds.juror),\n ],\n });\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n getAddressEncoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n getU64Encoder,\n type Address,\n type ProgramDerivedAddress,\n} from \"@solana/kit\";\n\nexport type PendingUpdateSeeds = {\n subaccord: Address;\n nonce: number | bigint;\n};\n\nexport async function findPendingUpdatePda(\n seeds: PendingUpdateSeeds,\n config: { programAddress?: Address | undefined } = {},\n): Promise<ProgramDerivedAddress> {\n const {\n programAddress = \"cordhVoshqRV6kzGBmM89A66wuusJGsDCvLMHPLyKed\" as Address<\"cordhVoshqRV6kzGBmM89A66wuusJGsDCvLMHPLyKed\">,\n } = config;\n return await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getBytesEncoder().encode(new Uint8Array([117, 112, 100, 97, 116, 101])),\n getAddressEncoder().encode(seeds.subaccord),\n getU64Encoder().encode(seeds.nonce),\n ],\n });\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n getBytesEncoder,\n getProgramDerivedAddress,\n type Address,\n type ProgramDerivedAddress,\n} from \"@solana/kit\";\n\nexport async function findProgramIdentityPda(\n config: { programAddress?: Address | undefined } = {},\n): Promise<ProgramDerivedAddress> {\n const {\n programAddress = \"cordhVoshqRV6kzGBmM89A66wuusJGsDCvLMHPLyKed\" as Address<\"cordhVoshqRV6kzGBmM89A66wuusJGsDCvLMHPLyKed\">,\n } = config;\n return await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getBytesEncoder().encode(\n new Uint8Array([105, 100, 101, 110, 116, 105, 116, 121]),\n ),\n ],\n });\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n getAddressEncoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n getU32Encoder,\n type Address,\n type ProgramDerivedAddress,\n} from \"@solana/kit\";\n\nexport type RoundSeeds = {\n dispute: Address;\n roundIdx: number;\n};\n\nexport async function findRoundPda(\n seeds: RoundSeeds,\n config: { programAddress?: Address | undefined } = {},\n): Promise<ProgramDerivedAddress> {\n const {\n programAddress = \"cordhVoshqRV6kzGBmM89A66wuusJGsDCvLMHPLyKed\" as Address<\"cordhVoshqRV6kzGBmM89A66wuusJGsDCvLMHPLyKed\">,\n } = config;\n return await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getBytesEncoder().encode(new Uint8Array([114, 111, 117, 110, 100])),\n getAddressEncoder().encode(seeds.dispute),\n getU32Encoder().encode(seeds.roundIdx),\n ],\n });\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n fixEncoderSize,\n getAddressEncoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n type Address,\n type ProgramDerivedAddress,\n type ReadonlyUint8Array,\n} from \"@solana/kit\";\n\nexport type SubaccordSeeds = {\n creator: Address;\n domainRef: ReadonlyUint8Array;\n};\n\nexport async function findSubaccordPda(\n seeds: SubaccordSeeds,\n config: { programAddress?: Address | undefined } = {},\n): Promise<ProgramDerivedAddress> {\n const {\n programAddress = \"cordhVoshqRV6kzGBmM89A66wuusJGsDCvLMHPLyKed\" as Address<\"cordhVoshqRV6kzGBmM89A66wuusJGsDCvLMHPLyKed\">,\n } = config;\n return await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getBytesEncoder().encode(\n new Uint8Array([115, 117, 98, 97, 99, 99, 111, 114, 100]),\n ),\n getAddressEncoder().encode(seeds.creator),\n fixEncoderSize(getBytesEncoder(), 32).encode(seeds.domainRef),\n ],\n });\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getAddressEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n getAddressFromResolvedInstructionAccount,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\n\nexport const CANCEL_DISPUTE_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 23, 155, 220, 94, 76, 141, 231, 124,\n]);\n\nexport function getCancelDisputeDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n CANCEL_DISPUTE_DISCRIMINATOR,\n );\n}\n\nexport type CancelDisputeInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountCaller extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountDispute extends string | AccountMeta<string> = string,\n TAccountFeeToken extends string | AccountMeta<string> = string,\n TAccountFilerTokenAccount extends string | AccountMeta<string> = string,\n TAccountFeeVault extends string | AccountMeta<string> = string,\n TAccountTokenProgram extends string | AccountMeta<string> =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\",\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountCaller extends string\n ? WritableSignerAccount<TAccountCaller> &\n AccountSignerMeta<TAccountCaller>\n : TAccountCaller,\n TAccountSubaccord extends string\n ? WritableAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountDispute extends string\n ? WritableAccount<TAccountDispute>\n : TAccountDispute,\n TAccountFeeToken extends string\n ? ReadonlyAccount<TAccountFeeToken>\n : TAccountFeeToken,\n TAccountFilerTokenAccount extends string\n ? WritableAccount<TAccountFilerTokenAccount>\n : TAccountFilerTokenAccount,\n TAccountFeeVault extends string\n ? WritableAccount<TAccountFeeVault>\n : TAccountFeeVault,\n TAccountTokenProgram extends string\n ? ReadonlyAccount<TAccountTokenProgram>\n : TAccountTokenProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type CancelDisputeInstructionData = {\n discriminator: ReadonlyUint8Array;\n};\n\nexport type CancelDisputeInstructionDataArgs = {};\n\nexport function getCancelDisputeInstructionDataEncoder(): FixedSizeEncoder<CancelDisputeInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([[\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)]]),\n (value) => ({ ...value, discriminator: CANCEL_DISPUTE_DISCRIMINATOR }),\n );\n}\n\nexport function getCancelDisputeInstructionDataDecoder(): FixedSizeDecoder<CancelDisputeInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n ]);\n}\n\nexport function getCancelDisputeInstructionDataCodec(): FixedSizeCodec<\n CancelDisputeInstructionDataArgs,\n CancelDisputeInstructionData\n> {\n return combineCodec(\n getCancelDisputeInstructionDataEncoder(),\n getCancelDisputeInstructionDataDecoder(),\n );\n}\n\nexport type CancelDisputeAsyncInput<\n TAccountCaller extends string = string,\n TAccountSubaccord extends string = string,\n TAccountDispute extends string = string,\n TAccountFeeToken extends string = string,\n TAccountFilerTokenAccount extends string = string,\n TAccountFeeVault extends string = string,\n TAccountTokenProgram extends string = string,\n> = {\n /** Any cranker; no authority check (the elapsed timeout is the gate). */\n caller: TransactionSigner<TAccountCaller>;\n subaccord: Address<TAccountSubaccord>;\n dispute: Address<TAccountDispute>;\n feeToken: Address<TAccountFeeToken>;\n /** Refund destination — must be the filer's ATA. */\n filerTokenAccount: Address<TAccountFilerTokenAccount>;\n feeVault?: Address<TAccountFeeVault>;\n tokenProgram?: Address<TAccountTokenProgram>;\n};\n\nexport async function getCancelDisputeInstructionAsync<\n TAccountCaller extends string,\n TAccountSubaccord extends string,\n TAccountDispute extends string,\n TAccountFeeToken extends string,\n TAccountFilerTokenAccount extends string,\n TAccountFeeVault extends string,\n TAccountTokenProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: CancelDisputeAsyncInput<\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountFeeToken,\n TAccountFilerTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n CancelDisputeInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountFeeToken,\n TAccountFilerTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n caller: { value: input.caller ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n dispute: { value: input.dispute ?? null, isWritable: true },\n feeToken: { value: input.feeToken ?? null, isWritable: false },\n filerTokenAccount: {\n value: input.filerTokenAccount ?? null,\n isWritable: true,\n },\n feeVault: { value: input.feeVault ?? null, isWritable: true },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Resolve default values.\n if (!accounts.feeVault.value) {\n accounts.feeVault.value = await getProgramDerivedAddress({\n programAddress:\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\" as Address<\"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\">,\n seeds: [\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"subaccord\",\n accounts.subaccord.value,\n ),\n ),\n getBytesEncoder().encode(\n new Uint8Array([\n 6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206, 235,\n 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140, 245, 133,\n 126, 255, 0, 169,\n ]),\n ),\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"feeToken\",\n accounts.feeToken.value,\n ),\n ),\n ],\n });\n }\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\" as Address<\"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"caller\", accounts.caller),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"dispute\", accounts.dispute),\n getAccountMeta(\"feeToken\", accounts.feeToken),\n getAccountMeta(\"filerTokenAccount\", accounts.filerTokenAccount),\n getAccountMeta(\"feeVault\", accounts.feeVault),\n getAccountMeta(\"tokenProgram\", accounts.tokenProgram),\n ],\n data: getCancelDisputeInstructionDataEncoder().encode({}),\n programAddress,\n } as CancelDisputeInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountFeeToken,\n TAccountFilerTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n >);\n}\n\nexport type CancelDisputeInput<\n TAccountCaller extends string = string,\n TAccountSubaccord extends string = string,\n TAccountDispute extends string = string,\n TAccountFeeToken extends string = string,\n TAccountFilerTokenAccount extends string = string,\n TAccountFeeVault extends string = string,\n TAccountTokenProgram extends string = string,\n> = {\n /** Any cranker; no authority check (the elapsed timeout is the gate). */\n caller: TransactionSigner<TAccountCaller>;\n subaccord: Address<TAccountSubaccord>;\n dispute: Address<TAccountDispute>;\n feeToken: Address<TAccountFeeToken>;\n /** Refund destination — must be the filer's ATA. */\n filerTokenAccount: Address<TAccountFilerTokenAccount>;\n feeVault: Address<TAccountFeeVault>;\n tokenProgram?: Address<TAccountTokenProgram>;\n};\n\nexport function getCancelDisputeInstruction<\n TAccountCaller extends string,\n TAccountSubaccord extends string,\n TAccountDispute extends string,\n TAccountFeeToken extends string,\n TAccountFilerTokenAccount extends string,\n TAccountFeeVault extends string,\n TAccountTokenProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: CancelDisputeInput<\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountFeeToken,\n TAccountFilerTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): CancelDisputeInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountFeeToken,\n TAccountFilerTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n caller: { value: input.caller ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n dispute: { value: input.dispute ?? null, isWritable: true },\n feeToken: { value: input.feeToken ?? null, isWritable: false },\n filerTokenAccount: {\n value: input.filerTokenAccount ?? null,\n isWritable: true,\n },\n feeVault: { value: input.feeVault ?? null, isWritable: true },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Resolve default values.\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\" as Address<\"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"caller\", accounts.caller),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"dispute\", accounts.dispute),\n getAccountMeta(\"feeToken\", accounts.feeToken),\n getAccountMeta(\"filerTokenAccount\", accounts.filerTokenAccount),\n getAccountMeta(\"feeVault\", accounts.feeVault),\n getAccountMeta(\"tokenProgram\", accounts.tokenProgram),\n ],\n data: getCancelDisputeInstructionDataEncoder().encode({}),\n programAddress,\n } as CancelDisputeInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountFeeToken,\n TAccountFilerTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n >);\n}\n\nexport type ParsedCancelDisputeInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** Any cranker; no authority check (the elapsed timeout is the gate). */\n caller: TAccountMetas[0];\n subaccord: TAccountMetas[1];\n dispute: TAccountMetas[2];\n feeToken: TAccountMetas[3];\n /** Refund destination — must be the filer's ATA. */\n filerTokenAccount: TAccountMetas[4];\n feeVault: TAccountMetas[5];\n tokenProgram: TAccountMetas[6];\n };\n data: CancelDisputeInstructionData;\n};\n\nexport function parseCancelDisputeInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedCancelDisputeInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 7) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 7,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n caller: getNextAccount(),\n subaccord: getNextAccount(),\n dispute: getNextAccount(),\n feeToken: getNextAccount(),\n filerTokenAccount: getNextAccount(),\n feeVault: getNextAccount(),\n tokenProgram: getNextAccount(),\n },\n data: getCancelDisputeInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getAddressEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n getU32Decoder,\n getU32Encoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n getAddressFromResolvedInstructionAccount,\n getNonNullResolvedInstructionInput,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { findAppealBondPda } from \"../pdas\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\n\nexport const CLAIM_APPEAL_REFUND_DISCRIMINATOR: ReadonlyUint8Array =\n new Uint8Array([210, 169, 229, 146, 187, 30, 61, 176]);\n\nexport function getClaimAppealRefundDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n CLAIM_APPEAL_REFUND_DISCRIMINATOR,\n );\n}\n\nexport type ClaimAppealRefundInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountCaller extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountDispute extends string | AccountMeta<string> = string,\n TAccountAppealBond extends string | AccountMeta<string> = string,\n TAccountFeeToken extends string | AccountMeta<string> = string,\n TAccountClaimantTokenAccount extends string | AccountMeta<string> = string,\n TAccountFeeVault extends string | AccountMeta<string> = string,\n TAccountTokenProgram extends string | AccountMeta<string> =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\",\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountCaller extends string\n ? WritableSignerAccount<TAccountCaller> &\n AccountSignerMeta<TAccountCaller>\n : TAccountCaller,\n TAccountSubaccord extends string\n ? WritableAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountDispute extends string\n ? ReadonlyAccount<TAccountDispute>\n : TAccountDispute,\n TAccountAppealBond extends string\n ? WritableAccount<TAccountAppealBond>\n : TAccountAppealBond,\n TAccountFeeToken extends string\n ? ReadonlyAccount<TAccountFeeToken>\n : TAccountFeeToken,\n TAccountClaimantTokenAccount extends string\n ? WritableAccount<TAccountClaimantTokenAccount>\n : TAccountClaimantTokenAccount,\n TAccountFeeVault extends string\n ? WritableAccount<TAccountFeeVault>\n : TAccountFeeVault,\n TAccountTokenProgram extends string\n ? ReadonlyAccount<TAccountTokenProgram>\n : TAccountTokenProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type ClaimAppealRefundInstructionData = {\n discriminator: ReadonlyUint8Array;\n roundIdx: number;\n};\n\nexport type ClaimAppealRefundInstructionDataArgs = { roundIdx: number };\n\nexport function getClaimAppealRefundInstructionDataEncoder(): FixedSizeEncoder<ClaimAppealRefundInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"roundIdx\", getU32Encoder()],\n ]),\n (value) => ({ ...value, discriminator: CLAIM_APPEAL_REFUND_DISCRIMINATOR }),\n );\n}\n\nexport function getClaimAppealRefundInstructionDataDecoder(): FixedSizeDecoder<ClaimAppealRefundInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"roundIdx\", getU32Decoder()],\n ]);\n}\n\nexport function getClaimAppealRefundInstructionDataCodec(): FixedSizeCodec<\n ClaimAppealRefundInstructionDataArgs,\n ClaimAppealRefundInstructionData\n> {\n return combineCodec(\n getClaimAppealRefundInstructionDataEncoder(),\n getClaimAppealRefundInstructionDataDecoder(),\n );\n}\n\nexport type ClaimAppealRefundAsyncInput<\n TAccountCaller extends string = string,\n TAccountSubaccord extends string = string,\n TAccountDispute extends string = string,\n TAccountAppealBond extends string = string,\n TAccountFeeToken extends string = string,\n TAccountClaimantTokenAccount extends string = string,\n TAccountFeeVault extends string = string,\n TAccountTokenProgram extends string = string,\n> = {\n caller: TransactionSigner<TAccountCaller>;\n subaccord: Address<TAccountSubaccord>;\n dispute: Address<TAccountDispute>;\n /** The specific appeal bond being claimed. */\n appealBond?: Address<TAccountAppealBond>;\n feeToken: Address<TAccountFeeToken>;\n /**\n * The appellant's ATA — sweep destination. Any caller may pass it; the\n * handler rejects it unless its owner matches the bond's recorded appellant.\n */\n claimantTokenAccount: Address<TAccountClaimantTokenAccount>;\n feeVault?: Address<TAccountFeeVault>;\n tokenProgram?: Address<TAccountTokenProgram>;\n roundIdx: ClaimAppealRefundInstructionDataArgs[\"roundIdx\"];\n};\n\nexport async function getClaimAppealRefundInstructionAsync<\n TAccountCaller extends string,\n TAccountSubaccord extends string,\n TAccountDispute extends string,\n TAccountAppealBond extends string,\n TAccountFeeToken extends string,\n TAccountClaimantTokenAccount extends string,\n TAccountFeeVault extends string,\n TAccountTokenProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: ClaimAppealRefundAsyncInput<\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountAppealBond,\n TAccountFeeToken,\n TAccountClaimantTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n ClaimAppealRefundInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountAppealBond,\n TAccountFeeToken,\n TAccountClaimantTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n caller: { value: input.caller ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n dispute: { value: input.dispute ?? null, isWritable: false },\n appealBond: { value: input.appealBond ?? null, isWritable: true },\n feeToken: { value: input.feeToken ?? null, isWritable: false },\n claimantTokenAccount: {\n value: input.claimantTokenAccount ?? null,\n isWritable: true,\n },\n feeVault: { value: input.feeVault ?? null, isWritable: true },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.appealBond.value) {\n accounts.appealBond.value = await findAppealBondPda({\n dispute: getAddressFromResolvedInstructionAccount(\n \"dispute\",\n accounts.dispute.value,\n ),\n roundIdx: getNonNullResolvedInstructionInput(\"roundIdx\", args.roundIdx),\n });\n }\n if (!accounts.feeVault.value) {\n accounts.feeVault.value = await getProgramDerivedAddress({\n programAddress:\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\" as Address<\"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\">,\n seeds: [\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"subaccord\",\n accounts.subaccord.value,\n ),\n ),\n getBytesEncoder().encode(\n new Uint8Array([\n 6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206, 235,\n 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140, 245, 133,\n 126, 255, 0, 169,\n ]),\n ),\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"feeToken\",\n accounts.feeToken.value,\n ),\n ),\n ],\n });\n }\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\" as Address<\"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"caller\", accounts.caller),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"dispute\", accounts.dispute),\n getAccountMeta(\"appealBond\", accounts.appealBond),\n getAccountMeta(\"feeToken\", accounts.feeToken),\n getAccountMeta(\"claimantTokenAccount\", accounts.claimantTokenAccount),\n getAccountMeta(\"feeVault\", accounts.feeVault),\n getAccountMeta(\"tokenProgram\", accounts.tokenProgram),\n ],\n data: getClaimAppealRefundInstructionDataEncoder().encode(\n args as ClaimAppealRefundInstructionDataArgs,\n ),\n programAddress,\n } as ClaimAppealRefundInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountAppealBond,\n TAccountFeeToken,\n TAccountClaimantTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n >);\n}\n\nexport type ClaimAppealRefundInput<\n TAccountCaller extends string = string,\n TAccountSubaccord extends string = string,\n TAccountDispute extends string = string,\n TAccountAppealBond extends string = string,\n TAccountFeeToken extends string = string,\n TAccountClaimantTokenAccount extends string = string,\n TAccountFeeVault extends string = string,\n TAccountTokenProgram extends string = string,\n> = {\n caller: TransactionSigner<TAccountCaller>;\n subaccord: Address<TAccountSubaccord>;\n dispute: Address<TAccountDispute>;\n /** The specific appeal bond being claimed. */\n appealBond: Address<TAccountAppealBond>;\n feeToken: Address<TAccountFeeToken>;\n /**\n * The appellant's ATA — sweep destination. Any caller may pass it; the\n * handler rejects it unless its owner matches the bond's recorded appellant.\n */\n claimantTokenAccount: Address<TAccountClaimantTokenAccount>;\n feeVault: Address<TAccountFeeVault>;\n tokenProgram?: Address<TAccountTokenProgram>;\n roundIdx: ClaimAppealRefundInstructionDataArgs[\"roundIdx\"];\n};\n\nexport function getClaimAppealRefundInstruction<\n TAccountCaller extends string,\n TAccountSubaccord extends string,\n TAccountDispute extends string,\n TAccountAppealBond extends string,\n TAccountFeeToken extends string,\n TAccountClaimantTokenAccount extends string,\n TAccountFeeVault extends string,\n TAccountTokenProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: ClaimAppealRefundInput<\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountAppealBond,\n TAccountFeeToken,\n TAccountClaimantTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): ClaimAppealRefundInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountAppealBond,\n TAccountFeeToken,\n TAccountClaimantTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n caller: { value: input.caller ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n dispute: { value: input.dispute ?? null, isWritable: false },\n appealBond: { value: input.appealBond ?? null, isWritable: true },\n feeToken: { value: input.feeToken ?? null, isWritable: false },\n claimantTokenAccount: {\n value: input.claimantTokenAccount ?? null,\n isWritable: true,\n },\n feeVault: { value: input.feeVault ?? null, isWritable: true },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\" as Address<\"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"caller\", accounts.caller),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"dispute\", accounts.dispute),\n getAccountMeta(\"appealBond\", accounts.appealBond),\n getAccountMeta(\"feeToken\", accounts.feeToken),\n getAccountMeta(\"claimantTokenAccount\", accounts.claimantTokenAccount),\n getAccountMeta(\"feeVault\", accounts.feeVault),\n getAccountMeta(\"tokenProgram\", accounts.tokenProgram),\n ],\n data: getClaimAppealRefundInstructionDataEncoder().encode(\n args as ClaimAppealRefundInstructionDataArgs,\n ),\n programAddress,\n } as ClaimAppealRefundInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountAppealBond,\n TAccountFeeToken,\n TAccountClaimantTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n >);\n}\n\nexport type ParsedClaimAppealRefundInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n caller: TAccountMetas[0];\n subaccord: TAccountMetas[1];\n dispute: TAccountMetas[2];\n /** The specific appeal bond being claimed. */\n appealBond: TAccountMetas[3];\n feeToken: TAccountMetas[4];\n /**\n * The appellant's ATA — sweep destination. Any caller may pass it; the\n * handler rejects it unless its owner matches the bond's recorded appellant.\n */\n claimantTokenAccount: TAccountMetas[5];\n feeVault: TAccountMetas[6];\n tokenProgram: TAccountMetas[7];\n };\n data: ClaimAppealRefundInstructionData;\n};\n\nexport function parseClaimAppealRefundInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedClaimAppealRefundInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 8) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 8,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n caller: getNextAccount(),\n subaccord: getNextAccount(),\n dispute: getNextAccount(),\n appealBond: getNextAccount(),\n feeToken: getNextAccount(),\n claimantTokenAccount: getNextAccount(),\n feeVault: getNextAccount(),\n tokenProgram: getNextAccount(),\n },\n data: getClaimAppealRefundInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\n\nexport const COMMIT_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 223, 140, 142, 165, 229, 208, 156, 74,\n]);\n\nexport function getCommitDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(COMMIT_DISCRIMINATOR);\n}\n\nexport type CommitInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountJuror extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountDispute extends string | AccountMeta<string> = string,\n TAccountRound extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountJuror extends string\n ? WritableSignerAccount<TAccountJuror> &\n AccountSignerMeta<TAccountJuror>\n : TAccountJuror,\n TAccountSubaccord extends string\n ? ReadonlyAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountDispute extends string\n ? WritableAccount<TAccountDispute>\n : TAccountDispute,\n TAccountRound extends string\n ? WritableAccount<TAccountRound>\n : TAccountRound,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type CommitInstructionData = {\n discriminator: ReadonlyUint8Array;\n commitment: ReadonlyUint8Array;\n};\n\nexport type CommitInstructionDataArgs = { commitment: ReadonlyUint8Array };\n\nexport function getCommitInstructionDataEncoder(): FixedSizeEncoder<CommitInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"commitment\", fixEncoderSize(getBytesEncoder(), 32)],\n ]),\n (value) => ({ ...value, discriminator: COMMIT_DISCRIMINATOR }),\n );\n}\n\nexport function getCommitInstructionDataDecoder(): FixedSizeDecoder<CommitInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"commitment\", fixDecoderSize(getBytesDecoder(), 32)],\n ]);\n}\n\nexport function getCommitInstructionDataCodec(): FixedSizeCodec<\n CommitInstructionDataArgs,\n CommitInstructionData\n> {\n return combineCodec(\n getCommitInstructionDataEncoder(),\n getCommitInstructionDataDecoder(),\n );\n}\n\nexport type CommitInput<\n TAccountJuror extends string = string,\n TAccountSubaccord extends string = string,\n TAccountDispute extends string = string,\n TAccountRound extends string = string,\n> = {\n juror: TransactionSigner<TAccountJuror>;\n subaccord: Address<TAccountSubaccord>;\n dispute: Address<TAccountDispute>;\n round: Address<TAccountRound>;\n commitment: CommitInstructionDataArgs[\"commitment\"];\n};\n\nexport function getCommitInstruction<\n TAccountJuror extends string,\n TAccountSubaccord extends string,\n TAccountDispute extends string,\n TAccountRound extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: CommitInput<\n TAccountJuror,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound\n >,\n config?: { programAddress?: TProgramAddress },\n): CommitInstruction<\n TProgramAddress,\n TAccountJuror,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n juror: { value: input.juror ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: false },\n dispute: { value: input.dispute ?? null, isWritable: true },\n round: { value: input.round ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"juror\", accounts.juror),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"dispute\", accounts.dispute),\n getAccountMeta(\"round\", accounts.round),\n ],\n data: getCommitInstructionDataEncoder().encode(\n args as CommitInstructionDataArgs,\n ),\n programAddress,\n } as CommitInstruction<\n TProgramAddress,\n TAccountJuror,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound\n >);\n}\n\nexport type ParsedCommitInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n juror: TAccountMetas[0];\n subaccord: TAccountMetas[1];\n dispute: TAccountMetas[2];\n round: TAccountMetas[3];\n };\n data: CommitInstructionData;\n};\n\nexport function parseCommitInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedCommitInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 4) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 4,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n juror: getNextAccount(),\n subaccord: getNextAccount(),\n dispute: getNextAccount(),\n round: getNextAccount(),\n },\n data: getCommitInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlySignerAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\n\nexport const COMMIT_VRF_CALLBACK_DISCRIMINATOR: ReadonlyUint8Array =\n new Uint8Array([51, 127, 131, 85, 83, 117, 121, 59]);\n\nexport function getCommitVrfCallbackDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n COMMIT_VRF_CALLBACK_DISCRIMINATOR,\n );\n}\n\nexport type CommitVrfCallbackInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountVrfProgramIdentity extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountDispute extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountVrfProgramIdentity extends string\n ? ReadonlySignerAccount<TAccountVrfProgramIdentity> &\n AccountSignerMeta<TAccountVrfProgramIdentity>\n : TAccountVrfProgramIdentity,\n TAccountSubaccord extends string\n ? ReadonlyAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountDispute extends string\n ? WritableAccount<TAccountDispute>\n : TAccountDispute,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type CommitVrfCallbackInstructionData = {\n discriminator: ReadonlyUint8Array;\n randomness: ReadonlyUint8Array;\n};\n\nexport type CommitVrfCallbackInstructionDataArgs = {\n randomness: ReadonlyUint8Array;\n};\n\nexport function getCommitVrfCallbackInstructionDataEncoder(): FixedSizeEncoder<CommitVrfCallbackInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"randomness\", fixEncoderSize(getBytesEncoder(), 32)],\n ]),\n (value) => ({ ...value, discriminator: COMMIT_VRF_CALLBACK_DISCRIMINATOR }),\n );\n}\n\nexport function getCommitVrfCallbackInstructionDataDecoder(): FixedSizeDecoder<CommitVrfCallbackInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"randomness\", fixDecoderSize(getBytesDecoder(), 32)],\n ]);\n}\n\nexport function getCommitVrfCallbackInstructionDataCodec(): FixedSizeCodec<\n CommitVrfCallbackInstructionDataArgs,\n CommitVrfCallbackInstructionData\n> {\n return combineCodec(\n getCommitVrfCallbackInstructionDataEncoder(),\n getCommitVrfCallbackInstructionDataDecoder(),\n );\n}\n\nexport type CommitVrfCallbackInput<\n TAccountVrfProgramIdentity extends string = string,\n TAccountSubaccord extends string = string,\n TAccountDispute extends string = string,\n> = {\n vrfProgramIdentity: TransactionSigner<TAccountVrfProgramIdentity>;\n subaccord: Address<TAccountSubaccord>;\n dispute: Address<TAccountDispute>;\n randomness: CommitVrfCallbackInstructionDataArgs[\"randomness\"];\n};\n\nexport function getCommitVrfCallbackInstruction<\n TAccountVrfProgramIdentity extends string,\n TAccountSubaccord extends string,\n TAccountDispute extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: CommitVrfCallbackInput<\n TAccountVrfProgramIdentity,\n TAccountSubaccord,\n TAccountDispute\n >,\n config?: { programAddress?: TProgramAddress },\n): CommitVrfCallbackInstruction<\n TProgramAddress,\n TAccountVrfProgramIdentity,\n TAccountSubaccord,\n TAccountDispute\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n vrfProgramIdentity: {\n value: input.vrfProgramIdentity ?? null,\n isWritable: false,\n },\n subaccord: { value: input.subaccord ?? null, isWritable: false },\n dispute: { value: input.dispute ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"vrfProgramIdentity\", accounts.vrfProgramIdentity),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"dispute\", accounts.dispute),\n ],\n data: getCommitVrfCallbackInstructionDataEncoder().encode(\n args as CommitVrfCallbackInstructionDataArgs,\n ),\n programAddress,\n } as CommitVrfCallbackInstruction<\n TProgramAddress,\n TAccountVrfProgramIdentity,\n TAccountSubaccord,\n TAccountDispute\n >);\n}\n\nexport type ParsedCommitVrfCallbackInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n vrfProgramIdentity: TAccountMetas[0];\n subaccord: TAccountMetas[1];\n dispute: TAccountMetas[2];\n };\n data: CommitVrfCallbackInstructionData;\n};\n\nexport function parseCommitVrfCallbackInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedCommitVrfCallbackInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 3) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 3,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n vrfProgramIdentity: getNextAccount(),\n subaccord: getNextAccount(),\n dispute: getNextAccount(),\n },\n data: getCommitVrfCallbackInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getAddressEncoder,\n getArrayDecoder,\n getArrayEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n getAddressFromResolvedInstructionAccount,\n getNonNullResolvedInstructionInput,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { findAccordStatePda, findDisputePda } from \"../pdas\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\n\nexport const CREATE_DISPUTE_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 161, 99, 53, 116, 60, 79, 149, 105,\n]);\n\nexport function getCreateDisputeDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n CREATE_DISPUTE_DISCRIMINATOR,\n );\n}\n\nexport type CreateDisputeInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountFiler extends string | AccountMeta<string> = string,\n TAccountRentPayer extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountAccordState extends string | AccountMeta<string> = string,\n TAccountDispute extends string | AccountMeta<string> = string,\n TAccountFeeToken extends string | AccountMeta<string> = string,\n TAccountFilerTokenAccount extends string | AccountMeta<string> = string,\n TAccountFeeVault extends string | AccountMeta<string> = string,\n TAccountTokenProgram extends string | AccountMeta<string> =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\",\n TAccountAssociatedTokenProgram extends string | AccountMeta<string> =\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\",\n TAccountSystemProgram extends string | AccountMeta<string> =\n \"11111111111111111111111111111111\",\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountFiler extends string\n ? WritableSignerAccount<TAccountFiler> &\n AccountSignerMeta<TAccountFiler>\n : TAccountFiler,\n TAccountRentPayer extends string\n ? WritableSignerAccount<TAccountRentPayer> &\n AccountSignerMeta<TAccountRentPayer>\n : TAccountRentPayer,\n TAccountSubaccord extends string\n ? WritableAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountAccordState extends string\n ? ReadonlyAccount<TAccountAccordState>\n : TAccountAccordState,\n TAccountDispute extends string\n ? WritableAccount<TAccountDispute>\n : TAccountDispute,\n TAccountFeeToken extends string\n ? ReadonlyAccount<TAccountFeeToken>\n : TAccountFeeToken,\n TAccountFilerTokenAccount extends string\n ? WritableAccount<TAccountFilerTokenAccount>\n : TAccountFilerTokenAccount,\n TAccountFeeVault extends string\n ? WritableAccount<TAccountFeeVault>\n : TAccountFeeVault,\n TAccountTokenProgram extends string\n ? ReadonlyAccount<TAccountTokenProgram>\n : TAccountTokenProgram,\n TAccountAssociatedTokenProgram extends string\n ? ReadonlyAccount<TAccountAssociatedTokenProgram>\n : TAccountAssociatedTokenProgram,\n TAccountSystemProgram extends string\n ? ReadonlyAccount<TAccountSystemProgram>\n : TAccountSystemProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type CreateDisputeInstructionData = {\n discriminator: ReadonlyUint8Array;\n options: Array<ReadonlyUint8Array>;\n evidenceHash: ReadonlyUint8Array;\n nonce: bigint;\n fee: bigint;\n};\n\nexport type CreateDisputeInstructionDataArgs = {\n options: Array<ReadonlyUint8Array>;\n evidenceHash: ReadonlyUint8Array;\n nonce: number | bigint;\n fee: number | bigint;\n};\n\nexport function getCreateDisputeInstructionDataEncoder(): Encoder<CreateDisputeInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"options\", getArrayEncoder(fixEncoderSize(getBytesEncoder(), 32))],\n [\"evidenceHash\", fixEncoderSize(getBytesEncoder(), 32)],\n [\"nonce\", getU64Encoder()],\n [\"fee\", getU64Encoder()],\n ]),\n (value) => ({ ...value, discriminator: CREATE_DISPUTE_DISCRIMINATOR }),\n );\n}\n\nexport function getCreateDisputeInstructionDataDecoder(): Decoder<CreateDisputeInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"options\", getArrayDecoder(fixDecoderSize(getBytesDecoder(), 32))],\n [\"evidenceHash\", fixDecoderSize(getBytesDecoder(), 32)],\n [\"nonce\", getU64Decoder()],\n [\"fee\", getU64Decoder()],\n ]);\n}\n\nexport function getCreateDisputeInstructionDataCodec(): Codec<\n CreateDisputeInstructionDataArgs,\n CreateDisputeInstructionData\n> {\n return combineCodec(\n getCreateDisputeInstructionDataEncoder(),\n getCreateDisputeInstructionDataDecoder(),\n );\n}\n\nexport type CreateDisputeAsyncInput<\n TAccountFiler extends string = string,\n TAccountRentPayer extends string = string,\n TAccountSubaccord extends string = string,\n TAccountAccordState extends string = string,\n TAccountDispute extends string = string,\n TAccountFeeToken extends string = string,\n TAccountFilerTokenAccount extends string = string,\n TAccountFeeVault extends string = string,\n TAccountTokenProgram extends string = string,\n TAccountAssociatedTokenProgram extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n filer: TransactionSigner<TAccountFiler>;\n /**\n * Rent payer for the dispute `init` + fee_vault `init_if_needed`. MUST be\n * data-free (the system program rejects lamport transfers from\n * data-carrying accounts), so Arbitrables whose filer is a data-carrying\n * PDA pass their crank caller here; wallet filers pass themselves. The\n * dispute-fee itself still flows from `filer_token_account` — this\n * account only carries rent lamports (canon.challenge.spec BLOCKER fix).\n */\n rentPayer: TransactionSigner<TAccountRentPayer>;\n subaccord: Address<TAccountSubaccord>;\n accordState?: Address<TAccountAccordState>;\n dispute?: Address<TAccountDispute>;\n feeToken: Address<TAccountFeeToken>;\n filerTokenAccount?: Address<TAccountFilerTokenAccount>;\n /**\n * Subaccord PDA's fee_vault ATA (ADR-0020). Created on first dispute if\n * it doesn't exist yet.\n */\n feeVault?: Address<TAccountFeeVault>;\n tokenProgram?: Address<TAccountTokenProgram>;\n associatedTokenProgram?: Address<TAccountAssociatedTokenProgram>;\n systemProgram?: Address<TAccountSystemProgram>;\n options: CreateDisputeInstructionDataArgs[\"options\"];\n evidenceHash: CreateDisputeInstructionDataArgs[\"evidenceHash\"];\n nonce: CreateDisputeInstructionDataArgs[\"nonce\"];\n fee: CreateDisputeInstructionDataArgs[\"fee\"];\n};\n\nexport async function getCreateDisputeInstructionAsync<\n TAccountFiler extends string,\n TAccountRentPayer extends string,\n TAccountSubaccord extends string,\n TAccountAccordState extends string,\n TAccountDispute extends string,\n TAccountFeeToken extends string,\n TAccountFilerTokenAccount extends string,\n TAccountFeeVault extends string,\n TAccountTokenProgram extends string,\n TAccountAssociatedTokenProgram extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: CreateDisputeAsyncInput<\n TAccountFiler,\n TAccountRentPayer,\n TAccountSubaccord,\n TAccountAccordState,\n TAccountDispute,\n TAccountFeeToken,\n TAccountFilerTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram,\n TAccountAssociatedTokenProgram,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n CreateDisputeInstruction<\n TProgramAddress,\n TAccountFiler,\n TAccountRentPayer,\n TAccountSubaccord,\n TAccountAccordState,\n TAccountDispute,\n TAccountFeeToken,\n TAccountFilerTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram,\n TAccountAssociatedTokenProgram,\n TAccountSystemProgram\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n filer: { value: input.filer ?? null, isWritable: true },\n rentPayer: { value: input.rentPayer ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n accordState: { value: input.accordState ?? null, isWritable: false },\n dispute: { value: input.dispute ?? null, isWritable: true },\n feeToken: { value: input.feeToken ?? null, isWritable: false },\n filerTokenAccount: {\n value: input.filerTokenAccount ?? null,\n isWritable: true,\n },\n feeVault: { value: input.feeVault ?? null, isWritable: true },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n associatedTokenProgram: {\n value: input.associatedTokenProgram ?? null,\n isWritable: false,\n },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.accordState.value) {\n accounts.accordState.value = await findAccordStatePda();\n }\n if (!accounts.dispute.value) {\n accounts.dispute.value = await findDisputePda({\n filer: getAddressFromResolvedInstructionAccount(\n \"filer\",\n accounts.filer.value,\n ),\n nonce: getNonNullResolvedInstructionInput(\"nonce\", args.nonce),\n });\n }\n if (!accounts.filerTokenAccount.value) {\n accounts.filerTokenAccount.value = await getProgramDerivedAddress({\n programAddress:\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\" as Address<\"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\">,\n seeds: [\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"filer\",\n accounts.filer.value,\n ),\n ),\n getBytesEncoder().encode(\n new Uint8Array([\n 6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206, 235,\n 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140, 245, 133,\n 126, 255, 0, 169,\n ]),\n ),\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"feeToken\",\n accounts.feeToken.value,\n ),\n ),\n ],\n });\n }\n if (!accounts.feeVault.value) {\n accounts.feeVault.value = await getProgramDerivedAddress({\n programAddress:\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\" as Address<\"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\">,\n seeds: [\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"subaccord\",\n accounts.subaccord.value,\n ),\n ),\n getBytesEncoder().encode(\n new Uint8Array([\n 6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206, 235,\n 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140, 245, 133,\n 126, 255, 0, 169,\n ]),\n ),\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"feeToken\",\n accounts.feeToken.value,\n ),\n ),\n ],\n });\n }\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\" as Address<\"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\">;\n }\n if (!accounts.associatedTokenProgram.value) {\n accounts.associatedTokenProgram.value =\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\" as Address<\"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\">;\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n \"11111111111111111111111111111111\" as Address<\"11111111111111111111111111111111\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"filer\", accounts.filer),\n getAccountMeta(\"rentPayer\", accounts.rentPayer),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"accordState\", accounts.accordState),\n getAccountMeta(\"dispute\", accounts.dispute),\n getAccountMeta(\"feeToken\", accounts.feeToken),\n getAccountMeta(\"filerTokenAccount\", accounts.filerTokenAccount),\n getAccountMeta(\"feeVault\", accounts.feeVault),\n getAccountMeta(\"tokenProgram\", accounts.tokenProgram),\n getAccountMeta(\"associatedTokenProgram\", accounts.associatedTokenProgram),\n getAccountMeta(\"systemProgram\", accounts.systemProgram),\n ],\n data: getCreateDisputeInstructionDataEncoder().encode(\n args as CreateDisputeInstructionDataArgs,\n ),\n programAddress,\n } as CreateDisputeInstruction<\n TProgramAddress,\n TAccountFiler,\n TAccountRentPayer,\n TAccountSubaccord,\n TAccountAccordState,\n TAccountDispute,\n TAccountFeeToken,\n TAccountFilerTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram,\n TAccountAssociatedTokenProgram,\n TAccountSystemProgram\n >);\n}\n\nexport type CreateDisputeInput<\n TAccountFiler extends string = string,\n TAccountRentPayer extends string = string,\n TAccountSubaccord extends string = string,\n TAccountAccordState extends string = string,\n TAccountDispute extends string = string,\n TAccountFeeToken extends string = string,\n TAccountFilerTokenAccount extends string = string,\n TAccountFeeVault extends string = string,\n TAccountTokenProgram extends string = string,\n TAccountAssociatedTokenProgram extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n filer: TransactionSigner<TAccountFiler>;\n /**\n * Rent payer for the dispute `init` + fee_vault `init_if_needed`. MUST be\n * data-free (the system program rejects lamport transfers from\n * data-carrying accounts), so Arbitrables whose filer is a data-carrying\n * PDA pass their crank caller here; wallet filers pass themselves. The\n * dispute-fee itself still flows from `filer_token_account` — this\n * account only carries rent lamports (canon.challenge.spec BLOCKER fix).\n */\n rentPayer: TransactionSigner<TAccountRentPayer>;\n subaccord: Address<TAccountSubaccord>;\n accordState: Address<TAccountAccordState>;\n dispute: Address<TAccountDispute>;\n feeToken: Address<TAccountFeeToken>;\n filerTokenAccount: Address<TAccountFilerTokenAccount>;\n /**\n * Subaccord PDA's fee_vault ATA (ADR-0020). Created on first dispute if\n * it doesn't exist yet.\n */\n feeVault: Address<TAccountFeeVault>;\n tokenProgram?: Address<TAccountTokenProgram>;\n associatedTokenProgram?: Address<TAccountAssociatedTokenProgram>;\n systemProgram?: Address<TAccountSystemProgram>;\n options: CreateDisputeInstructionDataArgs[\"options\"];\n evidenceHash: CreateDisputeInstructionDataArgs[\"evidenceHash\"];\n nonce: CreateDisputeInstructionDataArgs[\"nonce\"];\n fee: CreateDisputeInstructionDataArgs[\"fee\"];\n};\n\nexport function getCreateDisputeInstruction<\n TAccountFiler extends string,\n TAccountRentPayer extends string,\n TAccountSubaccord extends string,\n TAccountAccordState extends string,\n TAccountDispute extends string,\n TAccountFeeToken extends string,\n TAccountFilerTokenAccount extends string,\n TAccountFeeVault extends string,\n TAccountTokenProgram extends string,\n TAccountAssociatedTokenProgram extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: CreateDisputeInput<\n TAccountFiler,\n TAccountRentPayer,\n TAccountSubaccord,\n TAccountAccordState,\n TAccountDispute,\n TAccountFeeToken,\n TAccountFilerTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram,\n TAccountAssociatedTokenProgram,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): CreateDisputeInstruction<\n TProgramAddress,\n TAccountFiler,\n TAccountRentPayer,\n TAccountSubaccord,\n TAccountAccordState,\n TAccountDispute,\n TAccountFeeToken,\n TAccountFilerTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram,\n TAccountAssociatedTokenProgram,\n TAccountSystemProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n filer: { value: input.filer ?? null, isWritable: true },\n rentPayer: { value: input.rentPayer ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n accordState: { value: input.accordState ?? null, isWritable: false },\n dispute: { value: input.dispute ?? null, isWritable: true },\n feeToken: { value: input.feeToken ?? null, isWritable: false },\n filerTokenAccount: {\n value: input.filerTokenAccount ?? null,\n isWritable: true,\n },\n feeVault: { value: input.feeVault ?? null, isWritable: true },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n associatedTokenProgram: {\n value: input.associatedTokenProgram ?? null,\n isWritable: false,\n },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\" as Address<\"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\">;\n }\n if (!accounts.associatedTokenProgram.value) {\n accounts.associatedTokenProgram.value =\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\" as Address<\"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\">;\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n \"11111111111111111111111111111111\" as Address<\"11111111111111111111111111111111\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"filer\", accounts.filer),\n getAccountMeta(\"rentPayer\", accounts.rentPayer),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"accordState\", accounts.accordState),\n getAccountMeta(\"dispute\", accounts.dispute),\n getAccountMeta(\"feeToken\", accounts.feeToken),\n getAccountMeta(\"filerTokenAccount\", accounts.filerTokenAccount),\n getAccountMeta(\"feeVault\", accounts.feeVault),\n getAccountMeta(\"tokenProgram\", accounts.tokenProgram),\n getAccountMeta(\"associatedTokenProgram\", accounts.associatedTokenProgram),\n getAccountMeta(\"systemProgram\", accounts.systemProgram),\n ],\n data: getCreateDisputeInstructionDataEncoder().encode(\n args as CreateDisputeInstructionDataArgs,\n ),\n programAddress,\n } as CreateDisputeInstruction<\n TProgramAddress,\n TAccountFiler,\n TAccountRentPayer,\n TAccountSubaccord,\n TAccountAccordState,\n TAccountDispute,\n TAccountFeeToken,\n TAccountFilerTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram,\n TAccountAssociatedTokenProgram,\n TAccountSystemProgram\n >);\n}\n\nexport type ParsedCreateDisputeInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n filer: TAccountMetas[0];\n /**\n * Rent payer for the dispute `init` + fee_vault `init_if_needed`. MUST be\n * data-free (the system program rejects lamport transfers from\n * data-carrying accounts), so Arbitrables whose filer is a data-carrying\n * PDA pass their crank caller here; wallet filers pass themselves. The\n * dispute-fee itself still flows from `filer_token_account` — this\n * account only carries rent lamports (canon.challenge.spec BLOCKER fix).\n */\n rentPayer: TAccountMetas[1];\n subaccord: TAccountMetas[2];\n accordState: TAccountMetas[3];\n dispute: TAccountMetas[4];\n feeToken: TAccountMetas[5];\n filerTokenAccount: TAccountMetas[6];\n /**\n * Subaccord PDA's fee_vault ATA (ADR-0020). Created on first dispute if\n * it doesn't exist yet.\n */\n feeVault: TAccountMetas[7];\n tokenProgram: TAccountMetas[8];\n associatedTokenProgram: TAccountMetas[9];\n systemProgram: TAccountMetas[10];\n };\n data: CreateDisputeInstructionData;\n};\n\nexport function parseCreateDisputeInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedCreateDisputeInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 11) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 11,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n filer: getNextAccount(),\n rentPayer: getNextAccount(),\n subaccord: getNextAccount(),\n accordState: getNextAccount(),\n dispute: getNextAccount(),\n feeToken: getNextAccount(),\n filerTokenAccount: getNextAccount(),\n feeVault: getNextAccount(),\n tokenProgram: getNextAccount(),\n associatedTokenProgram: getNextAccount(),\n systemProgram: getNextAccount(),\n },\n data: getCreateDisputeInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n getU16Decoder,\n getU16Encoder,\n getU32Decoder,\n getU32Encoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n getAddressFromResolvedInstructionAccount,\n getNonNullResolvedInstructionInput,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { findSubaccordPda } from \"../pdas\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\nimport {\n getAggregationDecoder,\n getAggregationEncoder,\n getShortfallPolicyDecoder,\n getShortfallPolicyEncoder,\n type Aggregation,\n type AggregationArgs,\n type ShortfallPolicy,\n type ShortfallPolicyArgs,\n} from \"../types\";\n\nexport const CREATE_SUBACCORD_DISCRIMINATOR: ReadonlyUint8Array =\n new Uint8Array([135, 240, 91, 50, 192, 161, 177, 22]);\n\nexport function getCreateSubaccordDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n CREATE_SUBACCORD_DISCRIMINATOR,\n );\n}\n\nexport type CreateSubaccordInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountCreator extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountStakingToken extends string | AccountMeta<string> = string,\n TAccountFeeToken extends string | AccountMeta<string> = string,\n TAccountSystemProgram extends string | AccountMeta<string> =\n \"11111111111111111111111111111111\",\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountCreator extends string\n ? WritableSignerAccount<TAccountCreator> &\n AccountSignerMeta<TAccountCreator>\n : TAccountCreator,\n TAccountSubaccord extends string\n ? WritableAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountStakingToken extends string\n ? ReadonlyAccount<TAccountStakingToken>\n : TAccountStakingToken,\n TAccountFeeToken extends string\n ? ReadonlyAccount<TAccountFeeToken>\n : TAccountFeeToken,\n TAccountSystemProgram extends string\n ? ReadonlyAccount<TAccountSystemProgram>\n : TAccountSystemProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type CreateSubaccordInstructionData = {\n discriminator: ReadonlyUint8Array;\n domainRef: ReadonlyUint8Array;\n evidenceSpec: ReadonlyUint8Array;\n minStake: bigint;\n alphaBps: number;\n reviewWindow: bigint;\n commitWindow: bigint;\n revealWindow: bigint;\n appealWindow: bigint;\n maxAppeals: number;\n /**\n * Round-1 juror panel size (accord-9q3e). Default 3; must be odd and the\n * appeal ladder must fit `MAX_JURORS`. Set 1 + `max_appeals = 0` for a\n * single-juror pool. Immutable on the Subaccord (not in `UpdatePayload`).\n */\n minJurySize: number;\n aggregation: Aggregation;\n feePerJuror: bigint;\n /** Reveal-quorum fraction in bps (ADR-0021). Default 6666 (2/3). */\n revealThresholdBps: number;\n /** Shortfall policy (ADR-0021). v1 = `Redraw`. */\n shortfallPolicy: ShortfallPolicy;\n /** Redraw cap per round (ADR-0021). Default 3. */\n maxDrawAttempts: number;\n /**\n * Coherence tolerance for `Median` pools in bps of the final median\n * (ADR-0025). `0` = exact match. Inert for `Plurality`. Immutable on\n * the Subaccord (not in `UpdatePayload`).\n */\n coherenceTolBps: number;\n authority: Address;\n evidenceOperator: Address;\n depth: number;\n /**\n * Attestation credential binding (PROG-ATTESTTION). `Pubkey::default()`\n * ⇒ stake-only (today's behavior). Both-or-neither with `juror_schema`.\n * Immutable once set on the Subaccord; absent from `UpdatePayload`.\n */\n jurorCredential: Address;\n jurorSchema: Address;\n};\n\nexport type CreateSubaccordInstructionDataArgs = {\n domainRef: ReadonlyUint8Array;\n evidenceSpec: ReadonlyUint8Array;\n minStake: number | bigint;\n alphaBps: number;\n reviewWindow: number | bigint;\n commitWindow: number | bigint;\n revealWindow: number | bigint;\n appealWindow: number | bigint;\n maxAppeals: number;\n /**\n * Round-1 juror panel size (accord-9q3e). Default 3; must be odd and the\n * appeal ladder must fit `MAX_JURORS`. Set 1 + `max_appeals = 0` for a\n * single-juror pool. Immutable on the Subaccord (not in `UpdatePayload`).\n */\n minJurySize: number;\n aggregation: AggregationArgs;\n feePerJuror: number | bigint;\n /** Reveal-quorum fraction in bps (ADR-0021). Default 6666 (2/3). */\n revealThresholdBps: number;\n /** Shortfall policy (ADR-0021). v1 = `Redraw`. */\n shortfallPolicy: ShortfallPolicyArgs;\n /** Redraw cap per round (ADR-0021). Default 3. */\n maxDrawAttempts: number;\n /**\n * Coherence tolerance for `Median` pools in bps of the final median\n * (ADR-0025). `0` = exact match. Inert for `Plurality`. Immutable on\n * the Subaccord (not in `UpdatePayload`).\n */\n coherenceTolBps: number;\n authority: Address;\n evidenceOperator: Address;\n depth: number;\n /**\n * Attestation credential binding (PROG-ATTESTTION). `Pubkey::default()`\n * ⇒ stake-only (today's behavior). Both-or-neither with `juror_schema`.\n * Immutable once set on the Subaccord; absent from `UpdatePayload`.\n */\n jurorCredential: Address;\n jurorSchema: Address;\n};\n\nexport function getCreateSubaccordInstructionDataEncoder(): FixedSizeEncoder<CreateSubaccordInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"domainRef\", fixEncoderSize(getBytesEncoder(), 32)],\n [\"evidenceSpec\", fixEncoderSize(getBytesEncoder(), 32)],\n [\"minStake\", getU64Encoder()],\n [\"alphaBps\", getU16Encoder()],\n [\"reviewWindow\", getU64Encoder()],\n [\"commitWindow\", getU64Encoder()],\n [\"revealWindow\", getU64Encoder()],\n [\"appealWindow\", getU64Encoder()],\n [\"maxAppeals\", getU8Encoder()],\n [\"minJurySize\", getU32Encoder()],\n [\"aggregation\", getAggregationEncoder()],\n [\"feePerJuror\", getU64Encoder()],\n [\"revealThresholdBps\", getU16Encoder()],\n [\"shortfallPolicy\", getShortfallPolicyEncoder()],\n [\"maxDrawAttempts\", getU8Encoder()],\n [\"coherenceTolBps\", getU16Encoder()],\n [\"authority\", getAddressEncoder()],\n [\"evidenceOperator\", getAddressEncoder()],\n [\"depth\", getU8Encoder()],\n [\"jurorCredential\", getAddressEncoder()],\n [\"jurorSchema\", getAddressEncoder()],\n ]),\n (value) => ({ ...value, discriminator: CREATE_SUBACCORD_DISCRIMINATOR }),\n );\n}\n\nexport function getCreateSubaccordInstructionDataDecoder(): FixedSizeDecoder<CreateSubaccordInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"domainRef\", fixDecoderSize(getBytesDecoder(), 32)],\n [\"evidenceSpec\", fixDecoderSize(getBytesDecoder(), 32)],\n [\"minStake\", getU64Decoder()],\n [\"alphaBps\", getU16Decoder()],\n [\"reviewWindow\", getU64Decoder()],\n [\"commitWindow\", getU64Decoder()],\n [\"revealWindow\", getU64Decoder()],\n [\"appealWindow\", getU64Decoder()],\n [\"maxAppeals\", getU8Decoder()],\n [\"minJurySize\", getU32Decoder()],\n [\"aggregation\", getAggregationDecoder()],\n [\"feePerJuror\", getU64Decoder()],\n [\"revealThresholdBps\", getU16Decoder()],\n [\"shortfallPolicy\", getShortfallPolicyDecoder()],\n [\"maxDrawAttempts\", getU8Decoder()],\n [\"coherenceTolBps\", getU16Decoder()],\n [\"authority\", getAddressDecoder()],\n [\"evidenceOperator\", getAddressDecoder()],\n [\"depth\", getU8Decoder()],\n [\"jurorCredential\", getAddressDecoder()],\n [\"jurorSchema\", getAddressDecoder()],\n ]);\n}\n\nexport function getCreateSubaccordInstructionDataCodec(): FixedSizeCodec<\n CreateSubaccordInstructionDataArgs,\n CreateSubaccordInstructionData\n> {\n return combineCodec(\n getCreateSubaccordInstructionDataEncoder(),\n getCreateSubaccordInstructionDataDecoder(),\n );\n}\n\nexport type CreateSubaccordAsyncInput<\n TAccountCreator extends string = string,\n TAccountSubaccord extends string = string,\n TAccountStakingToken extends string = string,\n TAccountFeeToken extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n creator: TransactionSigner<TAccountCreator>;\n subaccord?: Address<TAccountSubaccord>;\n /**\n * L-4: validated as a real legacy SPL Mint — `Account<Mint>` from\n * `anchor_spl::token` checks ownership against the Token Program ID,\n * rejecting Token-2022 mints (owned by Token-2022 Program) by construction.\n */\n stakingToken: Address<TAccountStakingToken>;\n feeToken: Address<TAccountFeeToken>;\n systemProgram?: Address<TAccountSystemProgram>;\n domainRef: CreateSubaccordInstructionDataArgs[\"domainRef\"];\n evidenceSpec: CreateSubaccordInstructionDataArgs[\"evidenceSpec\"];\n minStake: CreateSubaccordInstructionDataArgs[\"minStake\"];\n alphaBps: CreateSubaccordInstructionDataArgs[\"alphaBps\"];\n reviewWindow: CreateSubaccordInstructionDataArgs[\"reviewWindow\"];\n commitWindow: CreateSubaccordInstructionDataArgs[\"commitWindow\"];\n revealWindow: CreateSubaccordInstructionDataArgs[\"revealWindow\"];\n appealWindow: CreateSubaccordInstructionDataArgs[\"appealWindow\"];\n maxAppeals: CreateSubaccordInstructionDataArgs[\"maxAppeals\"];\n minJurySize: CreateSubaccordInstructionDataArgs[\"minJurySize\"];\n aggregation: CreateSubaccordInstructionDataArgs[\"aggregation\"];\n feePerJuror: CreateSubaccordInstructionDataArgs[\"feePerJuror\"];\n revealThresholdBps: CreateSubaccordInstructionDataArgs[\"revealThresholdBps\"];\n shortfallPolicy: CreateSubaccordInstructionDataArgs[\"shortfallPolicy\"];\n maxDrawAttempts: CreateSubaccordInstructionDataArgs[\"maxDrawAttempts\"];\n coherenceTolBps: CreateSubaccordInstructionDataArgs[\"coherenceTolBps\"];\n authority: CreateSubaccordInstructionDataArgs[\"authority\"];\n evidenceOperator: CreateSubaccordInstructionDataArgs[\"evidenceOperator\"];\n depth: CreateSubaccordInstructionDataArgs[\"depth\"];\n jurorCredential: CreateSubaccordInstructionDataArgs[\"jurorCredential\"];\n jurorSchema: CreateSubaccordInstructionDataArgs[\"jurorSchema\"];\n};\n\nexport async function getCreateSubaccordInstructionAsync<\n TAccountCreator extends string,\n TAccountSubaccord extends string,\n TAccountStakingToken extends string,\n TAccountFeeToken extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: CreateSubaccordAsyncInput<\n TAccountCreator,\n TAccountSubaccord,\n TAccountStakingToken,\n TAccountFeeToken,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n CreateSubaccordInstruction<\n TProgramAddress,\n TAccountCreator,\n TAccountSubaccord,\n TAccountStakingToken,\n TAccountFeeToken,\n TAccountSystemProgram\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n creator: { value: input.creator ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n stakingToken: { value: input.stakingToken ?? null, isWritable: false },\n feeToken: { value: input.feeToken ?? null, isWritable: false },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.subaccord.value) {\n accounts.subaccord.value = await findSubaccordPda({\n creator: getAddressFromResolvedInstructionAccount(\n \"creator\",\n accounts.creator.value,\n ),\n domainRef: getNonNullResolvedInstructionInput(\n \"domainRef\",\n args.domainRef,\n ),\n });\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n \"11111111111111111111111111111111\" as Address<\"11111111111111111111111111111111\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"creator\", accounts.creator),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"stakingToken\", accounts.stakingToken),\n getAccountMeta(\"feeToken\", accounts.feeToken),\n getAccountMeta(\"systemProgram\", accounts.systemProgram),\n ],\n data: getCreateSubaccordInstructionDataEncoder().encode(\n args as CreateSubaccordInstructionDataArgs,\n ),\n programAddress,\n } as CreateSubaccordInstruction<\n TProgramAddress,\n TAccountCreator,\n TAccountSubaccord,\n TAccountStakingToken,\n TAccountFeeToken,\n TAccountSystemProgram\n >);\n}\n\nexport type CreateSubaccordInput<\n TAccountCreator extends string = string,\n TAccountSubaccord extends string = string,\n TAccountStakingToken extends string = string,\n TAccountFeeToken extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n creator: TransactionSigner<TAccountCreator>;\n subaccord: Address<TAccountSubaccord>;\n /**\n * L-4: validated as a real legacy SPL Mint — `Account<Mint>` from\n * `anchor_spl::token` checks ownership against the Token Program ID,\n * rejecting Token-2022 mints (owned by Token-2022 Program) by construction.\n */\n stakingToken: Address<TAccountStakingToken>;\n feeToken: Address<TAccountFeeToken>;\n systemProgram?: Address<TAccountSystemProgram>;\n domainRef: CreateSubaccordInstructionDataArgs[\"domainRef\"];\n evidenceSpec: CreateSubaccordInstructionDataArgs[\"evidenceSpec\"];\n minStake: CreateSubaccordInstructionDataArgs[\"minStake\"];\n alphaBps: CreateSubaccordInstructionDataArgs[\"alphaBps\"];\n reviewWindow: CreateSubaccordInstructionDataArgs[\"reviewWindow\"];\n commitWindow: CreateSubaccordInstructionDataArgs[\"commitWindow\"];\n revealWindow: CreateSubaccordInstructionDataArgs[\"revealWindow\"];\n appealWindow: CreateSubaccordInstructionDataArgs[\"appealWindow\"];\n maxAppeals: CreateSubaccordInstructionDataArgs[\"maxAppeals\"];\n minJurySize: CreateSubaccordInstructionDataArgs[\"minJurySize\"];\n aggregation: CreateSubaccordInstructionDataArgs[\"aggregation\"];\n feePerJuror: CreateSubaccordInstructionDataArgs[\"feePerJuror\"];\n revealThresholdBps: CreateSubaccordInstructionDataArgs[\"revealThresholdBps\"];\n shortfallPolicy: CreateSubaccordInstructionDataArgs[\"shortfallPolicy\"];\n maxDrawAttempts: CreateSubaccordInstructionDataArgs[\"maxDrawAttempts\"];\n coherenceTolBps: CreateSubaccordInstructionDataArgs[\"coherenceTolBps\"];\n authority: CreateSubaccordInstructionDataArgs[\"authority\"];\n evidenceOperator: CreateSubaccordInstructionDataArgs[\"evidenceOperator\"];\n depth: CreateSubaccordInstructionDataArgs[\"depth\"];\n jurorCredential: CreateSubaccordInstructionDataArgs[\"jurorCredential\"];\n jurorSchema: CreateSubaccordInstructionDataArgs[\"jurorSchema\"];\n};\n\nexport function getCreateSubaccordInstruction<\n TAccountCreator extends string,\n TAccountSubaccord extends string,\n TAccountStakingToken extends string,\n TAccountFeeToken extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: CreateSubaccordInput<\n TAccountCreator,\n TAccountSubaccord,\n TAccountStakingToken,\n TAccountFeeToken,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): CreateSubaccordInstruction<\n TProgramAddress,\n TAccountCreator,\n TAccountSubaccord,\n TAccountStakingToken,\n TAccountFeeToken,\n TAccountSystemProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n creator: { value: input.creator ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n stakingToken: { value: input.stakingToken ?? null, isWritable: false },\n feeToken: { value: input.feeToken ?? null, isWritable: false },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n \"11111111111111111111111111111111\" as Address<\"11111111111111111111111111111111\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"creator\", accounts.creator),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"stakingToken\", accounts.stakingToken),\n getAccountMeta(\"feeToken\", accounts.feeToken),\n getAccountMeta(\"systemProgram\", accounts.systemProgram),\n ],\n data: getCreateSubaccordInstructionDataEncoder().encode(\n args as CreateSubaccordInstructionDataArgs,\n ),\n programAddress,\n } as CreateSubaccordInstruction<\n TProgramAddress,\n TAccountCreator,\n TAccountSubaccord,\n TAccountStakingToken,\n TAccountFeeToken,\n TAccountSystemProgram\n >);\n}\n\nexport type ParsedCreateSubaccordInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n creator: TAccountMetas[0];\n subaccord: TAccountMetas[1];\n /**\n * L-4: validated as a real legacy SPL Mint — `Account<Mint>` from\n * `anchor_spl::token` checks ownership against the Token Program ID,\n * rejecting Token-2022 mints (owned by Token-2022 Program) by construction.\n */\n stakingToken: TAccountMetas[2];\n feeToken: TAccountMetas[3];\n systemProgram: TAccountMetas[4];\n };\n data: CreateSubaccordInstructionData;\n};\n\nexport function parseCreateSubaccordInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedCreateSubaccordInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 5) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 5,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n creator: getNextAccount(),\n subaccord: getNextAccount(),\n stakingToken: getNextAccount(),\n feeToken: getNextAccount(),\n systemProgram: getNextAccount(),\n },\n data: getCreateSubaccordInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getArrayDecoder,\n getArrayEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n getU32Decoder,\n getU32Encoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\nimport {\n getLeafClaimDecoder,\n getLeafClaimEncoder,\n getMSTNodeDecoder,\n getMSTNodeEncoder,\n type LeafClaim,\n type LeafClaimArgs,\n type MSTNode,\n type MSTNodeArgs,\n} from \"../types\";\n\nexport const DRAW_SEAT_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 52, 26, 56, 16, 128, 4, 149, 236,\n]);\n\nexport function getDrawSeatDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(DRAW_SEAT_DISCRIMINATOR);\n}\n\nexport type DrawSeatInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountCaller extends string | AccountMeta<string> = string,\n TAccountDispute extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountRound extends string | AccountMeta<string> = string,\n TAccountSystemProgram extends string | AccountMeta<string> =\n \"11111111111111111111111111111111\",\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountCaller extends string\n ? WritableSignerAccount<TAccountCaller> &\n AccountSignerMeta<TAccountCaller>\n : TAccountCaller,\n TAccountDispute extends string\n ? WritableAccount<TAccountDispute>\n : TAccountDispute,\n TAccountSubaccord extends string\n ? ReadonlyAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountRound extends string\n ? WritableAccount<TAccountRound>\n : TAccountRound,\n TAccountSystemProgram extends string\n ? ReadonlyAccount<TAccountSystemProgram>\n : TAccountSystemProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type DrawSeatInstructionData = {\n discriminator: ReadonlyUint8Array;\n seat: number;\n retries: number;\n leaf: LeafClaim;\n proof: Array<MSTNode>;\n index: number;\n};\n\nexport type DrawSeatInstructionDataArgs = {\n seat: number;\n retries: number;\n leaf: LeafClaimArgs;\n proof: Array<MSTNodeArgs>;\n index: number;\n};\n\nexport function getDrawSeatInstructionDataEncoder(): Encoder<DrawSeatInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"seat\", getU32Encoder()],\n [\"retries\", getU32Encoder()],\n [\"leaf\", getLeafClaimEncoder()],\n [\"proof\", getArrayEncoder(getMSTNodeEncoder())],\n [\"index\", getU32Encoder()],\n ]),\n (value) => ({ ...value, discriminator: DRAW_SEAT_DISCRIMINATOR }),\n );\n}\n\nexport function getDrawSeatInstructionDataDecoder(): Decoder<DrawSeatInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"seat\", getU32Decoder()],\n [\"retries\", getU32Decoder()],\n [\"leaf\", getLeafClaimDecoder()],\n [\"proof\", getArrayDecoder(getMSTNodeDecoder())],\n [\"index\", getU32Decoder()],\n ]);\n}\n\nexport function getDrawSeatInstructionDataCodec(): Codec<\n DrawSeatInstructionDataArgs,\n DrawSeatInstructionData\n> {\n return combineCodec(\n getDrawSeatInstructionDataEncoder(),\n getDrawSeatInstructionDataDecoder(),\n );\n}\n\nexport type DrawSeatInput<\n TAccountCaller extends string = string,\n TAccountDispute extends string = string,\n TAccountSubaccord extends string = string,\n TAccountRound extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n caller: TransactionSigner<TAccountCaller>;\n dispute: Address<TAccountDispute>;\n /**\n * PROG-ATTESTTION: the backing Subaccord. Always passed; the credential\n * re-check activates only when `juror_credential != default`.\n */\n subaccord: Address<TAccountSubaccord>;\n round: Address<TAccountRound>;\n systemProgram?: Address<TAccountSystemProgram>;\n seat: DrawSeatInstructionDataArgs[\"seat\"];\n retries: DrawSeatInstructionDataArgs[\"retries\"];\n leaf: DrawSeatInstructionDataArgs[\"leaf\"];\n proof: DrawSeatInstructionDataArgs[\"proof\"];\n index: DrawSeatInstructionDataArgs[\"index\"];\n};\n\nexport function getDrawSeatInstruction<\n TAccountCaller extends string,\n TAccountDispute extends string,\n TAccountSubaccord extends string,\n TAccountRound extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: DrawSeatInput<\n TAccountCaller,\n TAccountDispute,\n TAccountSubaccord,\n TAccountRound,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): DrawSeatInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountDispute,\n TAccountSubaccord,\n TAccountRound,\n TAccountSystemProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n caller: { value: input.caller ?? null, isWritable: true },\n dispute: { value: input.dispute ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: false },\n round: { value: input.round ?? null, isWritable: true },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n \"11111111111111111111111111111111\" as Address<\"11111111111111111111111111111111\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"caller\", accounts.caller),\n getAccountMeta(\"dispute\", accounts.dispute),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"round\", accounts.round),\n getAccountMeta(\"systemProgram\", accounts.systemProgram),\n ],\n data: getDrawSeatInstructionDataEncoder().encode(\n args as DrawSeatInstructionDataArgs,\n ),\n programAddress,\n } as DrawSeatInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountDispute,\n TAccountSubaccord,\n TAccountRound,\n TAccountSystemProgram\n >);\n}\n\nexport type ParsedDrawSeatInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n caller: TAccountMetas[0];\n dispute: TAccountMetas[1];\n /**\n * PROG-ATTESTTION: the backing Subaccord. Always passed; the credential\n * re-check activates only when `juror_credential != default`.\n */\n subaccord: TAccountMetas[2];\n round: TAccountMetas[3];\n systemProgram: TAccountMetas[4];\n };\n data: DrawSeatInstructionData;\n};\n\nexport function parseDrawSeatInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedDrawSeatInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 5) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 5,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n caller: getNextAccount(),\n dispute: getNextAccount(),\n subaccord: getNextAccount(),\n round: getNextAccount(),\n systemProgram: getNextAccount(),\n },\n data: getDrawSeatInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\n\nexport const EXECUTE_SUBACCORD_UPDATE_DISCRIMINATOR: ReadonlyUint8Array =\n new Uint8Array([145, 99, 105, 27, 63, 159, 254, 203]);\n\nexport function getExecuteSubaccordUpdateDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n EXECUTE_SUBACCORD_UPDATE_DISCRIMINATOR,\n );\n}\n\nexport type ExecuteSubaccordUpdateInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountCaller extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountPendingUpdate extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountCaller extends string\n ? WritableSignerAccount<TAccountCaller> &\n AccountSignerMeta<TAccountCaller>\n : TAccountCaller,\n TAccountSubaccord extends string\n ? WritableAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountPendingUpdate extends string\n ? WritableAccount<TAccountPendingUpdate>\n : TAccountPendingUpdate,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type ExecuteSubaccordUpdateInstructionData = {\n discriminator: ReadonlyUint8Array;\n};\n\nexport type ExecuteSubaccordUpdateInstructionDataArgs = {};\n\nexport function getExecuteSubaccordUpdateInstructionDataEncoder(): FixedSizeEncoder<ExecuteSubaccordUpdateInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([[\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)]]),\n (value) => ({\n ...value,\n discriminator: EXECUTE_SUBACCORD_UPDATE_DISCRIMINATOR,\n }),\n );\n}\n\nexport function getExecuteSubaccordUpdateInstructionDataDecoder(): FixedSizeDecoder<ExecuteSubaccordUpdateInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n ]);\n}\n\nexport function getExecuteSubaccordUpdateInstructionDataCodec(): FixedSizeCodec<\n ExecuteSubaccordUpdateInstructionDataArgs,\n ExecuteSubaccordUpdateInstructionData\n> {\n return combineCodec(\n getExecuteSubaccordUpdateInstructionDataEncoder(),\n getExecuteSubaccordUpdateInstructionDataDecoder(),\n );\n}\n\nexport type ExecuteSubaccordUpdateInput<\n TAccountCaller extends string = string,\n TAccountSubaccord extends string = string,\n TAccountPendingUpdate extends string = string,\n> = {\n caller: TransactionSigner<TAccountCaller>;\n subaccord: Address<TAccountSubaccord>;\n pendingUpdate: Address<TAccountPendingUpdate>;\n};\n\nexport function getExecuteSubaccordUpdateInstruction<\n TAccountCaller extends string,\n TAccountSubaccord extends string,\n TAccountPendingUpdate extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: ExecuteSubaccordUpdateInput<\n TAccountCaller,\n TAccountSubaccord,\n TAccountPendingUpdate\n >,\n config?: { programAddress?: TProgramAddress },\n): ExecuteSubaccordUpdateInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountPendingUpdate\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n caller: { value: input.caller ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n pendingUpdate: { value: input.pendingUpdate ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"caller\", accounts.caller),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"pendingUpdate\", accounts.pendingUpdate),\n ],\n data: getExecuteSubaccordUpdateInstructionDataEncoder().encode({}),\n programAddress,\n } as ExecuteSubaccordUpdateInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountPendingUpdate\n >);\n}\n\nexport type ParsedExecuteSubaccordUpdateInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n caller: TAccountMetas[0];\n subaccord: TAccountMetas[1];\n pendingUpdate: TAccountMetas[2];\n };\n data: ExecuteSubaccordUpdateInstructionData;\n};\n\nexport function parseExecuteSubaccordUpdateInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedExecuteSubaccordUpdateInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 3) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 3,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n caller: getNextAccount(),\n subaccord: getNextAccount(),\n pendingUpdate: getNextAccount(),\n },\n data: getExecuteSubaccordUpdateInstructionDataDecoder().decode(\n instruction.data,\n ),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { findAccordStatePda } from \"../pdas\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\n\nexport const EXECUTE_UNPAUSE_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array(\n [55, 43, 56, 5, 154, 156, 52, 232],\n);\n\nexport function getExecuteUnpauseDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n EXECUTE_UNPAUSE_DISCRIMINATOR,\n );\n}\n\nexport type ExecuteUnpauseInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountCaller extends string | AccountMeta<string> = string,\n TAccountAccordState extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountCaller extends string\n ? WritableSignerAccount<TAccountCaller> &\n AccountSignerMeta<TAccountCaller>\n : TAccountCaller,\n TAccountAccordState extends string\n ? WritableAccount<TAccountAccordState>\n : TAccountAccordState,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type ExecuteUnpauseInstructionData = {\n discriminator: ReadonlyUint8Array;\n};\n\nexport type ExecuteUnpauseInstructionDataArgs = {};\n\nexport function getExecuteUnpauseInstructionDataEncoder(): FixedSizeEncoder<ExecuteUnpauseInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([[\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)]]),\n (value) => ({ ...value, discriminator: EXECUTE_UNPAUSE_DISCRIMINATOR }),\n );\n}\n\nexport function getExecuteUnpauseInstructionDataDecoder(): FixedSizeDecoder<ExecuteUnpauseInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n ]);\n}\n\nexport function getExecuteUnpauseInstructionDataCodec(): FixedSizeCodec<\n ExecuteUnpauseInstructionDataArgs,\n ExecuteUnpauseInstructionData\n> {\n return combineCodec(\n getExecuteUnpauseInstructionDataEncoder(),\n getExecuteUnpauseInstructionDataDecoder(),\n );\n}\n\nexport type ExecuteUnpauseAsyncInput<\n TAccountCaller extends string = string,\n TAccountAccordState extends string = string,\n> = {\n /**\n * Any cranker pays the tx fee; no authority check on execute (ADR-0007:\n * the notice period, not the signer, gates the unpause).\n */\n caller: TransactionSigner<TAccountCaller>;\n accordState?: Address<TAccountAccordState>;\n};\n\nexport async function getExecuteUnpauseInstructionAsync<\n TAccountCaller extends string,\n TAccountAccordState extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: ExecuteUnpauseAsyncInput<TAccountCaller, TAccountAccordState>,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n ExecuteUnpauseInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountAccordState\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n caller: { value: input.caller ?? null, isWritable: true },\n accordState: { value: input.accordState ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Resolve default values.\n if (!accounts.accordState.value) {\n accounts.accordState.value = await findAccordStatePda();\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"caller\", accounts.caller),\n getAccountMeta(\"accordState\", accounts.accordState),\n ],\n data: getExecuteUnpauseInstructionDataEncoder().encode({}),\n programAddress,\n } as ExecuteUnpauseInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountAccordState\n >);\n}\n\nexport type ExecuteUnpauseInput<\n TAccountCaller extends string = string,\n TAccountAccordState extends string = string,\n> = {\n /**\n * Any cranker pays the tx fee; no authority check on execute (ADR-0007:\n * the notice period, not the signer, gates the unpause).\n */\n caller: TransactionSigner<TAccountCaller>;\n accordState: Address<TAccountAccordState>;\n};\n\nexport function getExecuteUnpauseInstruction<\n TAccountCaller extends string,\n TAccountAccordState extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: ExecuteUnpauseInput<TAccountCaller, TAccountAccordState>,\n config?: { programAddress?: TProgramAddress },\n): ExecuteUnpauseInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountAccordState\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n caller: { value: input.caller ?? null, isWritable: true },\n accordState: { value: input.accordState ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"caller\", accounts.caller),\n getAccountMeta(\"accordState\", accounts.accordState),\n ],\n data: getExecuteUnpauseInstructionDataEncoder().encode({}),\n programAddress,\n } as ExecuteUnpauseInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountAccordState\n >);\n}\n\nexport type ParsedExecuteUnpauseInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /**\n * Any cranker pays the tx fee; no authority check on execute (ADR-0007:\n * the notice period, not the signer, gates the unpause).\n */\n caller: TAccountMetas[0];\n accordState: TAccountMetas[1];\n };\n data: ExecuteUnpauseInstructionData;\n};\n\nexport function parseExecuteUnpauseInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedExecuteUnpauseInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 2) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 2,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: { caller: getNextAccount(), accordState: getNextAccount() },\n data: getExecuteUnpauseInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\n\nexport const FINALIZE_DISPUTE_DISCRIMINATOR: ReadonlyUint8Array =\n new Uint8Array([190, 211, 17, 122, 247, 157, 27, 223]);\n\nexport function getFinalizeDisputeDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n FINALIZE_DISPUTE_DISCRIMINATOR,\n );\n}\n\nexport type FinalizeDisputeInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountCaller extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountDispute extends string | AccountMeta<string> = string,\n TAccountRound extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountCaller extends string\n ? WritableSignerAccount<TAccountCaller> &\n AccountSignerMeta<TAccountCaller>\n : TAccountCaller,\n TAccountSubaccord extends string\n ? ReadonlyAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountDispute extends string\n ? WritableAccount<TAccountDispute>\n : TAccountDispute,\n TAccountRound extends string\n ? WritableAccount<TAccountRound>\n : TAccountRound,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type FinalizeDisputeInstructionData = {\n discriminator: ReadonlyUint8Array;\n};\n\nexport type FinalizeDisputeInstructionDataArgs = {};\n\nexport function getFinalizeDisputeInstructionDataEncoder(): FixedSizeEncoder<FinalizeDisputeInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([[\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)]]),\n (value) => ({ ...value, discriminator: FINALIZE_DISPUTE_DISCRIMINATOR }),\n );\n}\n\nexport function getFinalizeDisputeInstructionDataDecoder(): FixedSizeDecoder<FinalizeDisputeInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n ]);\n}\n\nexport function getFinalizeDisputeInstructionDataCodec(): FixedSizeCodec<\n FinalizeDisputeInstructionDataArgs,\n FinalizeDisputeInstructionData\n> {\n return combineCodec(\n getFinalizeDisputeInstructionDataEncoder(),\n getFinalizeDisputeInstructionDataDecoder(),\n );\n}\n\nexport type FinalizeDisputeInput<\n TAccountCaller extends string = string,\n TAccountSubaccord extends string = string,\n TAccountDispute extends string = string,\n TAccountRound extends string = string,\n> = {\n caller: TransactionSigner<TAccountCaller>;\n subaccord: Address<TAccountSubaccord>;\n dispute: Address<TAccountDispute>;\n round: Address<TAccountRound>;\n};\n\nexport function getFinalizeDisputeInstruction<\n TAccountCaller extends string,\n TAccountSubaccord extends string,\n TAccountDispute extends string,\n TAccountRound extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: FinalizeDisputeInput<\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound\n >,\n config?: { programAddress?: TProgramAddress },\n): FinalizeDisputeInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n caller: { value: input.caller ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: false },\n dispute: { value: input.dispute ?? null, isWritable: true },\n round: { value: input.round ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"caller\", accounts.caller),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"dispute\", accounts.dispute),\n getAccountMeta(\"round\", accounts.round),\n ],\n data: getFinalizeDisputeInstructionDataEncoder().encode({}),\n programAddress,\n } as FinalizeDisputeInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound\n >);\n}\n\nexport type ParsedFinalizeDisputeInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n caller: TAccountMetas[0];\n subaccord: TAccountMetas[1];\n dispute: TAccountMetas[2];\n round: TAccountMetas[3];\n };\n data: FinalizeDisputeInstructionData;\n};\n\nexport function parseFinalizeDisputeInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedFinalizeDisputeInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 4) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 4,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n caller: getNextAccount(),\n subaccord: getNextAccount(),\n dispute: getNextAccount(),\n round: getNextAccount(),\n },\n data: getFinalizeDisputeInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\n\nexport const FINALIZE_ROUND_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 239, 160, 254, 11, 254, 144, 53, 148,\n]);\n\nexport function getFinalizeRoundDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n FINALIZE_ROUND_DISCRIMINATOR,\n );\n}\n\nexport type FinalizeRoundInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountCaller extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountDispute extends string | AccountMeta<string> = string,\n TAccountRound extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountCaller extends string\n ? WritableSignerAccount<TAccountCaller> &\n AccountSignerMeta<TAccountCaller>\n : TAccountCaller,\n TAccountSubaccord extends string\n ? ReadonlyAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountDispute extends string\n ? WritableAccount<TAccountDispute>\n : TAccountDispute,\n TAccountRound extends string\n ? WritableAccount<TAccountRound>\n : TAccountRound,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type FinalizeRoundInstructionData = {\n discriminator: ReadonlyUint8Array;\n};\n\nexport type FinalizeRoundInstructionDataArgs = {};\n\nexport function getFinalizeRoundInstructionDataEncoder(): FixedSizeEncoder<FinalizeRoundInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([[\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)]]),\n (value) => ({ ...value, discriminator: FINALIZE_ROUND_DISCRIMINATOR }),\n );\n}\n\nexport function getFinalizeRoundInstructionDataDecoder(): FixedSizeDecoder<FinalizeRoundInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n ]);\n}\n\nexport function getFinalizeRoundInstructionDataCodec(): FixedSizeCodec<\n FinalizeRoundInstructionDataArgs,\n FinalizeRoundInstructionData\n> {\n return combineCodec(\n getFinalizeRoundInstructionDataEncoder(),\n getFinalizeRoundInstructionDataDecoder(),\n );\n}\n\nexport type FinalizeRoundInput<\n TAccountCaller extends string = string,\n TAccountSubaccord extends string = string,\n TAccountDispute extends string = string,\n TAccountRound extends string = string,\n> = {\n caller: TransactionSigner<TAccountCaller>;\n subaccord: Address<TAccountSubaccord>;\n dispute: Address<TAccountDispute>;\n round: Address<TAccountRound>;\n};\n\nexport function getFinalizeRoundInstruction<\n TAccountCaller extends string,\n TAccountSubaccord extends string,\n TAccountDispute extends string,\n TAccountRound extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: FinalizeRoundInput<\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound\n >,\n config?: { programAddress?: TProgramAddress },\n): FinalizeRoundInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n caller: { value: input.caller ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: false },\n dispute: { value: input.dispute ?? null, isWritable: true },\n round: { value: input.round ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"caller\", accounts.caller),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"dispute\", accounts.dispute),\n getAccountMeta(\"round\", accounts.round),\n ],\n data: getFinalizeRoundInstructionDataEncoder().encode({}),\n programAddress,\n } as FinalizeRoundInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound\n >);\n}\n\nexport type ParsedFinalizeRoundInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n caller: TAccountMetas[0];\n subaccord: TAccountMetas[1];\n dispute: TAccountMetas[2];\n round: TAccountMetas[3];\n };\n data: FinalizeRoundInstructionData;\n};\n\nexport function parseFinalizeRoundInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedFinalizeRoundInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 4) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 4,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n caller: getNextAccount(),\n subaccord: getNextAccount(),\n dispute: getNextAccount(),\n round: getNextAccount(),\n },\n data: getFinalizeRoundInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\n\nexport const GET_RULING_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 196, 52, 54, 1, 180, 75, 86, 16,\n]);\n\nexport function getGetRulingDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(GET_RULING_DISCRIMINATOR);\n}\n\nexport type GetRulingInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountCaller extends string | AccountMeta<string> = string,\n TAccountDispute extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountCaller extends string\n ? WritableSignerAccount<TAccountCaller> &\n AccountSignerMeta<TAccountCaller>\n : TAccountCaller,\n TAccountDispute extends string\n ? ReadonlyAccount<TAccountDispute>\n : TAccountDispute,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type GetRulingInstructionData = { discriminator: ReadonlyUint8Array };\n\nexport type GetRulingInstructionDataArgs = {};\n\nexport function getGetRulingInstructionDataEncoder(): FixedSizeEncoder<GetRulingInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([[\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)]]),\n (value) => ({ ...value, discriminator: GET_RULING_DISCRIMINATOR }),\n );\n}\n\nexport function getGetRulingInstructionDataDecoder(): FixedSizeDecoder<GetRulingInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n ]);\n}\n\nexport function getGetRulingInstructionDataCodec(): FixedSizeCodec<\n GetRulingInstructionDataArgs,\n GetRulingInstructionData\n> {\n return combineCodec(\n getGetRulingInstructionDataEncoder(),\n getGetRulingInstructionDataDecoder(),\n );\n}\n\nexport type GetRulingInput<\n TAccountCaller extends string = string,\n TAccountDispute extends string = string,\n> = {\n /** Fee payer for the transaction (CPI caller or cranker). */\n caller: TransactionSigner<TAccountCaller>;\n dispute: Address<TAccountDispute>;\n};\n\nexport function getGetRulingInstruction<\n TAccountCaller extends string,\n TAccountDispute extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: GetRulingInput<TAccountCaller, TAccountDispute>,\n config?: { programAddress?: TProgramAddress },\n): GetRulingInstruction<TProgramAddress, TAccountCaller, TAccountDispute> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n caller: { value: input.caller ?? null, isWritable: true },\n dispute: { value: input.dispute ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"caller\", accounts.caller),\n getAccountMeta(\"dispute\", accounts.dispute),\n ],\n data: getGetRulingInstructionDataEncoder().encode({}),\n programAddress,\n } as GetRulingInstruction<TProgramAddress, TAccountCaller, TAccountDispute>);\n}\n\nexport type ParsedGetRulingInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** Fee payer for the transaction (CPI caller or cranker). */\n caller: TAccountMetas[0];\n dispute: TAccountMetas[1];\n };\n data: GetRulingInstructionData;\n};\n\nexport function parseGetRulingInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedGetRulingInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 2) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 2,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: { caller: getNextAccount(), dispute: getNextAccount() },\n data: getGetRulingInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlySignerAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\n\nexport const HEALTH_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 235, 42, 47, 99, 10, 7, 249, 16,\n]);\n\nexport function getHealthDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(HEALTH_DISCRIMINATOR);\n}\n\nexport type HealthInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountCaller extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountCaller extends string\n ? ReadonlySignerAccount<TAccountCaller> &\n AccountSignerMeta<TAccountCaller>\n : TAccountCaller,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type HealthInstructionData = { discriminator: ReadonlyUint8Array };\n\nexport type HealthInstructionDataArgs = {};\n\nexport function getHealthInstructionDataEncoder(): FixedSizeEncoder<HealthInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([[\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)]]),\n (value) => ({ ...value, discriminator: HEALTH_DISCRIMINATOR }),\n );\n}\n\nexport function getHealthInstructionDataDecoder(): FixedSizeDecoder<HealthInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n ]);\n}\n\nexport function getHealthInstructionDataCodec(): FixedSizeCodec<\n HealthInstructionDataArgs,\n HealthInstructionData\n> {\n return combineCodec(\n getHealthInstructionDataEncoder(),\n getHealthInstructionDataDecoder(),\n );\n}\n\nexport type HealthInput<TAccountCaller extends string = string> = {\n caller: TransactionSigner<TAccountCaller>;\n};\n\nexport function getHealthInstruction<\n TAccountCaller extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: HealthInput<TAccountCaller>,\n config?: { programAddress?: TProgramAddress },\n): HealthInstruction<TProgramAddress, TAccountCaller> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n caller: { value: input.caller ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [getAccountMeta(\"caller\", accounts.caller)],\n data: getHealthInstructionDataEncoder().encode({}),\n programAddress,\n } as HealthInstruction<TProgramAddress, TAccountCaller>);\n}\n\nexport type ParsedHealthInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n caller: TAccountMetas[0];\n };\n data: HealthInstructionData;\n};\n\nexport function parseHealthInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedHealthInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 1) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 1,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: { caller: getNextAccount() },\n data: getHealthInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { findAccordStatePda } from \"../pdas\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\n\nexport const INITIALIZE_PAUSE_DISCRIMINATOR: ReadonlyUint8Array =\n new Uint8Array([70, 32, 55, 248, 231, 46, 123, 153]);\n\nexport function getInitializePauseDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n INITIALIZE_PAUSE_DISCRIMINATOR,\n );\n}\n\nexport type InitializePauseInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountAuthority extends string | AccountMeta<string> = string,\n TAccountAccordState extends string | AccountMeta<string> = string,\n TAccountSystemProgram extends string | AccountMeta<string> =\n \"11111111111111111111111111111111\",\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountAuthority extends string\n ? WritableSignerAccount<TAccountAuthority> &\n AccountSignerMeta<TAccountAuthority>\n : TAccountAuthority,\n TAccountAccordState extends string\n ? WritableAccount<TAccountAccordState>\n : TAccountAccordState,\n TAccountSystemProgram extends string\n ? ReadonlyAccount<TAccountSystemProgram>\n : TAccountSystemProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type InitializePauseInstructionData = {\n discriminator: ReadonlyUint8Array;\n};\n\nexport type InitializePauseInstructionDataArgs = {};\n\nexport function getInitializePauseInstructionDataEncoder(): FixedSizeEncoder<InitializePauseInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([[\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)]]),\n (value) => ({ ...value, discriminator: INITIALIZE_PAUSE_DISCRIMINATOR }),\n );\n}\n\nexport function getInitializePauseInstructionDataDecoder(): FixedSizeDecoder<InitializePauseInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n ]);\n}\n\nexport function getInitializePauseInstructionDataCodec(): FixedSizeCodec<\n InitializePauseInstructionDataArgs,\n InitializePauseInstructionData\n> {\n return combineCodec(\n getInitializePauseInstructionDataEncoder(),\n getInitializePauseInstructionDataDecoder(),\n );\n}\n\nexport type InitializePauseAsyncInput<\n TAccountAuthority extends string = string,\n TAccountAccordState extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n authority: TransactionSigner<TAccountAuthority>;\n accordState?: Address<TAccountAccordState>;\n systemProgram?: Address<TAccountSystemProgram>;\n};\n\nexport async function getInitializePauseInstructionAsync<\n TAccountAuthority extends string,\n TAccountAccordState extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: InitializePauseAsyncInput<\n TAccountAuthority,\n TAccountAccordState,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n InitializePauseInstruction<\n TProgramAddress,\n TAccountAuthority,\n TAccountAccordState,\n TAccountSystemProgram\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n authority: { value: input.authority ?? null, isWritable: true },\n accordState: { value: input.accordState ?? null, isWritable: true },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Resolve default values.\n if (!accounts.accordState.value) {\n accounts.accordState.value = await findAccordStatePda();\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n \"11111111111111111111111111111111\" as Address<\"11111111111111111111111111111111\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"authority\", accounts.authority),\n getAccountMeta(\"accordState\", accounts.accordState),\n getAccountMeta(\"systemProgram\", accounts.systemProgram),\n ],\n data: getInitializePauseInstructionDataEncoder().encode({}),\n programAddress,\n } as InitializePauseInstruction<\n TProgramAddress,\n TAccountAuthority,\n TAccountAccordState,\n TAccountSystemProgram\n >);\n}\n\nexport type InitializePauseInput<\n TAccountAuthority extends string = string,\n TAccountAccordState extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n authority: TransactionSigner<TAccountAuthority>;\n accordState: Address<TAccountAccordState>;\n systemProgram?: Address<TAccountSystemProgram>;\n};\n\nexport function getInitializePauseInstruction<\n TAccountAuthority extends string,\n TAccountAccordState extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: InitializePauseInput<\n TAccountAuthority,\n TAccountAccordState,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): InitializePauseInstruction<\n TProgramAddress,\n TAccountAuthority,\n TAccountAccordState,\n TAccountSystemProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n authority: { value: input.authority ?? null, isWritable: true },\n accordState: { value: input.accordState ?? null, isWritable: true },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Resolve default values.\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n \"11111111111111111111111111111111\" as Address<\"11111111111111111111111111111111\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"authority\", accounts.authority),\n getAccountMeta(\"accordState\", accounts.accordState),\n getAccountMeta(\"systemProgram\", accounts.systemProgram),\n ],\n data: getInitializePauseInstructionDataEncoder().encode({}),\n programAddress,\n } as InitializePauseInstruction<\n TProgramAddress,\n TAccountAuthority,\n TAccountAccordState,\n TAccountSystemProgram\n >);\n}\n\nexport type ParsedInitializePauseInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n authority: TAccountMetas[0];\n accordState: TAccountMetas[1];\n systemProgram: TAccountMetas[2];\n };\n data: InitializePauseInstructionData;\n};\n\nexport function parseInitializePauseInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedInitializePauseInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 3) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 3,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n authority: getNextAccount(),\n accordState: getNextAccount(),\n systemProgram: getNextAccount(),\n },\n data: getInitializePauseInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { findAccordStatePda } from \"../pdas\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\n\nexport const PAUSE_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 211, 22, 221, 251, 74, 121, 193, 47,\n]);\n\nexport function getPauseDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(PAUSE_DISCRIMINATOR);\n}\n\nexport type PauseInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountAuthority extends string | AccountMeta<string> = string,\n TAccountAccordState extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountAuthority extends string\n ? WritableSignerAccount<TAccountAuthority> &\n AccountSignerMeta<TAccountAuthority>\n : TAccountAuthority,\n TAccountAccordState extends string\n ? WritableAccount<TAccountAccordState>\n : TAccountAccordState,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type PauseInstructionData = { discriminator: ReadonlyUint8Array };\n\nexport type PauseInstructionDataArgs = {};\n\nexport function getPauseInstructionDataEncoder(): FixedSizeEncoder<PauseInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([[\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)]]),\n (value) => ({ ...value, discriminator: PAUSE_DISCRIMINATOR }),\n );\n}\n\nexport function getPauseInstructionDataDecoder(): FixedSizeDecoder<PauseInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n ]);\n}\n\nexport function getPauseInstructionDataCodec(): FixedSizeCodec<\n PauseInstructionDataArgs,\n PauseInstructionData\n> {\n return combineCodec(\n getPauseInstructionDataEncoder(),\n getPauseInstructionDataDecoder(),\n );\n}\n\nexport type PauseAsyncInput<\n TAccountAuthority extends string = string,\n TAccountAccordState extends string = string,\n> = {\n authority: TransactionSigner<TAccountAuthority>;\n accordState?: Address<TAccountAccordState>;\n};\n\nexport async function getPauseInstructionAsync<\n TAccountAuthority extends string,\n TAccountAccordState extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: PauseAsyncInput<TAccountAuthority, TAccountAccordState>,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n PauseInstruction<TProgramAddress, TAccountAuthority, TAccountAccordState>\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n authority: { value: input.authority ?? null, isWritable: true },\n accordState: { value: input.accordState ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Resolve default values.\n if (!accounts.accordState.value) {\n accounts.accordState.value = await findAccordStatePda();\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"authority\", accounts.authority),\n getAccountMeta(\"accordState\", accounts.accordState),\n ],\n data: getPauseInstructionDataEncoder().encode({}),\n programAddress,\n } as PauseInstruction<\n TProgramAddress,\n TAccountAuthority,\n TAccountAccordState\n >);\n}\n\nexport type PauseInput<\n TAccountAuthority extends string = string,\n TAccountAccordState extends string = string,\n> = {\n authority: TransactionSigner<TAccountAuthority>;\n accordState: Address<TAccountAccordState>;\n};\n\nexport function getPauseInstruction<\n TAccountAuthority extends string,\n TAccountAccordState extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: PauseInput<TAccountAuthority, TAccountAccordState>,\n config?: { programAddress?: TProgramAddress },\n): PauseInstruction<TProgramAddress, TAccountAuthority, TAccountAccordState> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n authority: { value: input.authority ?? null, isWritable: true },\n accordState: { value: input.accordState ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"authority\", accounts.authority),\n getAccountMeta(\"accordState\", accounts.accordState),\n ],\n data: getPauseInstructionDataEncoder().encode({}),\n programAddress,\n } as PauseInstruction<\n TProgramAddress,\n TAccountAuthority,\n TAccountAccordState\n >);\n}\n\nexport type ParsedPauseInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n authority: TAccountMetas[0];\n accordState: TAccountMetas[1];\n };\n data: PauseInstructionData;\n};\n\nexport function parsePauseInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedPauseInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 2) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 2,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: { authority: getNextAccount(), accordState: getNextAccount() },\n data: getPauseInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlySignerAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n getAddressFromResolvedInstructionAccount,\n getNonNullResolvedInstructionInput,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { findPendingUpdatePda } from \"../pdas\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\nimport {\n getUpdatePayloadDecoder,\n getUpdatePayloadEncoder,\n type UpdatePayload,\n type UpdatePayloadArgs,\n} from \"../types\";\n\nexport const PROPOSE_SUBACCORD_UPDATE_DISCRIMINATOR: ReadonlyUint8Array =\n new Uint8Array([8, 224, 186, 131, 130, 76, 165, 172]);\n\nexport function getProposeSubaccordUpdateDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n PROPOSE_SUBACCORD_UPDATE_DISCRIMINATOR,\n );\n}\n\nexport type ProposeSubaccordUpdateInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountAuthority extends string | AccountMeta<string> = string,\n TAccountRentPayer extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountPendingUpdate extends string | AccountMeta<string> = string,\n TAccountSystemProgram extends string | AccountMeta<string> =\n \"11111111111111111111111111111111\",\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountAuthority extends string\n ? ReadonlySignerAccount<TAccountAuthority> &\n AccountSignerMeta<TAccountAuthority>\n : TAccountAuthority,\n TAccountRentPayer extends string\n ? WritableSignerAccount<TAccountRentPayer> &\n AccountSignerMeta<TAccountRentPayer>\n : TAccountRentPayer,\n TAccountSubaccord extends string\n ? ReadonlyAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountPendingUpdate extends string\n ? WritableAccount<TAccountPendingUpdate>\n : TAccountPendingUpdate,\n TAccountSystemProgram extends string\n ? ReadonlyAccount<TAccountSystemProgram>\n : TAccountSystemProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type ProposeSubaccordUpdateInstructionData = {\n discriminator: ReadonlyUint8Array;\n nonce: bigint;\n payload: UpdatePayload;\n};\n\nexport type ProposeSubaccordUpdateInstructionDataArgs = {\n nonce: number | bigint;\n payload: UpdatePayloadArgs;\n};\n\nexport function getProposeSubaccordUpdateInstructionDataEncoder(): Encoder<ProposeSubaccordUpdateInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"nonce\", getU64Encoder()],\n [\"payload\", getUpdatePayloadEncoder()],\n ]),\n (value) => ({\n ...value,\n discriminator: PROPOSE_SUBACCORD_UPDATE_DISCRIMINATOR,\n }),\n );\n}\n\nexport function getProposeSubaccordUpdateInstructionDataDecoder(): Decoder<ProposeSubaccordUpdateInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"nonce\", getU64Decoder()],\n [\"payload\", getUpdatePayloadDecoder()],\n ]);\n}\n\nexport function getProposeSubaccordUpdateInstructionDataCodec(): Codec<\n ProposeSubaccordUpdateInstructionDataArgs,\n ProposeSubaccordUpdateInstructionData\n> {\n return combineCodec(\n getProposeSubaccordUpdateInstructionDataEncoder(),\n getProposeSubaccordUpdateInstructionDataDecoder(),\n );\n}\n\nexport type ProposeSubaccordUpdateAsyncInput<\n TAccountAuthority extends string = string,\n TAccountRentPayer extends string = string,\n TAccountSubaccord extends string = string,\n TAccountPendingUpdate extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n /** Must equal `subaccord.authority`; signs the proposal. */\n authority: TransactionSigner<TAccountAuthority>;\n /**\n * Rent payer for the PendingUpdate `init`. MUST be data-free (the system\n * program rejects lamport transfers from data-carrying accounts), so\n * Arbitrables whose authority is a data-carrying PDA (e.g. Canon's list\n * PDA) pass their crank caller here; wallet authorities pass themselves.\n */\n rentPayer: TransactionSigner<TAccountRentPayer>;\n subaccord: Address<TAccountSubaccord>;\n pendingUpdate?: Address<TAccountPendingUpdate>;\n systemProgram?: Address<TAccountSystemProgram>;\n nonce: ProposeSubaccordUpdateInstructionDataArgs[\"nonce\"];\n payload: ProposeSubaccordUpdateInstructionDataArgs[\"payload\"];\n};\n\nexport async function getProposeSubaccordUpdateInstructionAsync<\n TAccountAuthority extends string,\n TAccountRentPayer extends string,\n TAccountSubaccord extends string,\n TAccountPendingUpdate extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: ProposeSubaccordUpdateAsyncInput<\n TAccountAuthority,\n TAccountRentPayer,\n TAccountSubaccord,\n TAccountPendingUpdate,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n ProposeSubaccordUpdateInstruction<\n TProgramAddress,\n TAccountAuthority,\n TAccountRentPayer,\n TAccountSubaccord,\n TAccountPendingUpdate,\n TAccountSystemProgram\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n authority: { value: input.authority ?? null, isWritable: false },\n rentPayer: { value: input.rentPayer ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: false },\n pendingUpdate: { value: input.pendingUpdate ?? null, isWritable: true },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.pendingUpdate.value) {\n accounts.pendingUpdate.value = await findPendingUpdatePda({\n subaccord: getAddressFromResolvedInstructionAccount(\n \"subaccord\",\n accounts.subaccord.value,\n ),\n nonce: getNonNullResolvedInstructionInput(\"nonce\", args.nonce),\n });\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n \"11111111111111111111111111111111\" as Address<\"11111111111111111111111111111111\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"authority\", accounts.authority),\n getAccountMeta(\"rentPayer\", accounts.rentPayer),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"pendingUpdate\", accounts.pendingUpdate),\n getAccountMeta(\"systemProgram\", accounts.systemProgram),\n ],\n data: getProposeSubaccordUpdateInstructionDataEncoder().encode(\n args as ProposeSubaccordUpdateInstructionDataArgs,\n ),\n programAddress,\n } as ProposeSubaccordUpdateInstruction<\n TProgramAddress,\n TAccountAuthority,\n TAccountRentPayer,\n TAccountSubaccord,\n TAccountPendingUpdate,\n TAccountSystemProgram\n >);\n}\n\nexport type ProposeSubaccordUpdateInput<\n TAccountAuthority extends string = string,\n TAccountRentPayer extends string = string,\n TAccountSubaccord extends string = string,\n TAccountPendingUpdate extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n /** Must equal `subaccord.authority`; signs the proposal. */\n authority: TransactionSigner<TAccountAuthority>;\n /**\n * Rent payer for the PendingUpdate `init`. MUST be data-free (the system\n * program rejects lamport transfers from data-carrying accounts), so\n * Arbitrables whose authority is a data-carrying PDA (e.g. Canon's list\n * PDA) pass their crank caller here; wallet authorities pass themselves.\n */\n rentPayer: TransactionSigner<TAccountRentPayer>;\n subaccord: Address<TAccountSubaccord>;\n pendingUpdate: Address<TAccountPendingUpdate>;\n systemProgram?: Address<TAccountSystemProgram>;\n nonce: ProposeSubaccordUpdateInstructionDataArgs[\"nonce\"];\n payload: ProposeSubaccordUpdateInstructionDataArgs[\"payload\"];\n};\n\nexport function getProposeSubaccordUpdateInstruction<\n TAccountAuthority extends string,\n TAccountRentPayer extends string,\n TAccountSubaccord extends string,\n TAccountPendingUpdate extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: ProposeSubaccordUpdateInput<\n TAccountAuthority,\n TAccountRentPayer,\n TAccountSubaccord,\n TAccountPendingUpdate,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): ProposeSubaccordUpdateInstruction<\n TProgramAddress,\n TAccountAuthority,\n TAccountRentPayer,\n TAccountSubaccord,\n TAccountPendingUpdate,\n TAccountSystemProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n authority: { value: input.authority ?? null, isWritable: false },\n rentPayer: { value: input.rentPayer ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: false },\n pendingUpdate: { value: input.pendingUpdate ?? null, isWritable: true },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n \"11111111111111111111111111111111\" as Address<\"11111111111111111111111111111111\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"authority\", accounts.authority),\n getAccountMeta(\"rentPayer\", accounts.rentPayer),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"pendingUpdate\", accounts.pendingUpdate),\n getAccountMeta(\"systemProgram\", accounts.systemProgram),\n ],\n data: getProposeSubaccordUpdateInstructionDataEncoder().encode(\n args as ProposeSubaccordUpdateInstructionDataArgs,\n ),\n programAddress,\n } as ProposeSubaccordUpdateInstruction<\n TProgramAddress,\n TAccountAuthority,\n TAccountRentPayer,\n TAccountSubaccord,\n TAccountPendingUpdate,\n TAccountSystemProgram\n >);\n}\n\nexport type ParsedProposeSubaccordUpdateInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** Must equal `subaccord.authority`; signs the proposal. */\n authority: TAccountMetas[0];\n /**\n * Rent payer for the PendingUpdate `init`. MUST be data-free (the system\n * program rejects lamport transfers from data-carrying accounts), so\n * Arbitrables whose authority is a data-carrying PDA (e.g. Canon's list\n * PDA) pass their crank caller here; wallet authorities pass themselves.\n */\n rentPayer: TAccountMetas[1];\n subaccord: TAccountMetas[2];\n pendingUpdate: TAccountMetas[3];\n systemProgram: TAccountMetas[4];\n };\n data: ProposeSubaccordUpdateInstructionData;\n};\n\nexport function parseProposeSubaccordUpdateInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedProposeSubaccordUpdateInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 5) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 5,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n authority: getNextAccount(),\n rentPayer: getNextAccount(),\n subaccord: getNextAccount(),\n pendingUpdate: getNextAccount(),\n systemProgram: getNextAccount(),\n },\n data: getProposeSubaccordUpdateInstructionDataDecoder().decode(\n instruction.data,\n ),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { findAccordStatePda } from \"../pdas\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\n\nexport const PROPOSE_UNPAUSE_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array(\n [45, 136, 163, 143, 156, 57, 113, 132],\n);\n\nexport function getProposeUnpauseDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n PROPOSE_UNPAUSE_DISCRIMINATOR,\n );\n}\n\nexport type ProposeUnpauseInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountAuthority extends string | AccountMeta<string> = string,\n TAccountAccordState extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountAuthority extends string\n ? WritableSignerAccount<TAccountAuthority> &\n AccountSignerMeta<TAccountAuthority>\n : TAccountAuthority,\n TAccountAccordState extends string\n ? WritableAccount<TAccountAccordState>\n : TAccountAccordState,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type ProposeUnpauseInstructionData = {\n discriminator: ReadonlyUint8Array;\n};\n\nexport type ProposeUnpauseInstructionDataArgs = {};\n\nexport function getProposeUnpauseInstructionDataEncoder(): FixedSizeEncoder<ProposeUnpauseInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([[\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)]]),\n (value) => ({ ...value, discriminator: PROPOSE_UNPAUSE_DISCRIMINATOR }),\n );\n}\n\nexport function getProposeUnpauseInstructionDataDecoder(): FixedSizeDecoder<ProposeUnpauseInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n ]);\n}\n\nexport function getProposeUnpauseInstructionDataCodec(): FixedSizeCodec<\n ProposeUnpauseInstructionDataArgs,\n ProposeUnpauseInstructionData\n> {\n return combineCodec(\n getProposeUnpauseInstructionDataEncoder(),\n getProposeUnpauseInstructionDataDecoder(),\n );\n}\n\nexport type ProposeUnpauseAsyncInput<\n TAccountAuthority extends string = string,\n TAccountAccordState extends string = string,\n> = {\n authority: TransactionSigner<TAccountAuthority>;\n accordState?: Address<TAccountAccordState>;\n};\n\nexport async function getProposeUnpauseInstructionAsync<\n TAccountAuthority extends string,\n TAccountAccordState extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: ProposeUnpauseAsyncInput<TAccountAuthority, TAccountAccordState>,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n ProposeUnpauseInstruction<\n TProgramAddress,\n TAccountAuthority,\n TAccountAccordState\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n authority: { value: input.authority ?? null, isWritable: true },\n accordState: { value: input.accordState ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Resolve default values.\n if (!accounts.accordState.value) {\n accounts.accordState.value = await findAccordStatePda();\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"authority\", accounts.authority),\n getAccountMeta(\"accordState\", accounts.accordState),\n ],\n data: getProposeUnpauseInstructionDataEncoder().encode({}),\n programAddress,\n } as ProposeUnpauseInstruction<\n TProgramAddress,\n TAccountAuthority,\n TAccountAccordState\n >);\n}\n\nexport type ProposeUnpauseInput<\n TAccountAuthority extends string = string,\n TAccountAccordState extends string = string,\n> = {\n authority: TransactionSigner<TAccountAuthority>;\n accordState: Address<TAccountAccordState>;\n};\n\nexport function getProposeUnpauseInstruction<\n TAccountAuthority extends string,\n TAccountAccordState extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: ProposeUnpauseInput<TAccountAuthority, TAccountAccordState>,\n config?: { programAddress?: TProgramAddress },\n): ProposeUnpauseInstruction<\n TProgramAddress,\n TAccountAuthority,\n TAccountAccordState\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n authority: { value: input.authority ?? null, isWritable: true },\n accordState: { value: input.accordState ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"authority\", accounts.authority),\n getAccountMeta(\"accordState\", accounts.accordState),\n ],\n data: getProposeUnpauseInstructionDataEncoder().encode({}),\n programAddress,\n } as ProposeUnpauseInstruction<\n TProgramAddress,\n TAccountAuthority,\n TAccountAccordState\n >);\n}\n\nexport type ParsedProposeUnpauseInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n authority: TAccountMetas[0];\n accordState: TAccountMetas[1];\n };\n data: ProposeUnpauseInstructionData;\n};\n\nexport function parseProposeUnpauseInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedProposeUnpauseInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 2) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 2,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: { authority: getNextAccount(), accordState: getNextAccount() },\n data: getProposeUnpauseInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getArrayDecoder,\n getArrayEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n getAddressFromResolvedInstructionAccount,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { findJurorStakePda } from \"../pdas\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\nimport {\n getMSTNodeDecoder,\n getMSTNodeEncoder,\n type MSTNode,\n type MSTNodeArgs,\n} from \"../types\";\n\nexport const PRUNE_JUROR_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 49, 219, 100, 132, 202, 120, 18, 167,\n]);\n\nexport function getPruneJurorDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(PRUNE_JUROR_DISCRIMINATOR);\n}\n\nexport type PruneJurorInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountCaller extends string | AccountMeta<string> = string,\n TAccountJuror extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountJurorStake extends string | AccountMeta<string> = string,\n TAccountSystemProgram extends string | AccountMeta<string> =\n \"11111111111111111111111111111111\",\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountCaller extends string\n ? WritableSignerAccount<TAccountCaller> &\n AccountSignerMeta<TAccountCaller>\n : TAccountCaller,\n TAccountJuror extends string\n ? ReadonlyAccount<TAccountJuror>\n : TAccountJuror,\n TAccountSubaccord extends string\n ? WritableAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountJurorStake extends string\n ? WritableAccount<TAccountJurorStake>\n : TAccountJurorStake,\n TAccountSystemProgram extends string\n ? ReadonlyAccount<TAccountSystemProgram>\n : TAccountSystemProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type PruneJurorInstructionData = {\n discriminator: ReadonlyUint8Array;\n path: Array<MSTNode>;\n};\n\nexport type PruneJurorInstructionDataArgs = { path: Array<MSTNodeArgs> };\n\nexport function getPruneJurorInstructionDataEncoder(): Encoder<PruneJurorInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"path\", getArrayEncoder(getMSTNodeEncoder())],\n ]),\n (value) => ({ ...value, discriminator: PRUNE_JUROR_DISCRIMINATOR }),\n );\n}\n\nexport function getPruneJurorInstructionDataDecoder(): Decoder<PruneJurorInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"path\", getArrayDecoder(getMSTNodeDecoder())],\n ]);\n}\n\nexport function getPruneJurorInstructionDataCodec(): Codec<\n PruneJurorInstructionDataArgs,\n PruneJurorInstructionData\n> {\n return combineCodec(\n getPruneJurorInstructionDataEncoder(),\n getPruneJurorInstructionDataDecoder(),\n );\n}\n\nexport type PruneJurorAsyncInput<\n TAccountCaller extends string = string,\n TAccountJuror extends string = string,\n TAccountSubaccord extends string = string,\n TAccountJurorStake extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n caller: TransactionSigner<TAccountCaller>;\n /** address seeds the `JurorStake` PDA below, linking the two. */\n juror: Address<TAccountJuror>;\n subaccord: Address<TAccountSubaccord>;\n jurorStake?: Address<TAccountJurorStake>;\n systemProgram?: Address<TAccountSystemProgram>;\n path: PruneJurorInstructionDataArgs[\"path\"];\n};\n\nexport async function getPruneJurorInstructionAsync<\n TAccountCaller extends string,\n TAccountJuror extends string,\n TAccountSubaccord extends string,\n TAccountJurorStake extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: PruneJurorAsyncInput<\n TAccountCaller,\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n PruneJurorInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake,\n TAccountSystemProgram\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n caller: { value: input.caller ?? null, isWritable: true },\n juror: { value: input.juror ?? null, isWritable: false },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n jurorStake: { value: input.jurorStake ?? null, isWritable: true },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.jurorStake.value) {\n accounts.jurorStake.value = await findJurorStakePda({\n subaccord: getAddressFromResolvedInstructionAccount(\n \"subaccord\",\n accounts.subaccord.value,\n ),\n juror: getAddressFromResolvedInstructionAccount(\n \"juror\",\n accounts.juror.value,\n ),\n });\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n \"11111111111111111111111111111111\" as Address<\"11111111111111111111111111111111\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"caller\", accounts.caller),\n getAccountMeta(\"juror\", accounts.juror),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"jurorStake\", accounts.jurorStake),\n getAccountMeta(\"systemProgram\", accounts.systemProgram),\n ],\n data: getPruneJurorInstructionDataEncoder().encode(\n args as PruneJurorInstructionDataArgs,\n ),\n programAddress,\n } as PruneJurorInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake,\n TAccountSystemProgram\n >);\n}\n\nexport type PruneJurorInput<\n TAccountCaller extends string = string,\n TAccountJuror extends string = string,\n TAccountSubaccord extends string = string,\n TAccountJurorStake extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n caller: TransactionSigner<TAccountCaller>;\n /** address seeds the `JurorStake` PDA below, linking the two. */\n juror: Address<TAccountJuror>;\n subaccord: Address<TAccountSubaccord>;\n jurorStake: Address<TAccountJurorStake>;\n systemProgram?: Address<TAccountSystemProgram>;\n path: PruneJurorInstructionDataArgs[\"path\"];\n};\n\nexport function getPruneJurorInstruction<\n TAccountCaller extends string,\n TAccountJuror extends string,\n TAccountSubaccord extends string,\n TAccountJurorStake extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: PruneJurorInput<\n TAccountCaller,\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): PruneJurorInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake,\n TAccountSystemProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n caller: { value: input.caller ?? null, isWritable: true },\n juror: { value: input.juror ?? null, isWritable: false },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n jurorStake: { value: input.jurorStake ?? null, isWritable: true },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n \"11111111111111111111111111111111\" as Address<\"11111111111111111111111111111111\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"caller\", accounts.caller),\n getAccountMeta(\"juror\", accounts.juror),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"jurorStake\", accounts.jurorStake),\n getAccountMeta(\"systemProgram\", accounts.systemProgram),\n ],\n data: getPruneJurorInstructionDataEncoder().encode(\n args as PruneJurorInstructionDataArgs,\n ),\n programAddress,\n } as PruneJurorInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake,\n TAccountSystemProgram\n >);\n}\n\nexport type ParsedPruneJurorInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n caller: TAccountMetas[0];\n /** address seeds the `JurorStake` PDA below, linking the two. */\n juror: TAccountMetas[1];\n subaccord: TAccountMetas[2];\n jurorStake: TAccountMetas[3];\n systemProgram: TAccountMetas[4];\n };\n data: PruneJurorInstructionData;\n};\n\nexport function parsePruneJurorInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedPruneJurorInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 5) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 5,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n caller: getNextAccount(),\n juror: getNextAccount(),\n subaccord: getNextAccount(),\n jurorStake: getNextAccount(),\n systemProgram: getNextAccount(),\n },\n data: getPruneJurorInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getArrayDecoder,\n getArrayEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\nimport {\n getMSTNodeDecoder,\n getMSTNodeEncoder,\n type MSTNode,\n type MSTNodeArgs,\n} from \"../types\";\n\nexport const RECLAIM_SLOT_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 44, 216, 234, 229, 129, 82, 98, 5,\n]);\n\nexport function getReclaimSlotDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n RECLAIM_SLOT_DISCRIMINATOR,\n );\n}\n\nexport type ReclaimSlotInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountCaller extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountJurorStake extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountCaller extends string\n ? WritableSignerAccount<TAccountCaller> &\n AccountSignerMeta<TAccountCaller>\n : TAccountCaller,\n TAccountSubaccord extends string\n ? WritableAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountJurorStake extends string\n ? WritableAccount<TAccountJurorStake>\n : TAccountJurorStake,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type ReclaimSlotInstructionData = {\n discriminator: ReadonlyUint8Array;\n path: Array<MSTNode>;\n};\n\nexport type ReclaimSlotInstructionDataArgs = { path: Array<MSTNodeArgs> };\n\nexport function getReclaimSlotInstructionDataEncoder(): Encoder<ReclaimSlotInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"path\", getArrayEncoder(getMSTNodeEncoder())],\n ]),\n (value) => ({ ...value, discriminator: RECLAIM_SLOT_DISCRIMINATOR }),\n );\n}\n\nexport function getReclaimSlotInstructionDataDecoder(): Decoder<ReclaimSlotInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"path\", getArrayDecoder(getMSTNodeDecoder())],\n ]);\n}\n\nexport function getReclaimSlotInstructionDataCodec(): Codec<\n ReclaimSlotInstructionDataArgs,\n ReclaimSlotInstructionData\n> {\n return combineCodec(\n getReclaimSlotInstructionDataEncoder(),\n getReclaimSlotInstructionDataDecoder(),\n );\n}\n\nexport type ReclaimSlotInput<\n TAccountCaller extends string = string,\n TAccountSubaccord extends string = string,\n TAccountJurorStake extends string = string,\n> = {\n caller: TransactionSigner<TAccountCaller>;\n subaccord: Address<TAccountSubaccord>;\n jurorStake: Address<TAccountJurorStake>;\n path: ReclaimSlotInstructionDataArgs[\"path\"];\n};\n\nexport function getReclaimSlotInstruction<\n TAccountCaller extends string,\n TAccountSubaccord extends string,\n TAccountJurorStake extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: ReclaimSlotInput<\n TAccountCaller,\n TAccountSubaccord,\n TAccountJurorStake\n >,\n config?: { programAddress?: TProgramAddress },\n): ReclaimSlotInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountJurorStake\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n caller: { value: input.caller ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n jurorStake: { value: input.jurorStake ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"caller\", accounts.caller),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"jurorStake\", accounts.jurorStake),\n ],\n data: getReclaimSlotInstructionDataEncoder().encode(\n args as ReclaimSlotInstructionDataArgs,\n ),\n programAddress,\n } as ReclaimSlotInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountJurorStake\n >);\n}\n\nexport type ParsedReclaimSlotInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n caller: TAccountMetas[0];\n subaccord: TAccountMetas[1];\n jurorStake: TAccountMetas[2];\n };\n data: ReclaimSlotInstructionData;\n};\n\nexport function parseReclaimSlotInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedReclaimSlotInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 3) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 3,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n caller: getNextAccount(),\n subaccord: getNextAccount(),\n jurorStake: getNextAccount(),\n },\n data: getReclaimSlotInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getArrayDecoder,\n getArrayEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\nimport {\n getMSTNodeDecoder,\n getMSTNodeEncoder,\n type MSTNode,\n type MSTNodeArgs,\n} from \"../types\";\n\nexport const RECONCILE_STAKE_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array(\n [40, 103, 128, 85, 211, 11, 34, 80],\n);\n\nexport function getReconcileStakeDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n RECONCILE_STAKE_DISCRIMINATOR,\n );\n}\n\nexport type ReconcileStakeInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountCaller extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountJurorStake extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountCaller extends string\n ? WritableSignerAccount<TAccountCaller> &\n AccountSignerMeta<TAccountCaller>\n : TAccountCaller,\n TAccountSubaccord extends string\n ? WritableAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountJurorStake extends string\n ? WritableAccount<TAccountJurorStake>\n : TAccountJurorStake,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type ReconcileStakeInstructionData = {\n discriminator: ReadonlyUint8Array;\n path: Array<MSTNode>;\n};\n\nexport type ReconcileStakeInstructionDataArgs = { path: Array<MSTNodeArgs> };\n\nexport function getReconcileStakeInstructionDataEncoder(): Encoder<ReconcileStakeInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"path\", getArrayEncoder(getMSTNodeEncoder())],\n ]),\n (value) => ({ ...value, discriminator: RECONCILE_STAKE_DISCRIMINATOR }),\n );\n}\n\nexport function getReconcileStakeInstructionDataDecoder(): Decoder<ReconcileStakeInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"path\", getArrayDecoder(getMSTNodeDecoder())],\n ]);\n}\n\nexport function getReconcileStakeInstructionDataCodec(): Codec<\n ReconcileStakeInstructionDataArgs,\n ReconcileStakeInstructionData\n> {\n return combineCodec(\n getReconcileStakeInstructionDataEncoder(),\n getReconcileStakeInstructionDataDecoder(),\n );\n}\n\nexport type ReconcileStakeInput<\n TAccountCaller extends string = string,\n TAccountSubaccord extends string = string,\n TAccountJurorStake extends string = string,\n> = {\n caller: TransactionSigner<TAccountCaller>;\n subaccord: Address<TAccountSubaccord>;\n jurorStake: Address<TAccountJurorStake>;\n path: ReconcileStakeInstructionDataArgs[\"path\"];\n};\n\nexport function getReconcileStakeInstruction<\n TAccountCaller extends string,\n TAccountSubaccord extends string,\n TAccountJurorStake extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: ReconcileStakeInput<\n TAccountCaller,\n TAccountSubaccord,\n TAccountJurorStake\n >,\n config?: { programAddress?: TProgramAddress },\n): ReconcileStakeInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountJurorStake\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n caller: { value: input.caller ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n jurorStake: { value: input.jurorStake ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"caller\", accounts.caller),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"jurorStake\", accounts.jurorStake),\n ],\n data: getReconcileStakeInstructionDataEncoder().encode(\n args as ReconcileStakeInstructionDataArgs,\n ),\n programAddress,\n } as ReconcileStakeInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountJurorStake\n >);\n}\n\nexport type ParsedReconcileStakeInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n caller: TAccountMetas[0];\n subaccord: TAccountMetas[1];\n jurorStake: TAccountMetas[2];\n };\n data: ReconcileStakeInstructionData;\n};\n\nexport function parseReconcileStakeInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedReconcileStakeInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 3) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 3,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n caller: getNextAccount(),\n subaccord: getNextAccount(),\n jurorStake: getNextAccount(),\n },\n data: getReconcileStakeInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getAddressEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n getAddressFromResolvedInstructionAccount,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\n\nexport const REDRAW_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 86, 111, 66, 164, 105, 158, 114, 164,\n]);\n\nexport function getRedrawDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(REDRAW_DISCRIMINATOR);\n}\n\nexport type RedrawInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountCaller extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountDispute extends string | AccountMeta<string> = string,\n TAccountRound extends string | AccountMeta<string> = string,\n TAccountFeeToken extends string | AccountMeta<string> = string,\n TAccountFilerTokenAccount extends string | AccountMeta<string> = string,\n TAccountFeeVault extends string | AccountMeta<string> = string,\n TAccountTokenProgram extends string | AccountMeta<string> =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\",\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountCaller extends string\n ? WritableSignerAccount<TAccountCaller> &\n AccountSignerMeta<TAccountCaller>\n : TAccountCaller,\n TAccountSubaccord extends string\n ? WritableAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountDispute extends string\n ? WritableAccount<TAccountDispute>\n : TAccountDispute,\n TAccountRound extends string\n ? WritableAccount<TAccountRound>\n : TAccountRound,\n TAccountFeeToken extends string\n ? ReadonlyAccount<TAccountFeeToken>\n : TAccountFeeToken,\n TAccountFilerTokenAccount extends string\n ? WritableAccount<TAccountFilerTokenAccount>\n : TAccountFilerTokenAccount,\n TAccountFeeVault extends string\n ? WritableAccount<TAccountFeeVault>\n : TAccountFeeVault,\n TAccountTokenProgram extends string\n ? ReadonlyAccount<TAccountTokenProgram>\n : TAccountTokenProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type RedrawInstructionData = { discriminator: ReadonlyUint8Array };\n\nexport type RedrawInstructionDataArgs = {};\n\nexport function getRedrawInstructionDataEncoder(): FixedSizeEncoder<RedrawInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([[\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)]]),\n (value) => ({ ...value, discriminator: REDRAW_DISCRIMINATOR }),\n );\n}\n\nexport function getRedrawInstructionDataDecoder(): FixedSizeDecoder<RedrawInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n ]);\n}\n\nexport function getRedrawInstructionDataCodec(): FixedSizeCodec<\n RedrawInstructionDataArgs,\n RedrawInstructionData\n> {\n return combineCodec(\n getRedrawInstructionDataEncoder(),\n getRedrawInstructionDataDecoder(),\n );\n}\n\nexport type RedrawAsyncInput<\n TAccountCaller extends string = string,\n TAccountSubaccord extends string = string,\n TAccountDispute extends string = string,\n TAccountRound extends string = string,\n TAccountFeeToken extends string = string,\n TAccountFilerTokenAccount extends string = string,\n TAccountFeeVault extends string = string,\n TAccountTokenProgram extends string = string,\n> = {\n caller: TransactionSigner<TAccountCaller>;\n subaccord: Address<TAccountSubaccord>;\n dispute: Address<TAccountDispute>;\n /** The shortfall round (`dispute.current_round`). */\n round: Address<TAccountRound>;\n feeToken: Address<TAccountFeeToken>;\n /**\n * Filer refund destination (Fail branch). Unused on the Redraw branch but\n * always validated — the cranker passes it regardless.\n */\n filerTokenAccount: Address<TAccountFilerTokenAccount>;\n feeVault?: Address<TAccountFeeVault>;\n tokenProgram?: Address<TAccountTokenProgram>;\n};\n\nexport async function getRedrawInstructionAsync<\n TAccountCaller extends string,\n TAccountSubaccord extends string,\n TAccountDispute extends string,\n TAccountRound extends string,\n TAccountFeeToken extends string,\n TAccountFilerTokenAccount extends string,\n TAccountFeeVault extends string,\n TAccountTokenProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: RedrawAsyncInput<\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound,\n TAccountFeeToken,\n TAccountFilerTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n RedrawInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound,\n TAccountFeeToken,\n TAccountFilerTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n caller: { value: input.caller ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n dispute: { value: input.dispute ?? null, isWritable: true },\n round: { value: input.round ?? null, isWritable: true },\n feeToken: { value: input.feeToken ?? null, isWritable: false },\n filerTokenAccount: {\n value: input.filerTokenAccount ?? null,\n isWritable: true,\n },\n feeVault: { value: input.feeVault ?? null, isWritable: true },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Resolve default values.\n if (!accounts.feeVault.value) {\n accounts.feeVault.value = await getProgramDerivedAddress({\n programAddress:\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\" as Address<\"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\">,\n seeds: [\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"subaccord\",\n accounts.subaccord.value,\n ),\n ),\n getBytesEncoder().encode(\n new Uint8Array([\n 6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206, 235,\n 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140, 245, 133,\n 126, 255, 0, 169,\n ]),\n ),\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"feeToken\",\n accounts.feeToken.value,\n ),\n ),\n ],\n });\n }\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\" as Address<\"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"caller\", accounts.caller),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"dispute\", accounts.dispute),\n getAccountMeta(\"round\", accounts.round),\n getAccountMeta(\"feeToken\", accounts.feeToken),\n getAccountMeta(\"filerTokenAccount\", accounts.filerTokenAccount),\n getAccountMeta(\"feeVault\", accounts.feeVault),\n getAccountMeta(\"tokenProgram\", accounts.tokenProgram),\n ],\n data: getRedrawInstructionDataEncoder().encode({}),\n programAddress,\n } as RedrawInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound,\n TAccountFeeToken,\n TAccountFilerTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n >);\n}\n\nexport type RedrawInput<\n TAccountCaller extends string = string,\n TAccountSubaccord extends string = string,\n TAccountDispute extends string = string,\n TAccountRound extends string = string,\n TAccountFeeToken extends string = string,\n TAccountFilerTokenAccount extends string = string,\n TAccountFeeVault extends string = string,\n TAccountTokenProgram extends string = string,\n> = {\n caller: TransactionSigner<TAccountCaller>;\n subaccord: Address<TAccountSubaccord>;\n dispute: Address<TAccountDispute>;\n /** The shortfall round (`dispute.current_round`). */\n round: Address<TAccountRound>;\n feeToken: Address<TAccountFeeToken>;\n /**\n * Filer refund destination (Fail branch). Unused on the Redraw branch but\n * always validated — the cranker passes it regardless.\n */\n filerTokenAccount: Address<TAccountFilerTokenAccount>;\n feeVault: Address<TAccountFeeVault>;\n tokenProgram?: Address<TAccountTokenProgram>;\n};\n\nexport function getRedrawInstruction<\n TAccountCaller extends string,\n TAccountSubaccord extends string,\n TAccountDispute extends string,\n TAccountRound extends string,\n TAccountFeeToken extends string,\n TAccountFilerTokenAccount extends string,\n TAccountFeeVault extends string,\n TAccountTokenProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: RedrawInput<\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound,\n TAccountFeeToken,\n TAccountFilerTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): RedrawInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound,\n TAccountFeeToken,\n TAccountFilerTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n caller: { value: input.caller ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n dispute: { value: input.dispute ?? null, isWritable: true },\n round: { value: input.round ?? null, isWritable: true },\n feeToken: { value: input.feeToken ?? null, isWritable: false },\n filerTokenAccount: {\n value: input.filerTokenAccount ?? null,\n isWritable: true,\n },\n feeVault: { value: input.feeVault ?? null, isWritable: true },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Resolve default values.\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\" as Address<\"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"caller\", accounts.caller),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"dispute\", accounts.dispute),\n getAccountMeta(\"round\", accounts.round),\n getAccountMeta(\"feeToken\", accounts.feeToken),\n getAccountMeta(\"filerTokenAccount\", accounts.filerTokenAccount),\n getAccountMeta(\"feeVault\", accounts.feeVault),\n getAccountMeta(\"tokenProgram\", accounts.tokenProgram),\n ],\n data: getRedrawInstructionDataEncoder().encode({}),\n programAddress,\n } as RedrawInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound,\n TAccountFeeToken,\n TAccountFilerTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n >);\n}\n\nexport type ParsedRedrawInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n caller: TAccountMetas[0];\n subaccord: TAccountMetas[1];\n dispute: TAccountMetas[2];\n /** The shortfall round (`dispute.current_round`). */\n round: TAccountMetas[3];\n feeToken: TAccountMetas[4];\n /**\n * Filer refund destination (Fail branch). Unused on the Redraw branch but\n * always validated — the cranker passes it regardless.\n */\n filerTokenAccount: TAccountMetas[5];\n feeVault: TAccountMetas[6];\n tokenProgram: TAccountMetas[7];\n };\n data: RedrawInstructionData;\n};\n\nexport function parseRedrawInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedRedrawInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 8) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 8,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n caller: getNextAccount(),\n subaccord: getNextAccount(),\n dispute: getNextAccount(),\n round: getNextAccount(),\n feeToken: getNextAccount(),\n filerTokenAccount: getNextAccount(),\n feeVault: getNextAccount(),\n tokenProgram: getNextAccount(),\n },\n data: getRedrawInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { findProgramIdentityPda } from \"../pdas\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\n\nexport const REQUEST_VRF_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 5, 87, 79, 152, 164, 176, 190, 226,\n]);\n\nexport function getRequestVrfDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(REQUEST_VRF_DISCRIMINATOR);\n}\n\nexport type RequestVrfInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountCaller extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountDispute extends string | AccountMeta<string> = string,\n TAccountOracleQueue extends string | AccountMeta<string> =\n \"Cuj97ggrhhidhbu39TijNVqE74xvKJ69gDervRUXAxGh\",\n TAccountProgramIdentity extends string | AccountMeta<string> = string,\n TAccountVrfProgram extends string | AccountMeta<string> =\n \"Vrf1RNUjXmQGjmQrQLvJHs9SNkvDJEsRVFPkfSQUwGz\",\n TAccountSlotHashes extends string | AccountMeta<string> =\n \"SysvarS1otHashes111111111111111111111111111\",\n TAccountSystemProgram extends string | AccountMeta<string> =\n \"11111111111111111111111111111111\",\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountCaller extends string\n ? WritableSignerAccount<TAccountCaller> &\n AccountSignerMeta<TAccountCaller>\n : TAccountCaller,\n TAccountSubaccord extends string\n ? ReadonlyAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountDispute extends string\n ? WritableAccount<TAccountDispute>\n : TAccountDispute,\n TAccountOracleQueue extends string\n ? WritableAccount<TAccountOracleQueue>\n : TAccountOracleQueue,\n TAccountProgramIdentity extends string\n ? ReadonlyAccount<TAccountProgramIdentity>\n : TAccountProgramIdentity,\n TAccountVrfProgram extends string\n ? ReadonlyAccount<TAccountVrfProgram>\n : TAccountVrfProgram,\n TAccountSlotHashes extends string\n ? ReadonlyAccount<TAccountSlotHashes>\n : TAccountSlotHashes,\n TAccountSystemProgram extends string\n ? ReadonlyAccount<TAccountSystemProgram>\n : TAccountSystemProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type RequestVrfInstructionData = { discriminator: ReadonlyUint8Array };\n\nexport type RequestVrfInstructionDataArgs = {};\n\nexport function getRequestVrfInstructionDataEncoder(): FixedSizeEncoder<RequestVrfInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([[\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)]]),\n (value) => ({ ...value, discriminator: REQUEST_VRF_DISCRIMINATOR }),\n );\n}\n\nexport function getRequestVrfInstructionDataDecoder(): FixedSizeDecoder<RequestVrfInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n ]);\n}\n\nexport function getRequestVrfInstructionDataCodec(): FixedSizeCodec<\n RequestVrfInstructionDataArgs,\n RequestVrfInstructionData\n> {\n return combineCodec(\n getRequestVrfInstructionDataEncoder(),\n getRequestVrfInstructionDataDecoder(),\n );\n}\n\nexport type RequestVrfAsyncInput<\n TAccountCaller extends string = string,\n TAccountSubaccord extends string = string,\n TAccountDispute extends string = string,\n TAccountOracleQueue extends string = string,\n TAccountProgramIdentity extends string = string,\n TAccountVrfProgram extends string = string,\n TAccountSlotHashes extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n caller: TransactionSigner<TAccountCaller>;\n subaccord: Address<TAccountSubaccord>;\n dispute: Address<TAccountDispute>;\n oracleQueue?: Address<TAccountOracleQueue>;\n programIdentity?: Address<TAccountProgramIdentity>;\n vrfProgram?: Address<TAccountVrfProgram>;\n slotHashes?: Address<TAccountSlotHashes>;\n systemProgram?: Address<TAccountSystemProgram>;\n};\n\nexport async function getRequestVrfInstructionAsync<\n TAccountCaller extends string,\n TAccountSubaccord extends string,\n TAccountDispute extends string,\n TAccountOracleQueue extends string,\n TAccountProgramIdentity extends string,\n TAccountVrfProgram extends string,\n TAccountSlotHashes extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: RequestVrfAsyncInput<\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountOracleQueue,\n TAccountProgramIdentity,\n TAccountVrfProgram,\n TAccountSlotHashes,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n RequestVrfInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountOracleQueue,\n TAccountProgramIdentity,\n TAccountVrfProgram,\n TAccountSlotHashes,\n TAccountSystemProgram\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n caller: { value: input.caller ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: false },\n dispute: { value: input.dispute ?? null, isWritable: true },\n oracleQueue: { value: input.oracleQueue ?? null, isWritable: true },\n programIdentity: {\n value: input.programIdentity ?? null,\n isWritable: false,\n },\n vrfProgram: { value: input.vrfProgram ?? null, isWritable: false },\n slotHashes: { value: input.slotHashes ?? null, isWritable: false },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Resolve default values.\n if (!accounts.oracleQueue.value) {\n accounts.oracleQueue.value =\n \"Cuj97ggrhhidhbu39TijNVqE74xvKJ69gDervRUXAxGh\" as Address<\"Cuj97ggrhhidhbu39TijNVqE74xvKJ69gDervRUXAxGh\">;\n }\n if (!accounts.programIdentity.value) {\n accounts.programIdentity.value = await findProgramIdentityPda();\n }\n if (!accounts.vrfProgram.value) {\n accounts.vrfProgram.value =\n \"Vrf1RNUjXmQGjmQrQLvJHs9SNkvDJEsRVFPkfSQUwGz\" as Address<\"Vrf1RNUjXmQGjmQrQLvJHs9SNkvDJEsRVFPkfSQUwGz\">;\n }\n if (!accounts.slotHashes.value) {\n accounts.slotHashes.value =\n \"SysvarS1otHashes111111111111111111111111111\" as Address<\"SysvarS1otHashes111111111111111111111111111\">;\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n \"11111111111111111111111111111111\" as Address<\"11111111111111111111111111111111\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"caller\", accounts.caller),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"dispute\", accounts.dispute),\n getAccountMeta(\"oracleQueue\", accounts.oracleQueue),\n getAccountMeta(\"programIdentity\", accounts.programIdentity),\n getAccountMeta(\"vrfProgram\", accounts.vrfProgram),\n getAccountMeta(\"slotHashes\", accounts.slotHashes),\n getAccountMeta(\"systemProgram\", accounts.systemProgram),\n ],\n data: getRequestVrfInstructionDataEncoder().encode({}),\n programAddress,\n } as RequestVrfInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountOracleQueue,\n TAccountProgramIdentity,\n TAccountVrfProgram,\n TAccountSlotHashes,\n TAccountSystemProgram\n >);\n}\n\nexport type RequestVrfInput<\n TAccountCaller extends string = string,\n TAccountSubaccord extends string = string,\n TAccountDispute extends string = string,\n TAccountOracleQueue extends string = string,\n TAccountProgramIdentity extends string = string,\n TAccountVrfProgram extends string = string,\n TAccountSlotHashes extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n caller: TransactionSigner<TAccountCaller>;\n subaccord: Address<TAccountSubaccord>;\n dispute: Address<TAccountDispute>;\n oracleQueue?: Address<TAccountOracleQueue>;\n programIdentity: Address<TAccountProgramIdentity>;\n vrfProgram?: Address<TAccountVrfProgram>;\n slotHashes?: Address<TAccountSlotHashes>;\n systemProgram?: Address<TAccountSystemProgram>;\n};\n\nexport function getRequestVrfInstruction<\n TAccountCaller extends string,\n TAccountSubaccord extends string,\n TAccountDispute extends string,\n TAccountOracleQueue extends string,\n TAccountProgramIdentity extends string,\n TAccountVrfProgram extends string,\n TAccountSlotHashes extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: RequestVrfInput<\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountOracleQueue,\n TAccountProgramIdentity,\n TAccountVrfProgram,\n TAccountSlotHashes,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): RequestVrfInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountOracleQueue,\n TAccountProgramIdentity,\n TAccountVrfProgram,\n TAccountSlotHashes,\n TAccountSystemProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n caller: { value: input.caller ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: false },\n dispute: { value: input.dispute ?? null, isWritable: true },\n oracleQueue: { value: input.oracleQueue ?? null, isWritable: true },\n programIdentity: {\n value: input.programIdentity ?? null,\n isWritable: false,\n },\n vrfProgram: { value: input.vrfProgram ?? null, isWritable: false },\n slotHashes: { value: input.slotHashes ?? null, isWritable: false },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Resolve default values.\n if (!accounts.oracleQueue.value) {\n accounts.oracleQueue.value =\n \"Cuj97ggrhhidhbu39TijNVqE74xvKJ69gDervRUXAxGh\" as Address<\"Cuj97ggrhhidhbu39TijNVqE74xvKJ69gDervRUXAxGh\">;\n }\n if (!accounts.vrfProgram.value) {\n accounts.vrfProgram.value =\n \"Vrf1RNUjXmQGjmQrQLvJHs9SNkvDJEsRVFPkfSQUwGz\" as Address<\"Vrf1RNUjXmQGjmQrQLvJHs9SNkvDJEsRVFPkfSQUwGz\">;\n }\n if (!accounts.slotHashes.value) {\n accounts.slotHashes.value =\n \"SysvarS1otHashes111111111111111111111111111\" as Address<\"SysvarS1otHashes111111111111111111111111111\">;\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n \"11111111111111111111111111111111\" as Address<\"11111111111111111111111111111111\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"caller\", accounts.caller),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"dispute\", accounts.dispute),\n getAccountMeta(\"oracleQueue\", accounts.oracleQueue),\n getAccountMeta(\"programIdentity\", accounts.programIdentity),\n getAccountMeta(\"vrfProgram\", accounts.vrfProgram),\n getAccountMeta(\"slotHashes\", accounts.slotHashes),\n getAccountMeta(\"systemProgram\", accounts.systemProgram),\n ],\n data: getRequestVrfInstructionDataEncoder().encode({}),\n programAddress,\n } as RequestVrfInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountOracleQueue,\n TAccountProgramIdentity,\n TAccountVrfProgram,\n TAccountSlotHashes,\n TAccountSystemProgram\n >);\n}\n\nexport type ParsedRequestVrfInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n caller: TAccountMetas[0];\n subaccord: TAccountMetas[1];\n dispute: TAccountMetas[2];\n oracleQueue: TAccountMetas[3];\n programIdentity: TAccountMetas[4];\n vrfProgram: TAccountMetas[5];\n slotHashes: TAccountMetas[6];\n systemProgram: TAccountMetas[7];\n };\n data: RequestVrfInstructionData;\n};\n\nexport function parseRequestVrfInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedRequestVrfInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 8) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 8,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n caller: getNextAccount(),\n subaccord: getNextAccount(),\n dispute: getNextAccount(),\n oracleQueue: getNextAccount(),\n programIdentity: getNextAccount(),\n vrfProgram: getNextAccount(),\n slotHashes: getNextAccount(),\n systemProgram: getNextAccount(),\n },\n data: getRequestVrfInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getArrayDecoder,\n getArrayEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n getAddressFromResolvedInstructionAccount,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { findJurorStakePda } from \"../pdas\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\nimport {\n getMSTNodeDecoder,\n getMSTNodeEncoder,\n type MSTNode,\n type MSTNodeArgs,\n} from \"../types\";\n\nexport const REQUEST_WITHDRAW_DISCRIMINATOR: ReadonlyUint8Array =\n new Uint8Array([137, 95, 187, 96, 250, 138, 31, 182]);\n\nexport function getRequestWithdrawDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n REQUEST_WITHDRAW_DISCRIMINATOR,\n );\n}\n\nexport type RequestWithdrawInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountJuror extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountJurorStake extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountJuror extends string\n ? WritableSignerAccount<TAccountJuror> &\n AccountSignerMeta<TAccountJuror>\n : TAccountJuror,\n TAccountSubaccord extends string\n ? WritableAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountJurorStake extends string\n ? WritableAccount<TAccountJurorStake>\n : TAccountJurorStake,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type RequestWithdrawInstructionData = {\n discriminator: ReadonlyUint8Array;\n amount: bigint;\n path: Array<MSTNode>;\n};\n\nexport type RequestWithdrawInstructionDataArgs = {\n amount: number | bigint;\n path: Array<MSTNodeArgs>;\n};\n\nexport function getRequestWithdrawInstructionDataEncoder(): Encoder<RequestWithdrawInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"amount\", getU64Encoder()],\n [\"path\", getArrayEncoder(getMSTNodeEncoder())],\n ]),\n (value) => ({ ...value, discriminator: REQUEST_WITHDRAW_DISCRIMINATOR }),\n );\n}\n\nexport function getRequestWithdrawInstructionDataDecoder(): Decoder<RequestWithdrawInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"amount\", getU64Decoder()],\n [\"path\", getArrayDecoder(getMSTNodeDecoder())],\n ]);\n}\n\nexport function getRequestWithdrawInstructionDataCodec(): Codec<\n RequestWithdrawInstructionDataArgs,\n RequestWithdrawInstructionData\n> {\n return combineCodec(\n getRequestWithdrawInstructionDataEncoder(),\n getRequestWithdrawInstructionDataDecoder(),\n );\n}\n\nexport type RequestWithdrawAsyncInput<\n TAccountJuror extends string = string,\n TAccountSubaccord extends string = string,\n TAccountJurorStake extends string = string,\n> = {\n juror: TransactionSigner<TAccountJuror>;\n subaccord: Address<TAccountSubaccord>;\n jurorStake?: Address<TAccountJurorStake>;\n amount: RequestWithdrawInstructionDataArgs[\"amount\"];\n path: RequestWithdrawInstructionDataArgs[\"path\"];\n};\n\nexport async function getRequestWithdrawInstructionAsync<\n TAccountJuror extends string,\n TAccountSubaccord extends string,\n TAccountJurorStake extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: RequestWithdrawAsyncInput<\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n RequestWithdrawInstruction<\n TProgramAddress,\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n juror: { value: input.juror ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n jurorStake: { value: input.jurorStake ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.jurorStake.value) {\n accounts.jurorStake.value = await findJurorStakePda({\n subaccord: getAddressFromResolvedInstructionAccount(\n \"subaccord\",\n accounts.subaccord.value,\n ),\n juror: getAddressFromResolvedInstructionAccount(\n \"juror\",\n accounts.juror.value,\n ),\n });\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"juror\", accounts.juror),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"jurorStake\", accounts.jurorStake),\n ],\n data: getRequestWithdrawInstructionDataEncoder().encode(\n args as RequestWithdrawInstructionDataArgs,\n ),\n programAddress,\n } as RequestWithdrawInstruction<\n TProgramAddress,\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake\n >);\n}\n\nexport type RequestWithdrawInput<\n TAccountJuror extends string = string,\n TAccountSubaccord extends string = string,\n TAccountJurorStake extends string = string,\n> = {\n juror: TransactionSigner<TAccountJuror>;\n subaccord: Address<TAccountSubaccord>;\n jurorStake: Address<TAccountJurorStake>;\n amount: RequestWithdrawInstructionDataArgs[\"amount\"];\n path: RequestWithdrawInstructionDataArgs[\"path\"];\n};\n\nexport function getRequestWithdrawInstruction<\n TAccountJuror extends string,\n TAccountSubaccord extends string,\n TAccountJurorStake extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: RequestWithdrawInput<\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake\n >,\n config?: { programAddress?: TProgramAddress },\n): RequestWithdrawInstruction<\n TProgramAddress,\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n juror: { value: input.juror ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n jurorStake: { value: input.jurorStake ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"juror\", accounts.juror),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"jurorStake\", accounts.jurorStake),\n ],\n data: getRequestWithdrawInstructionDataEncoder().encode(\n args as RequestWithdrawInstructionDataArgs,\n ),\n programAddress,\n } as RequestWithdrawInstruction<\n TProgramAddress,\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake\n >);\n}\n\nexport type ParsedRequestWithdrawInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n juror: TAccountMetas[0];\n subaccord: TAccountMetas[1];\n jurorStake: TAccountMetas[2];\n };\n data: RequestWithdrawInstructionData;\n};\n\nexport function parseRequestWithdrawInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedRequestWithdrawInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 3) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 3,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n juror: getNextAccount(),\n subaccord: getNextAccount(),\n jurorStake: getNextAccount(),\n },\n data: getRequestWithdrawInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\n\nexport const REVEAL_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 9, 35, 59, 190, 167, 249, 76, 115,\n]);\n\nexport function getRevealDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(REVEAL_DISCRIMINATOR);\n}\n\nexport type RevealInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountJuror extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountDispute extends string | AccountMeta<string> = string,\n TAccountRound extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountJuror extends string\n ? WritableSignerAccount<TAccountJuror> &\n AccountSignerMeta<TAccountJuror>\n : TAccountJuror,\n TAccountSubaccord extends string\n ? ReadonlyAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountDispute extends string\n ? WritableAccount<TAccountDispute>\n : TAccountDispute,\n TAccountRound extends string\n ? WritableAccount<TAccountRound>\n : TAccountRound,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type RevealInstructionData = {\n discriminator: ReadonlyUint8Array;\n vote: bigint;\n salt: ReadonlyUint8Array;\n};\n\nexport type RevealInstructionDataArgs = {\n vote: number | bigint;\n salt: ReadonlyUint8Array;\n};\n\nexport function getRevealInstructionDataEncoder(): FixedSizeEncoder<RevealInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"vote\", getU64Encoder()],\n [\"salt\", fixEncoderSize(getBytesEncoder(), 32)],\n ]),\n (value) => ({ ...value, discriminator: REVEAL_DISCRIMINATOR }),\n );\n}\n\nexport function getRevealInstructionDataDecoder(): FixedSizeDecoder<RevealInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"vote\", getU64Decoder()],\n [\"salt\", fixDecoderSize(getBytesDecoder(), 32)],\n ]);\n}\n\nexport function getRevealInstructionDataCodec(): FixedSizeCodec<\n RevealInstructionDataArgs,\n RevealInstructionData\n> {\n return combineCodec(\n getRevealInstructionDataEncoder(),\n getRevealInstructionDataDecoder(),\n );\n}\n\nexport type RevealInput<\n TAccountJuror extends string = string,\n TAccountSubaccord extends string = string,\n TAccountDispute extends string = string,\n TAccountRound extends string = string,\n> = {\n juror: TransactionSigner<TAccountJuror>;\n subaccord: Address<TAccountSubaccord>;\n dispute: Address<TAccountDispute>;\n round: Address<TAccountRound>;\n vote: RevealInstructionDataArgs[\"vote\"];\n salt: RevealInstructionDataArgs[\"salt\"];\n};\n\nexport function getRevealInstruction<\n TAccountJuror extends string,\n TAccountSubaccord extends string,\n TAccountDispute extends string,\n TAccountRound extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: RevealInput<\n TAccountJuror,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound\n >,\n config?: { programAddress?: TProgramAddress },\n): RevealInstruction<\n TProgramAddress,\n TAccountJuror,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n juror: { value: input.juror ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: false },\n dispute: { value: input.dispute ?? null, isWritable: true },\n round: { value: input.round ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"juror\", accounts.juror),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"dispute\", accounts.dispute),\n getAccountMeta(\"round\", accounts.round),\n ],\n data: getRevealInstructionDataEncoder().encode(\n args as RevealInstructionDataArgs,\n ),\n programAddress,\n } as RevealInstruction<\n TProgramAddress,\n TAccountJuror,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound\n >);\n}\n\nexport type ParsedRevealInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n juror: TAccountMetas[0];\n subaccord: TAccountMetas[1];\n dispute: TAccountMetas[2];\n round: TAccountMetas[3];\n };\n data: RevealInstructionData;\n};\n\nexport function parseRevealInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedRevealInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 4) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 4,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n juror: getNextAccount(),\n subaccord: getNextAccount(),\n dispute: getNextAccount(),\n round: getNextAccount(),\n },\n data: getRevealInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n getU32Decoder,\n getU32Encoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n getAddressFromResolvedInstructionAccount,\n getNonNullResolvedInstructionInput,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { findRoundPda } from \"../pdas\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\n\nexport const SETTLE_ROUND_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 40, 101, 18, 1, 31, 129, 52, 77,\n]);\n\nexport function getSettleRoundDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n SETTLE_ROUND_DISCRIMINATOR,\n );\n}\n\nexport type SettleRoundInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountCaller extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountDispute extends string | AccountMeta<string> = string,\n TAccountRound extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountCaller extends string\n ? WritableSignerAccount<TAccountCaller> &\n AccountSignerMeta<TAccountCaller>\n : TAccountCaller,\n TAccountSubaccord extends string\n ? ReadonlyAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountDispute extends string\n ? ReadonlyAccount<TAccountDispute>\n : TAccountDispute,\n TAccountRound extends string\n ? WritableAccount<TAccountRound>\n : TAccountRound,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type SettleRoundInstructionData = {\n discriminator: ReadonlyUint8Array;\n roundIdx: number;\n};\n\nexport type SettleRoundInstructionDataArgs = { roundIdx: number };\n\nexport function getSettleRoundInstructionDataEncoder(): FixedSizeEncoder<SettleRoundInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"roundIdx\", getU32Encoder()],\n ]),\n (value) => ({ ...value, discriminator: SETTLE_ROUND_DISCRIMINATOR }),\n );\n}\n\nexport function getSettleRoundInstructionDataDecoder(): FixedSizeDecoder<SettleRoundInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"roundIdx\", getU32Decoder()],\n ]);\n}\n\nexport function getSettleRoundInstructionDataCodec(): FixedSizeCodec<\n SettleRoundInstructionDataArgs,\n SettleRoundInstructionData\n> {\n return combineCodec(\n getSettleRoundInstructionDataEncoder(),\n getSettleRoundInstructionDataDecoder(),\n );\n}\n\nexport type SettleRoundAsyncInput<\n TAccountCaller extends string = string,\n TAccountSubaccord extends string = string,\n TAccountDispute extends string = string,\n TAccountRound extends string = string,\n> = {\n caller: TransactionSigner<TAccountCaller>;\n subaccord: Address<TAccountSubaccord>;\n dispute: Address<TAccountDispute>;\n round?: Address<TAccountRound>;\n roundIdx: SettleRoundInstructionDataArgs[\"roundIdx\"];\n};\n\nexport async function getSettleRoundInstructionAsync<\n TAccountCaller extends string,\n TAccountSubaccord extends string,\n TAccountDispute extends string,\n TAccountRound extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: SettleRoundAsyncInput<\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n SettleRoundInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n caller: { value: input.caller ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: false },\n dispute: { value: input.dispute ?? null, isWritable: false },\n round: { value: input.round ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.round.value) {\n accounts.round.value = await findRoundPda({\n dispute: getAddressFromResolvedInstructionAccount(\n \"dispute\",\n accounts.dispute.value,\n ),\n roundIdx: getNonNullResolvedInstructionInput(\"roundIdx\", args.roundIdx),\n });\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"caller\", accounts.caller),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"dispute\", accounts.dispute),\n getAccountMeta(\"round\", accounts.round),\n ],\n data: getSettleRoundInstructionDataEncoder().encode(\n args as SettleRoundInstructionDataArgs,\n ),\n programAddress,\n } as SettleRoundInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound\n >);\n}\n\nexport type SettleRoundInput<\n TAccountCaller extends string = string,\n TAccountSubaccord extends string = string,\n TAccountDispute extends string = string,\n TAccountRound extends string = string,\n> = {\n caller: TransactionSigner<TAccountCaller>;\n subaccord: Address<TAccountSubaccord>;\n dispute: Address<TAccountDispute>;\n round: Address<TAccountRound>;\n roundIdx: SettleRoundInstructionDataArgs[\"roundIdx\"];\n};\n\nexport function getSettleRoundInstruction<\n TAccountCaller extends string,\n TAccountSubaccord extends string,\n TAccountDispute extends string,\n TAccountRound extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: SettleRoundInput<\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound\n >,\n config?: { programAddress?: TProgramAddress },\n): SettleRoundInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n caller: { value: input.caller ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: false },\n dispute: { value: input.dispute ?? null, isWritable: false },\n round: { value: input.round ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"caller\", accounts.caller),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"dispute\", accounts.dispute),\n getAccountMeta(\"round\", accounts.round),\n ],\n data: getSettleRoundInstructionDataEncoder().encode(\n args as SettleRoundInstructionDataArgs,\n ),\n programAddress,\n } as SettleRoundInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound\n >);\n}\n\nexport type ParsedSettleRoundInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n caller: TAccountMetas[0];\n subaccord: TAccountMetas[1];\n dispute: TAccountMetas[2];\n round: TAccountMetas[3];\n };\n data: SettleRoundInstructionData;\n};\n\nexport function parseSettleRoundInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedSettleRoundInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 4) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 4,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n caller: getNextAccount(),\n subaccord: getNextAccount(),\n dispute: getNextAccount(),\n round: getNextAccount(),\n },\n data: getSettleRoundInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getAddressEncoder,\n getArrayDecoder,\n getArrayEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n getAddressFromResolvedInstructionAccount,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { findAccordStatePda, findJurorStakePda } from \"../pdas\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\nimport {\n getMSTNodeDecoder,\n getMSTNodeEncoder,\n type MSTNode,\n type MSTNodeArgs,\n} from \"../types\";\n\nexport const STAKE_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 206, 176, 202, 18, 200, 209, 179, 108,\n]);\n\nexport function getStakeDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(STAKE_DISCRIMINATOR);\n}\n\nexport type StakeInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountJuror extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountAccordState extends string | AccountMeta<string> = string,\n TAccountJurorStake extends string | AccountMeta<string> = string,\n TAccountStakingToken extends string | AccountMeta<string> = string,\n TAccountJurorTokenAccount extends string | AccountMeta<string> = string,\n TAccountStakeVault extends string | AccountMeta<string> = string,\n TAccountTokenProgram extends string | AccountMeta<string> =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\",\n TAccountAssociatedTokenProgram extends string | AccountMeta<string> =\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\",\n TAccountSystemProgram extends string | AccountMeta<string> =\n \"11111111111111111111111111111111\",\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountJuror extends string\n ? WritableSignerAccount<TAccountJuror> &\n AccountSignerMeta<TAccountJuror>\n : TAccountJuror,\n TAccountSubaccord extends string\n ? WritableAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountAccordState extends string\n ? ReadonlyAccount<TAccountAccordState>\n : TAccountAccordState,\n TAccountJurorStake extends string\n ? WritableAccount<TAccountJurorStake>\n : TAccountJurorStake,\n TAccountStakingToken extends string\n ? ReadonlyAccount<TAccountStakingToken>\n : TAccountStakingToken,\n TAccountJurorTokenAccount extends string\n ? WritableAccount<TAccountJurorTokenAccount>\n : TAccountJurorTokenAccount,\n TAccountStakeVault extends string\n ? WritableAccount<TAccountStakeVault>\n : TAccountStakeVault,\n TAccountTokenProgram extends string\n ? ReadonlyAccount<TAccountTokenProgram>\n : TAccountTokenProgram,\n TAccountAssociatedTokenProgram extends string\n ? ReadonlyAccount<TAccountAssociatedTokenProgram>\n : TAccountAssociatedTokenProgram,\n TAccountSystemProgram extends string\n ? ReadonlyAccount<TAccountSystemProgram>\n : TAccountSystemProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type StakeInstructionData = {\n discriminator: ReadonlyUint8Array;\n amount: bigint;\n path: Array<MSTNode>;\n};\n\nexport type StakeInstructionDataArgs = {\n amount: number | bigint;\n path: Array<MSTNodeArgs>;\n};\n\nexport function getStakeInstructionDataEncoder(): Encoder<StakeInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"amount\", getU64Encoder()],\n [\"path\", getArrayEncoder(getMSTNodeEncoder())],\n ]),\n (value) => ({ ...value, discriminator: STAKE_DISCRIMINATOR }),\n );\n}\n\nexport function getStakeInstructionDataDecoder(): Decoder<StakeInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"amount\", getU64Decoder()],\n [\"path\", getArrayDecoder(getMSTNodeDecoder())],\n ]);\n}\n\nexport function getStakeInstructionDataCodec(): Codec<\n StakeInstructionDataArgs,\n StakeInstructionData\n> {\n return combineCodec(\n getStakeInstructionDataEncoder(),\n getStakeInstructionDataDecoder(),\n );\n}\n\nexport type StakeAsyncInput<\n TAccountJuror extends string = string,\n TAccountSubaccord extends string = string,\n TAccountAccordState extends string = string,\n TAccountJurorStake extends string = string,\n TAccountStakingToken extends string = string,\n TAccountJurorTokenAccount extends string = string,\n TAccountStakeVault extends string = string,\n TAccountTokenProgram extends string = string,\n TAccountAssociatedTokenProgram extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n juror: TransactionSigner<TAccountJuror>;\n subaccord: Address<TAccountSubaccord>;\n /** Circuit breaker (ADR-0007): stake reverts while paused. */\n accordState?: Address<TAccountAccordState>;\n jurorStake?: Address<TAccountJurorStake>;\n /** Must be the Subaccord's declared staking token. */\n stakingToken: Address<TAccountStakingToken>;\n jurorTokenAccount?: Address<TAccountJurorTokenAccount>;\n /** Subaccord PDA's stake_vault ATA; `authority` (wallet) is the Subaccord PDA. */\n stakeVault?: Address<TAccountStakeVault>;\n tokenProgram?: Address<TAccountTokenProgram>;\n associatedTokenProgram?: Address<TAccountAssociatedTokenProgram>;\n systemProgram?: Address<TAccountSystemProgram>;\n amount: StakeInstructionDataArgs[\"amount\"];\n path: StakeInstructionDataArgs[\"path\"];\n};\n\nexport async function getStakeInstructionAsync<\n TAccountJuror extends string,\n TAccountSubaccord extends string,\n TAccountAccordState extends string,\n TAccountJurorStake extends string,\n TAccountStakingToken extends string,\n TAccountJurorTokenAccount extends string,\n TAccountStakeVault extends string,\n TAccountTokenProgram extends string,\n TAccountAssociatedTokenProgram extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: StakeAsyncInput<\n TAccountJuror,\n TAccountSubaccord,\n TAccountAccordState,\n TAccountJurorStake,\n TAccountStakingToken,\n TAccountJurorTokenAccount,\n TAccountStakeVault,\n TAccountTokenProgram,\n TAccountAssociatedTokenProgram,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n StakeInstruction<\n TProgramAddress,\n TAccountJuror,\n TAccountSubaccord,\n TAccountAccordState,\n TAccountJurorStake,\n TAccountStakingToken,\n TAccountJurorTokenAccount,\n TAccountStakeVault,\n TAccountTokenProgram,\n TAccountAssociatedTokenProgram,\n TAccountSystemProgram\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n juror: { value: input.juror ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n accordState: { value: input.accordState ?? null, isWritable: false },\n jurorStake: { value: input.jurorStake ?? null, isWritable: true },\n stakingToken: { value: input.stakingToken ?? null, isWritable: false },\n jurorTokenAccount: {\n value: input.jurorTokenAccount ?? null,\n isWritable: true,\n },\n stakeVault: { value: input.stakeVault ?? null, isWritable: true },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n associatedTokenProgram: {\n value: input.associatedTokenProgram ?? null,\n isWritable: false,\n },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.accordState.value) {\n accounts.accordState.value = await findAccordStatePda();\n }\n if (!accounts.jurorStake.value) {\n accounts.jurorStake.value = await findJurorStakePda({\n subaccord: getAddressFromResolvedInstructionAccount(\n \"subaccord\",\n accounts.subaccord.value,\n ),\n juror: getAddressFromResolvedInstructionAccount(\n \"juror\",\n accounts.juror.value,\n ),\n });\n }\n if (!accounts.jurorTokenAccount.value) {\n accounts.jurorTokenAccount.value = await getProgramDerivedAddress({\n programAddress:\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\" as Address<\"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\">,\n seeds: [\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"juror\",\n accounts.juror.value,\n ),\n ),\n getBytesEncoder().encode(\n new Uint8Array([\n 6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206, 235,\n 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140, 245, 133,\n 126, 255, 0, 169,\n ]),\n ),\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"stakingToken\",\n accounts.stakingToken.value,\n ),\n ),\n ],\n });\n }\n if (!accounts.stakeVault.value) {\n accounts.stakeVault.value = await getProgramDerivedAddress({\n programAddress:\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\" as Address<\"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\">,\n seeds: [\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"subaccord\",\n accounts.subaccord.value,\n ),\n ),\n getBytesEncoder().encode(\n new Uint8Array([\n 6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206, 235,\n 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140, 245, 133,\n 126, 255, 0, 169,\n ]),\n ),\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"stakingToken\",\n accounts.stakingToken.value,\n ),\n ),\n ],\n });\n }\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\" as Address<\"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\">;\n }\n if (!accounts.associatedTokenProgram.value) {\n accounts.associatedTokenProgram.value =\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\" as Address<\"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\">;\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n \"11111111111111111111111111111111\" as Address<\"11111111111111111111111111111111\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"juror\", accounts.juror),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"accordState\", accounts.accordState),\n getAccountMeta(\"jurorStake\", accounts.jurorStake),\n getAccountMeta(\"stakingToken\", accounts.stakingToken),\n getAccountMeta(\"jurorTokenAccount\", accounts.jurorTokenAccount),\n getAccountMeta(\"stakeVault\", accounts.stakeVault),\n getAccountMeta(\"tokenProgram\", accounts.tokenProgram),\n getAccountMeta(\"associatedTokenProgram\", accounts.associatedTokenProgram),\n getAccountMeta(\"systemProgram\", accounts.systemProgram),\n ],\n data: getStakeInstructionDataEncoder().encode(\n args as StakeInstructionDataArgs,\n ),\n programAddress,\n } as StakeInstruction<\n TProgramAddress,\n TAccountJuror,\n TAccountSubaccord,\n TAccountAccordState,\n TAccountJurorStake,\n TAccountStakingToken,\n TAccountJurorTokenAccount,\n TAccountStakeVault,\n TAccountTokenProgram,\n TAccountAssociatedTokenProgram,\n TAccountSystemProgram\n >);\n}\n\nexport type StakeInput<\n TAccountJuror extends string = string,\n TAccountSubaccord extends string = string,\n TAccountAccordState extends string = string,\n TAccountJurorStake extends string = string,\n TAccountStakingToken extends string = string,\n TAccountJurorTokenAccount extends string = string,\n TAccountStakeVault extends string = string,\n TAccountTokenProgram extends string = string,\n TAccountAssociatedTokenProgram extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n juror: TransactionSigner<TAccountJuror>;\n subaccord: Address<TAccountSubaccord>;\n /** Circuit breaker (ADR-0007): stake reverts while paused. */\n accordState: Address<TAccountAccordState>;\n jurorStake: Address<TAccountJurorStake>;\n /** Must be the Subaccord's declared staking token. */\n stakingToken: Address<TAccountStakingToken>;\n jurorTokenAccount: Address<TAccountJurorTokenAccount>;\n /** Subaccord PDA's stake_vault ATA; `authority` (wallet) is the Subaccord PDA. */\n stakeVault: Address<TAccountStakeVault>;\n tokenProgram?: Address<TAccountTokenProgram>;\n associatedTokenProgram?: Address<TAccountAssociatedTokenProgram>;\n systemProgram?: Address<TAccountSystemProgram>;\n amount: StakeInstructionDataArgs[\"amount\"];\n path: StakeInstructionDataArgs[\"path\"];\n};\n\nexport function getStakeInstruction<\n TAccountJuror extends string,\n TAccountSubaccord extends string,\n TAccountAccordState extends string,\n TAccountJurorStake extends string,\n TAccountStakingToken extends string,\n TAccountJurorTokenAccount extends string,\n TAccountStakeVault extends string,\n TAccountTokenProgram extends string,\n TAccountAssociatedTokenProgram extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: StakeInput<\n TAccountJuror,\n TAccountSubaccord,\n TAccountAccordState,\n TAccountJurorStake,\n TAccountStakingToken,\n TAccountJurorTokenAccount,\n TAccountStakeVault,\n TAccountTokenProgram,\n TAccountAssociatedTokenProgram,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): StakeInstruction<\n TProgramAddress,\n TAccountJuror,\n TAccountSubaccord,\n TAccountAccordState,\n TAccountJurorStake,\n TAccountStakingToken,\n TAccountJurorTokenAccount,\n TAccountStakeVault,\n TAccountTokenProgram,\n TAccountAssociatedTokenProgram,\n TAccountSystemProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n juror: { value: input.juror ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n accordState: { value: input.accordState ?? null, isWritable: false },\n jurorStake: { value: input.jurorStake ?? null, isWritable: true },\n stakingToken: { value: input.stakingToken ?? null, isWritable: false },\n jurorTokenAccount: {\n value: input.jurorTokenAccount ?? null,\n isWritable: true,\n },\n stakeVault: { value: input.stakeVault ?? null, isWritable: true },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n associatedTokenProgram: {\n value: input.associatedTokenProgram ?? null,\n isWritable: false,\n },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\" as Address<\"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\">;\n }\n if (!accounts.associatedTokenProgram.value) {\n accounts.associatedTokenProgram.value =\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\" as Address<\"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\">;\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n \"11111111111111111111111111111111\" as Address<\"11111111111111111111111111111111\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"juror\", accounts.juror),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"accordState\", accounts.accordState),\n getAccountMeta(\"jurorStake\", accounts.jurorStake),\n getAccountMeta(\"stakingToken\", accounts.stakingToken),\n getAccountMeta(\"jurorTokenAccount\", accounts.jurorTokenAccount),\n getAccountMeta(\"stakeVault\", accounts.stakeVault),\n getAccountMeta(\"tokenProgram\", accounts.tokenProgram),\n getAccountMeta(\"associatedTokenProgram\", accounts.associatedTokenProgram),\n getAccountMeta(\"systemProgram\", accounts.systemProgram),\n ],\n data: getStakeInstructionDataEncoder().encode(\n args as StakeInstructionDataArgs,\n ),\n programAddress,\n } as StakeInstruction<\n TProgramAddress,\n TAccountJuror,\n TAccountSubaccord,\n TAccountAccordState,\n TAccountJurorStake,\n TAccountStakingToken,\n TAccountJurorTokenAccount,\n TAccountStakeVault,\n TAccountTokenProgram,\n TAccountAssociatedTokenProgram,\n TAccountSystemProgram\n >);\n}\n\nexport type ParsedStakeInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n juror: TAccountMetas[0];\n subaccord: TAccountMetas[1];\n /** Circuit breaker (ADR-0007): stake reverts while paused. */\n accordState: TAccountMetas[2];\n jurorStake: TAccountMetas[3];\n /** Must be the Subaccord's declared staking token. */\n stakingToken: TAccountMetas[4];\n jurorTokenAccount: TAccountMetas[5];\n /** Subaccord PDA's stake_vault ATA; `authority` (wallet) is the Subaccord PDA. */\n stakeVault: TAccountMetas[6];\n tokenProgram: TAccountMetas[7];\n associatedTokenProgram: TAccountMetas[8];\n systemProgram: TAccountMetas[9];\n };\n data: StakeInstructionData;\n};\n\nexport function parseStakeInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedStakeInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 10) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 10,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n juror: getNextAccount(),\n subaccord: getNextAccount(),\n accordState: getNextAccount(),\n jurorStake: getNextAccount(),\n stakingToken: getNextAccount(),\n jurorTokenAccount: getNextAccount(),\n stakeVault: getNextAccount(),\n tokenProgram: getNextAccount(),\n associatedTokenProgram: getNextAccount(),\n systemProgram: getNextAccount(),\n },\n data: getStakeInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getAddressEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n getAddressFromResolvedInstructionAccount,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { findJurorStakePda } from \"../pdas\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\n\nexport const WITHDRAW_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 183, 18, 70, 156, 148, 109, 161, 34,\n]);\n\nexport function getWithdrawDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(WITHDRAW_DISCRIMINATOR);\n}\n\nexport type WithdrawInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountJuror extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountJurorStake extends string | AccountMeta<string> = string,\n TAccountStakingToken extends string | AccountMeta<string> = string,\n TAccountJurorTokenAccount extends string | AccountMeta<string> = string,\n TAccountStakeVault extends string | AccountMeta<string> = string,\n TAccountTokenProgram extends string | AccountMeta<string> =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\",\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountJuror extends string\n ? WritableSignerAccount<TAccountJuror> &\n AccountSignerMeta<TAccountJuror>\n : TAccountJuror,\n TAccountSubaccord extends string\n ? WritableAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountJurorStake extends string\n ? WritableAccount<TAccountJurorStake>\n : TAccountJurorStake,\n TAccountStakingToken extends string\n ? ReadonlyAccount<TAccountStakingToken>\n : TAccountStakingToken,\n TAccountJurorTokenAccount extends string\n ? WritableAccount<TAccountJurorTokenAccount>\n : TAccountJurorTokenAccount,\n TAccountStakeVault extends string\n ? WritableAccount<TAccountStakeVault>\n : TAccountStakeVault,\n TAccountTokenProgram extends string\n ? ReadonlyAccount<TAccountTokenProgram>\n : TAccountTokenProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type WithdrawInstructionData = { discriminator: ReadonlyUint8Array };\n\nexport type WithdrawInstructionDataArgs = {};\n\nexport function getWithdrawInstructionDataEncoder(): FixedSizeEncoder<WithdrawInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([[\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)]]),\n (value) => ({ ...value, discriminator: WITHDRAW_DISCRIMINATOR }),\n );\n}\n\nexport function getWithdrawInstructionDataDecoder(): FixedSizeDecoder<WithdrawInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n ]);\n}\n\nexport function getWithdrawInstructionDataCodec(): FixedSizeCodec<\n WithdrawInstructionDataArgs,\n WithdrawInstructionData\n> {\n return combineCodec(\n getWithdrawInstructionDataEncoder(),\n getWithdrawInstructionDataDecoder(),\n );\n}\n\nexport type WithdrawAsyncInput<\n TAccountJuror extends string = string,\n TAccountSubaccord extends string = string,\n TAccountJurorStake extends string = string,\n TAccountStakingToken extends string = string,\n TAccountJurorTokenAccount extends string = string,\n TAccountStakeVault extends string = string,\n TAccountTokenProgram extends string = string,\n> = {\n juror: TransactionSigner<TAccountJuror>;\n subaccord: Address<TAccountSubaccord>;\n jurorStake?: Address<TAccountJurorStake>;\n stakingToken: Address<TAccountStakingToken>;\n jurorTokenAccount?: Address<TAccountJurorTokenAccount>;\n stakeVault?: Address<TAccountStakeVault>;\n tokenProgram?: Address<TAccountTokenProgram>;\n};\n\nexport async function getWithdrawInstructionAsync<\n TAccountJuror extends string,\n TAccountSubaccord extends string,\n TAccountJurorStake extends string,\n TAccountStakingToken extends string,\n TAccountJurorTokenAccount extends string,\n TAccountStakeVault extends string,\n TAccountTokenProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: WithdrawAsyncInput<\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake,\n TAccountStakingToken,\n TAccountJurorTokenAccount,\n TAccountStakeVault,\n TAccountTokenProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n WithdrawInstruction<\n TProgramAddress,\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake,\n TAccountStakingToken,\n TAccountJurorTokenAccount,\n TAccountStakeVault,\n TAccountTokenProgram\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n juror: { value: input.juror ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n jurorStake: { value: input.jurorStake ?? null, isWritable: true },\n stakingToken: { value: input.stakingToken ?? null, isWritable: false },\n jurorTokenAccount: {\n value: input.jurorTokenAccount ?? null,\n isWritable: true,\n },\n stakeVault: { value: input.stakeVault ?? null, isWritable: true },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Resolve default values.\n if (!accounts.jurorStake.value) {\n accounts.jurorStake.value = await findJurorStakePda({\n subaccord: getAddressFromResolvedInstructionAccount(\n \"subaccord\",\n accounts.subaccord.value,\n ),\n juror: getAddressFromResolvedInstructionAccount(\n \"juror\",\n accounts.juror.value,\n ),\n });\n }\n if (!accounts.jurorTokenAccount.value) {\n accounts.jurorTokenAccount.value = await getProgramDerivedAddress({\n programAddress:\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\" as Address<\"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\">,\n seeds: [\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"juror\",\n accounts.juror.value,\n ),\n ),\n getBytesEncoder().encode(\n new Uint8Array([\n 6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206, 235,\n 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140, 245, 133,\n 126, 255, 0, 169,\n ]),\n ),\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"stakingToken\",\n accounts.stakingToken.value,\n ),\n ),\n ],\n });\n }\n if (!accounts.stakeVault.value) {\n accounts.stakeVault.value = await getProgramDerivedAddress({\n programAddress:\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\" as Address<\"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\">,\n seeds: [\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"subaccord\",\n accounts.subaccord.value,\n ),\n ),\n getBytesEncoder().encode(\n new Uint8Array([\n 6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206, 235,\n 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140, 245, 133,\n 126, 255, 0, 169,\n ]),\n ),\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"stakingToken\",\n accounts.stakingToken.value,\n ),\n ),\n ],\n });\n }\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\" as Address<\"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"juror\", accounts.juror),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"jurorStake\", accounts.jurorStake),\n getAccountMeta(\"stakingToken\", accounts.stakingToken),\n getAccountMeta(\"jurorTokenAccount\", accounts.jurorTokenAccount),\n getAccountMeta(\"stakeVault\", accounts.stakeVault),\n getAccountMeta(\"tokenProgram\", accounts.tokenProgram),\n ],\n data: getWithdrawInstructionDataEncoder().encode({}),\n programAddress,\n } as WithdrawInstruction<\n TProgramAddress,\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake,\n TAccountStakingToken,\n TAccountJurorTokenAccount,\n TAccountStakeVault,\n TAccountTokenProgram\n >);\n}\n\nexport type WithdrawInput<\n TAccountJuror extends string = string,\n TAccountSubaccord extends string = string,\n TAccountJurorStake extends string = string,\n TAccountStakingToken extends string = string,\n TAccountJurorTokenAccount extends string = string,\n TAccountStakeVault extends string = string,\n TAccountTokenProgram extends string = string,\n> = {\n juror: TransactionSigner<TAccountJuror>;\n subaccord: Address<TAccountSubaccord>;\n jurorStake: Address<TAccountJurorStake>;\n stakingToken: Address<TAccountStakingToken>;\n jurorTokenAccount: Address<TAccountJurorTokenAccount>;\n stakeVault: Address<TAccountStakeVault>;\n tokenProgram?: Address<TAccountTokenProgram>;\n};\n\nexport function getWithdrawInstruction<\n TAccountJuror extends string,\n TAccountSubaccord extends string,\n TAccountJurorStake extends string,\n TAccountStakingToken extends string,\n TAccountJurorTokenAccount extends string,\n TAccountStakeVault extends string,\n TAccountTokenProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: WithdrawInput<\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake,\n TAccountStakingToken,\n TAccountJurorTokenAccount,\n TAccountStakeVault,\n TAccountTokenProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): WithdrawInstruction<\n TProgramAddress,\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake,\n TAccountStakingToken,\n TAccountJurorTokenAccount,\n TAccountStakeVault,\n TAccountTokenProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n juror: { value: input.juror ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n jurorStake: { value: input.jurorStake ?? null, isWritable: true },\n stakingToken: { value: input.stakingToken ?? null, isWritable: false },\n jurorTokenAccount: {\n value: input.jurorTokenAccount ?? null,\n isWritable: true,\n },\n stakeVault: { value: input.stakeVault ?? null, isWritable: true },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Resolve default values.\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\" as Address<\"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"juror\", accounts.juror),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"jurorStake\", accounts.jurorStake),\n getAccountMeta(\"stakingToken\", accounts.stakingToken),\n getAccountMeta(\"jurorTokenAccount\", accounts.jurorTokenAccount),\n getAccountMeta(\"stakeVault\", accounts.stakeVault),\n getAccountMeta(\"tokenProgram\", accounts.tokenProgram),\n ],\n data: getWithdrawInstructionDataEncoder().encode({}),\n programAddress,\n } as WithdrawInstruction<\n TProgramAddress,\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake,\n TAccountStakingToken,\n TAccountJurorTokenAccount,\n TAccountStakeVault,\n TAccountTokenProgram\n >);\n}\n\nexport type ParsedWithdrawInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n juror: TAccountMetas[0];\n subaccord: TAccountMetas[1];\n jurorStake: TAccountMetas[2];\n stakingToken: TAccountMetas[3];\n jurorTokenAccount: TAccountMetas[4];\n stakeVault: TAccountMetas[5];\n tokenProgram: TAccountMetas[6];\n };\n data: WithdrawInstructionData;\n};\n\nexport function parseWithdrawInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedWithdrawInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 7) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 7,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n juror: getNextAccount(),\n subaccord: getNextAccount(),\n jurorStake: getNextAccount(),\n stakingToken: getNextAccount(),\n jurorTokenAccount: getNextAccount(),\n stakeVault: getNextAccount(),\n tokenProgram: getNextAccount(),\n },\n data: getWithdrawInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getAddressEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n getAddressFromResolvedInstructionAccount,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { findJurorStakePda } from \"../pdas\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\n\nexport const WITHDRAW_FEES_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 198, 212, 171, 109, 144, 215, 174, 89,\n]);\n\nexport function getWithdrawFeesDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n WITHDRAW_FEES_DISCRIMINATOR,\n );\n}\n\nexport type WithdrawFeesInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountJuror extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountJurorStake extends string | AccountMeta<string> = string,\n TAccountFeeToken extends string | AccountMeta<string> = string,\n TAccountJurorFeeTokenAccount extends string | AccountMeta<string> = string,\n TAccountFeeVault extends string | AccountMeta<string> = string,\n TAccountTokenProgram extends string | AccountMeta<string> =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\",\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountJuror extends string\n ? WritableSignerAccount<TAccountJuror> &\n AccountSignerMeta<TAccountJuror>\n : TAccountJuror,\n TAccountSubaccord extends string\n ? WritableAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountJurorStake extends string\n ? WritableAccount<TAccountJurorStake>\n : TAccountJurorStake,\n TAccountFeeToken extends string\n ? ReadonlyAccount<TAccountFeeToken>\n : TAccountFeeToken,\n TAccountJurorFeeTokenAccount extends string\n ? WritableAccount<TAccountJurorFeeTokenAccount>\n : TAccountJurorFeeTokenAccount,\n TAccountFeeVault extends string\n ? WritableAccount<TAccountFeeVault>\n : TAccountFeeVault,\n TAccountTokenProgram extends string\n ? ReadonlyAccount<TAccountTokenProgram>\n : TAccountTokenProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type WithdrawFeesInstructionData = { discriminator: ReadonlyUint8Array };\n\nexport type WithdrawFeesInstructionDataArgs = {};\n\nexport function getWithdrawFeesInstructionDataEncoder(): FixedSizeEncoder<WithdrawFeesInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([[\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)]]),\n (value) => ({ ...value, discriminator: WITHDRAW_FEES_DISCRIMINATOR }),\n );\n}\n\nexport function getWithdrawFeesInstructionDataDecoder(): FixedSizeDecoder<WithdrawFeesInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n ]);\n}\n\nexport function getWithdrawFeesInstructionDataCodec(): FixedSizeCodec<\n WithdrawFeesInstructionDataArgs,\n WithdrawFeesInstructionData\n> {\n return combineCodec(\n getWithdrawFeesInstructionDataEncoder(),\n getWithdrawFeesInstructionDataDecoder(),\n );\n}\n\nexport type WithdrawFeesAsyncInput<\n TAccountJuror extends string = string,\n TAccountSubaccord extends string = string,\n TAccountJurorStake extends string = string,\n TAccountFeeToken extends string = string,\n TAccountJurorFeeTokenAccount extends string = string,\n TAccountFeeVault extends string = string,\n TAccountTokenProgram extends string = string,\n> = {\n juror: TransactionSigner<TAccountJuror>;\n subaccord: Address<TAccountSubaccord>;\n jurorStake?: Address<TAccountJurorStake>;\n feeToken: Address<TAccountFeeToken>;\n jurorFeeTokenAccount?: Address<TAccountJurorFeeTokenAccount>;\n feeVault?: Address<TAccountFeeVault>;\n tokenProgram?: Address<TAccountTokenProgram>;\n};\n\nexport async function getWithdrawFeesInstructionAsync<\n TAccountJuror extends string,\n TAccountSubaccord extends string,\n TAccountJurorStake extends string,\n TAccountFeeToken extends string,\n TAccountJurorFeeTokenAccount extends string,\n TAccountFeeVault extends string,\n TAccountTokenProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: WithdrawFeesAsyncInput<\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake,\n TAccountFeeToken,\n TAccountJurorFeeTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n WithdrawFeesInstruction<\n TProgramAddress,\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake,\n TAccountFeeToken,\n TAccountJurorFeeTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n juror: { value: input.juror ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n jurorStake: { value: input.jurorStake ?? null, isWritable: true },\n feeToken: { value: input.feeToken ?? null, isWritable: false },\n jurorFeeTokenAccount: {\n value: input.jurorFeeTokenAccount ?? null,\n isWritable: true,\n },\n feeVault: { value: input.feeVault ?? null, isWritable: true },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Resolve default values.\n if (!accounts.jurorStake.value) {\n accounts.jurorStake.value = await findJurorStakePda({\n subaccord: getAddressFromResolvedInstructionAccount(\n \"subaccord\",\n accounts.subaccord.value,\n ),\n juror: getAddressFromResolvedInstructionAccount(\n \"juror\",\n accounts.juror.value,\n ),\n });\n }\n if (!accounts.jurorFeeTokenAccount.value) {\n accounts.jurorFeeTokenAccount.value = await getProgramDerivedAddress({\n programAddress:\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\" as Address<\"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\">,\n seeds: [\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"juror\",\n accounts.juror.value,\n ),\n ),\n getBytesEncoder().encode(\n new Uint8Array([\n 6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206, 235,\n 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140, 245, 133,\n 126, 255, 0, 169,\n ]),\n ),\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"feeToken\",\n accounts.feeToken.value,\n ),\n ),\n ],\n });\n }\n if (!accounts.feeVault.value) {\n accounts.feeVault.value = await getProgramDerivedAddress({\n programAddress:\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\" as Address<\"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\">,\n seeds: [\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"subaccord\",\n accounts.subaccord.value,\n ),\n ),\n getBytesEncoder().encode(\n new Uint8Array([\n 6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206, 235,\n 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140, 245, 133,\n 126, 255, 0, 169,\n ]),\n ),\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"feeToken\",\n accounts.feeToken.value,\n ),\n ),\n ],\n });\n }\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\" as Address<\"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"juror\", accounts.juror),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"jurorStake\", accounts.jurorStake),\n getAccountMeta(\"feeToken\", accounts.feeToken),\n getAccountMeta(\"jurorFeeTokenAccount\", accounts.jurorFeeTokenAccount),\n getAccountMeta(\"feeVault\", accounts.feeVault),\n getAccountMeta(\"tokenProgram\", accounts.tokenProgram),\n ],\n data: getWithdrawFeesInstructionDataEncoder().encode({}),\n programAddress,\n } as WithdrawFeesInstruction<\n TProgramAddress,\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake,\n TAccountFeeToken,\n TAccountJurorFeeTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n >);\n}\n\nexport type WithdrawFeesInput<\n TAccountJuror extends string = string,\n TAccountSubaccord extends string = string,\n TAccountJurorStake extends string = string,\n TAccountFeeToken extends string = string,\n TAccountJurorFeeTokenAccount extends string = string,\n TAccountFeeVault extends string = string,\n TAccountTokenProgram extends string = string,\n> = {\n juror: TransactionSigner<TAccountJuror>;\n subaccord: Address<TAccountSubaccord>;\n jurorStake: Address<TAccountJurorStake>;\n feeToken: Address<TAccountFeeToken>;\n jurorFeeTokenAccount: Address<TAccountJurorFeeTokenAccount>;\n feeVault: Address<TAccountFeeVault>;\n tokenProgram?: Address<TAccountTokenProgram>;\n};\n\nexport function getWithdrawFeesInstruction<\n TAccountJuror extends string,\n TAccountSubaccord extends string,\n TAccountJurorStake extends string,\n TAccountFeeToken extends string,\n TAccountJurorFeeTokenAccount extends string,\n TAccountFeeVault extends string,\n TAccountTokenProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: WithdrawFeesInput<\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake,\n TAccountFeeToken,\n TAccountJurorFeeTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): WithdrawFeesInstruction<\n TProgramAddress,\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake,\n TAccountFeeToken,\n TAccountJurorFeeTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n juror: { value: input.juror ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n jurorStake: { value: input.jurorStake ?? null, isWritable: true },\n feeToken: { value: input.feeToken ?? null, isWritable: false },\n jurorFeeTokenAccount: {\n value: input.jurorFeeTokenAccount ?? null,\n isWritable: true,\n },\n feeVault: { value: input.feeVault ?? null, isWritable: true },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Resolve default values.\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\" as Address<\"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"juror\", accounts.juror),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"jurorStake\", accounts.jurorStake),\n getAccountMeta(\"feeToken\", accounts.feeToken),\n getAccountMeta(\"jurorFeeTokenAccount\", accounts.jurorFeeTokenAccount),\n getAccountMeta(\"feeVault\", accounts.feeVault),\n getAccountMeta(\"tokenProgram\", accounts.tokenProgram),\n ],\n data: getWithdrawFeesInstructionDataEncoder().encode({}),\n programAddress,\n } as WithdrawFeesInstruction<\n TProgramAddress,\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake,\n TAccountFeeToken,\n TAccountJurorFeeTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n >);\n}\n\nexport type ParsedWithdrawFeesInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n juror: TAccountMetas[0];\n subaccord: TAccountMetas[1];\n jurorStake: TAccountMetas[2];\n feeToken: TAccountMetas[3];\n jurorFeeTokenAccount: TAccountMetas[4];\n feeVault: TAccountMetas[5];\n tokenProgram: TAccountMetas[6];\n };\n data: WithdrawFeesInstructionData;\n};\n\nexport function parseWithdrawFeesInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedWithdrawFeesInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 7) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 7,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n juror: getNextAccount(),\n subaccord: getNextAccount(),\n jurorStake: getNextAccount(),\n feeToken: getNextAccount(),\n jurorFeeTokenAccount: getNextAccount(),\n feeVault: getNextAccount(),\n tokenProgram: getNextAccount(),\n },\n data: getWithdrawFeesInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * Canonical PDA derivations for every Accord account.\n *\n * Seeds sourced from `programs/accord/src/state.rs` + `constants.rs`:\n * SEED_SUBACCORD = \"subaccord\" SEED_DISPUTE = \"dispute\"\n * SEED_JUROR_STAKE = \"stake\" SEED_ROUND = \"round\"\n * SEED_PENDING_UPDATE = \"update\" SEED_APPEAL_BOND = \"bond\"\n * SEED_ACCORD_STATE = \"state\"\n *\n * Five of seven PDAs are emitted by Codama into `./generated/pdas/` and\n * re-exported here unchanged. `Round` is hand-written because its on-chain seeds\n * reference `dispute.key()` (a runtime address, not a static field) — Codama\n * cannot encode that statically, so it omits it.\n *\n * ADR-0012: the `Snapshot` PDA is gone (snapshot layer deleted).\n *\n * Every function returns `ProgramDerivedAddress` = `{ address: Address; bump: number }`.\n *\n * @see ADR-0010\n */\n\nimport {\n getAddressEncoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n getU32Encoder,\n type Address,\n type ProgramDerivedAddress,\n} from \"@solana/kit\";\n\n// --- Program identity -------------------------------------------------------\n\nexport const ACCORD_PROGRAM_ID =\n \"cordhVoshqRV6kzGBmM89A66wuusJGsDCvLMHPLyKed\" as Address<\"cordhVoshqRV6kzGBmM89A66wuusJGsDCvLMHPLyKed\">;\n\n// --- Re-exported generated PDA helpers (5/7) ---------------------------------\n\nexport {\n findAppealBondPda,\n type AppealBondSeeds,\n} from \"./generated/pdas/appealBond\";\nexport { findDisputePda, type DisputeSeeds } from \"./generated/pdas/dispute\";\nexport {\n findJurorStakePda,\n type JurorStakeSeeds,\n} from \"./generated/pdas/jurorStake\";\nexport { findAccordStatePda } from \"./generated/pdas/accordState\";\nexport {\n findPendingUpdatePda,\n type PendingUpdateSeeds,\n} from \"./generated/pdas/pendingUpdate\";\nexport {\n findSubaccordPda,\n type SubaccordSeeds,\n} from \"./generated/pdas/subaccord\";\nexport {\n findProgramIdentityPda,\n} from \"./generated/pdas/programIdentity\";\n\n// --- Hand-written PDA helper (1/7) ------------------------------------------\n// Round: seeds use `dispute.key()` (the account address), which Codama can't\n// statically encode. Same encoding pattern as AppealBond:\n// [seed_bytes, dispute_address, u32_le(round_idx)].\n\nconst ROUND_SEED = new Uint8Array([114, 111, 117, 110, 100]); // b\"round\"\n\nexport type RoundSeeds = {\n dispute: Address;\n roundIdx: number;\n};\n\nexport async function findRoundPda(\n seeds: RoundSeeds,\n config: { programAddress?: Address } = {},\n): Promise<ProgramDerivedAddress> {\n const { programAddress = ACCORD_PROGRAM_ID } = config;\n return await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getBytesEncoder().encode(ROUND_SEED),\n getAddressEncoder().encode(seeds.dispute),\n getU32Encoder().encode(seeds.roundIdx),\n ],\n });\n}\n","/**\n * Concrete adapter — wires every `Accord*Client` seam (declared by the\n * `src/methods/*.ts` modules) to the Codama-generated Solana Kit client.\n *\n * The method modules stay pure orchestration over typed seams; this module is\n * the single implementor the {@link Accord} facade binds. Each seam method maps\n * 1:1 to a generated `getXxxInstruction` builder (sync, all-explicit accounts)\n * or to a generated account fetcher, so a drift in the IDL surfaces here as a\n * compile error — exactly the ADR-0010 guarantee.\n *\n * ADR-0012: the snapshot trio (post/challenge/finalize) and the one-shot `draw`\n * are gone; `stake`/`unstake` thread an accumulator `path`; `draw_seat` fills\n * the panel one seat per tx against `dispute.frozen_root`; `commit_vrf_callback`\n * (invoked by the oracle) freezes the root.\n *\n * Signing model: the facade's loaded wallet (`accord.signer`) is the\n * `TransactionSigner` for every instruction's signing account.\n *\n * @see ADR-0010, ADR-0012\n */\n\nimport {\n AccountRole,\n getAddressDecoder,\n getAddressEncoder,\n type AccountMeta,\n type Address,\n type Instruction,\n} from \"@solana/kit\";\n\nimport type { Accord } from \"./accord.js\";\n\nimport {\n getCreateDisputeInstruction,\n type CreateDisputeInstructionDataArgs,\n} from \"./generated/instructions/createDispute.js\";\nimport { getCreateSubaccordInstruction } from \"./generated/instructions/createSubaccord.js\";\nimport { getProposeSubaccordUpdateInstruction } from \"./generated/instructions/proposeSubaccordUpdate.js\";\nimport { getExecuteSubaccordUpdateInstruction } from \"./generated/instructions/executeSubaccordUpdate.js\";\nimport { getInitializePauseInstruction } from \"./generated/instructions/initializePause.js\";\nimport { getPauseInstruction } from \"./generated/instructions/pause.js\";\nimport { getProposeUnpauseInstruction } from \"./generated/instructions/proposeUnpause.js\";\nimport { getExecuteUnpauseInstruction } from \"./generated/instructions/executeUnpause.js\";\nimport { getStakeInstruction } from \"./generated/instructions/stake.js\";\nimport { getRequestWithdrawInstruction } from \"./generated/instructions/requestWithdraw.js\";\nimport { getWithdrawInstruction } from \"./generated/instructions/withdraw.js\";\nimport { getReconcileStakeInstruction } from \"./generated/instructions/reconcileStake.js\";\nimport { getReclaimSlotInstruction } from \"./generated/instructions/reclaimSlot.js\";\nimport { getWithdrawFeesInstruction } from \"./generated/instructions/withdrawFees.js\";\nimport { getSettleRoundInstruction } from \"./generated/instructions/settleRound.js\";\nimport { getCancelDisputeInstruction } from \"./generated/instructions/cancelDispute.js\";\nimport { getRequestVrfInstruction } from \"./generated/instructions/requestVrf.js\";\nimport { getDrawSeatInstruction } from \"./generated/instructions/drawSeat.js\";\nimport { getCommitInstruction } from \"./generated/instructions/commit.js\";\nimport { getRevealInstruction } from \"./generated/instructions/reveal.js\";\nimport { getFinalizeRoundInstruction } from \"./generated/instructions/finalizeRound.js\";\nimport { getFinalizeDisputeInstruction } from \"./generated/instructions/finalizeDispute.js\";\nimport { getRedrawInstruction } from \"./generated/instructions/redraw.js\";\nimport { getAppealInstruction } from \"./generated/instructions/appeal.js\";\nimport { getClaimAppealRefundInstruction } from \"./generated/instructions/claimAppealRefund.js\";\nimport { getPruneJurorInstruction } from \"./generated/instructions/pruneJuror.js\";\n\nimport type {\n AccordAppealClient,\n AppealAccounts,\n ClaimRefundAccounts,\n} from \"./methods/appeal.js\";\nimport { NO_RULING } from \"./methods/dispute.js\";\nimport type {\n AccordDisputeClient,\n CreateDisputeAccounts,\n CreateDisputeArgs,\n DisputeRulingView,\n} from \"./methods/dispute.js\";\nimport type {\n AccordLifecycleClient,\n CreateSubaccordArgs,\n} from \"./methods/lifecycle.js\";\nimport type {\n AccordStakingClient,\n JurorStakeView,\n StakingAccounts,\n WithdrawFeesAccounts,\n} from \"./methods/staking.js\";\nimport type {\n AccordSettlementClient,\n CancelDisputeAccounts,\n SettleRoundAccounts,\n} from \"./methods/settlement.js\";\nimport type { MSTNode } from \"./methods/mst.js\";\nimport type { AccordVotingClient, VotingAccounts } from \"./methods/voting.js\";\nimport type {\n AccordVrfClient,\n SeatMembership,\n VrfDrawAccounts,\n} from \"./methods/vrf.js\";\n\n/** Union of every seam the adapter implements. */\nexport interface AccordAdapter\n extends\n AccordDisputeClient,\n AccordLifecycleClient,\n AccordStakingClient,\n AccordSettlementClient,\n AccordVrfClient,\n AccordVotingClient,\n AccordAppealClient {}\n\n/**\n * Build the concrete adapter bound to an {@link Accord} facade instance. The\n * returned object satisfies all six `Accord*Client` seams, so the pure\n * orchestration functions in `src/methods/*.ts` can drive the chain end-to-end.\n */\nexport function createAccordAdapter(accord: Accord): AccordAdapter {\n return {\n // ── dispute (Arbitrable CPI API) ────────────────────────────────────────\n buildCreateDispute(input) {\n const { accounts, args } = input;\n return getCreateDisputeInstruction(\n {\n filer: accord.signer,\n // Data-free rent payer (create_dispute.rs): the facade pins it to\n // its wallet signer, same as filer — wallet filers pay their own\n // rent; PDA filers CPI from their program with a crank caller.\n rentPayer: accord.signer,\n subaccord: accounts.subaccord,\n accordState: accounts.accordState,\n dispute: input.disputePda,\n feeToken: accounts.feeToken,\n filerTokenAccount: accounts.filerTokenAccount,\n feeVault: accounts.feeVault,\n options: args.options as CreateDisputeInstructionDataArgs[\"options\"],\n evidenceHash: args.evidenceHash,\n nonce: args.nonce,\n fee: args.fee,\n },\n { programAddress: input.programId },\n );\n },\n async fetchDispute(address): Promise<DisputeRulingView | null> {\n const m = await accord.client.accord.accounts.dispute.fetchMaybe(address);\n if (!m.exists) return null;\n const fr = m.data.finalRuling; // u64; u64::MAX sentinel = no ruling yet (ADR-0025)\n return { finalRuling: fr === NO_RULING ? null : fr };\n },\n\n // ── lifecycle (Subaccord + circuit breaker) ────────────────────────────\n buildCreateSubaccord(input) {\n return getCreateSubaccordInstruction(\n {\n creator: accord.signer,\n subaccord: input.subaccordPda,\n stakingToken: input.args.stakingToken,\n feeToken: input.args.feeToken,\n ...mapCreateSubaccordArgs(input.args),\n },\n { programAddress: input.programId },\n );\n },\n buildProposeSubaccordUpdate(input) {\n return getProposeSubaccordUpdateInstruction(\n {\n authority: accord.signer,\n // Data-free rent payer (propose_subaccord_update.rs, ADR-0028): the\n // facade pins it to its wallet signer, same as the authority —\n // wallet authorities pay their own rent; PDA authorities (e.g.\n // Canon's list PDA) CPI from their program with a crank caller.\n rentPayer: accord.signer,\n subaccord: input.subaccord,\n pendingUpdate: input.pendingUpdatePda,\n nonce: input.nonce,\n payload: input.payload,\n },\n { programAddress: input.programId },\n );\n },\n buildExecuteSubaccordUpdate(input) {\n return getExecuteSubaccordUpdateInstruction(\n {\n caller: accord.signer,\n subaccord: input.subaccord,\n pendingUpdate: input.pendingUpdate,\n },\n { programAddress: input.programId },\n );\n },\n buildInitializePause(input) {\n return getInitializePauseInstruction(\n {\n authority: accord.signer,\n accordState: input.accordStatePda,\n },\n { programAddress: input.programId },\n );\n },\n buildPause(input) {\n return getPauseInstruction(\n { authority: accord.signer, accordState: input.accordState },\n { programAddress: input.programId },\n );\n },\n buildProposeUnpause(input) {\n return getProposeUnpauseInstruction(\n { authority: accord.signer, accordState: input.accordState },\n { programAddress: input.programId },\n );\n },\n buildExecuteUnpause(input) {\n return getExecuteUnpauseInstruction(\n { caller: accord.signer, accordState: input.accordState },\n { programAddress: input.programId },\n );\n },\n async fetchPendingUpdateExecuteAfter(\n pendingUpdate,\n ): Promise<bigint | null> {\n const m =\n await accord.client.accord.accounts.pendingUpdate.fetchMaybe(\n pendingUpdate,\n );\n if (!m.exists) return null;\n return m.data.executeAfterSlot;\n },\n\n // ── staking (ADR-0012: path-verified accumulator update) ───────────────\n buildStake(input) {\n if (!input.accounts.accordState) {\n throw new Error(\n \"StakePausedStateMissing: stake requires the accordState PDA\",\n );\n }\n const ix = getStakeInstruction(\n {\n juror: accord.signer,\n subaccord: input.accounts.subaccord,\n accordState: input.accounts.accordState,\n jurorStake: input.accounts.jurorStake,\n stakingToken: input.accounts.stakingToken,\n jurorTokenAccount: input.accounts.jurorTokenAccount,\n stakeVault: input.accounts.stakeVault,\n amount: input.amount,\n path: mapPath(input.path),\n },\n { programAddress: input.programId },\n );\n // PROG-ATTESTATION: credential-gated Subaccords require the juror's SAS\n // attestation as remaining_accounts[0] (read-only). Omitted on stake-only\n // Subaccords — the on-chain gate no-ops.\n return input.attestation\n ? appendRemaining(ix, [{ address: input.attestation, isWritable: false }])\n : ix;\n },\n buildRequestWithdraw(input) {\n return getRequestWithdrawInstruction(\n {\n juror: accord.signer,\n subaccord: input.accounts.subaccord,\n jurorStake: input.accounts.jurorStake,\n amount: input.amount,\n path: mapPath(input.path),\n },\n { programAddress: input.programId },\n );\n },\n buildWithdraw(input) {\n const a = input.accounts;\n if (!a.stakingToken || !a.jurorTokenAccount || !a.stakeVault) {\n throw new Error(\n \"InvalidWithdrawAccounts: withdraw requires stakingToken, jurorTokenAccount, stakeVault\",\n );\n }\n return getWithdrawInstruction(\n {\n juror: accord.signer,\n subaccord: a.subaccord,\n jurorStake: a.jurorStake,\n stakingToken: a.stakingToken,\n jurorTokenAccount: a.jurorTokenAccount,\n stakeVault: a.stakeVault,\n },\n { programAddress: input.programId },\n );\n },\n buildReconcileStake(input) {\n return getReconcileStakeInstruction(\n {\n caller: accord.signer,\n subaccord: input.accounts.subaccord,\n jurorStake: input.accounts.jurorStake,\n path: mapPath(input.path),\n },\n { programAddress: input.programId },\n );\n },\n buildReclaimSlot(input) {\n return getReclaimSlotInstruction(\n {\n caller: accord.signer,\n subaccord: input.accounts.subaccord,\n jurorStake: input.accounts.jurorStake,\n path: mapPath(input.path),\n },\n { programAddress: input.programId },\n );\n },\n async fetchJurorStake(jurorStake): Promise<JurorStakeView | null> {\n const m =\n await accord.client.accord.accounts.jurorStake.fetchMaybe(jurorStake);\n if (!m.exists) return null;\n return {\n juror: m.data.juror,\n staked: m.data.staked,\n feesEarned: m.data.feesEarned,\n activeDraws: m.data.activeDraws,\n };\n },\n buildWithdrawFees(input) {\n return getWithdrawFeesInstruction(\n {\n juror: accord.signer,\n subaccord: input.accounts.subaccord,\n jurorStake: input.accounts.jurorStake,\n feeToken: input.accounts.feeToken,\n jurorFeeTokenAccount: input.accounts.jurorFeeTokenAccount,\n feeVault: input.accounts.feeVault,\n },\n { programAddress: input.programId },\n );\n },\n buildPruneJuror(input) {\n const ix = getPruneJurorInstruction(\n {\n caller: accord.signer,\n juror: input.accounts.juror,\n subaccord: input.accounts.subaccord,\n jurorStake: input.accounts.jurorStake,\n path: mapPath(input.path),\n },\n { programAddress: input.programId },\n );\n // remaining_accounts[0] = the expired juror's SAS attestation (read-only).\n return appendRemaining(ix, [\n { address: input.attestation, isWritable: false },\n ]);\n },\n\n // ── settlement (per-round crank + dispute cancellation) ───────────────\n buildSettleRound(input) {\n const ix = getSettleRoundInstruction(\n {\n caller: accord.signer,\n subaccord: input.accounts.subaccord,\n dispute: input.accounts.dispute,\n round: input.accounts.round,\n roundIdx: input.roundIdx,\n },\n { programAddress: input.programId },\n );\n return appendRemaining(ix, input.remainingAccounts);\n },\n buildCancelDispute(input) {\n const ix = getCancelDisputeInstruction(\n {\n caller: accord.signer,\n subaccord: input.accounts.subaccord,\n dispute: input.accounts.dispute,\n feeToken: input.accounts.feeToken,\n filerTokenAccount: input.accounts.filerTokenAccount,\n feeVault: input.accounts.feeVault,\n },\n { programAddress: input.programId },\n );\n return appendRemaining(ix, input.remainingAccounts);\n },\n\n // ── VRF + per-seat draw (ADR-0009/0012) ────────────────────────────────\n buildRequestVrf(input) {\n return getRequestVrfInstruction(\n {\n caller: accord.signer,\n subaccord: input.accounts.subaccord,\n dispute: input.accounts.dispute,\n oracleQueue: input.extras.oracleQueue,\n programIdentity: input.extras.programIdentity,\n },\n { programAddress: input.programId },\n );\n },\n buildDrawSeat(input) {\n const ix = getDrawSeatInstruction(\n {\n caller: accord.signer,\n dispute: input.accounts.dispute,\n subaccord: input.accounts.subaccord,\n round: input.roundPda,\n seat: input.seat,\n retries: input.retries,\n leaf: mapLeaf(input.leaf),\n proof: mapPath(input.proof),\n index: input.index,\n },\n { programAddress: input.programId },\n );\n // remaining_accounts[0] = the drawn juror's JurorStake PDA (writable).\n return appendRemaining(ix, [input.jurorStake]);\n },\n async fetchCommittedVrf(dispute): Promise<Uint8Array | null> {\n const m = await accord.client.accord.accounts.dispute.fetchMaybe(dispute);\n if (!m.exists) return null;\n const vrf = m.data.committedVrf;\n return vrf.__option === \"Some\" ? new Uint8Array(vrf.value) : null;\n },\n\n // ── voting ─────────────────────────────────────────────────────────────\n buildCommit(input) {\n return getCommitInstruction(\n {\n juror: accord.signer,\n subaccord: input.accounts.subaccord,\n dispute: input.accounts.dispute,\n round: input.accounts.round,\n commitment: input.commitment,\n },\n { programAddress: input.programId },\n );\n },\n buildReveal(input) {\n return getRevealInstruction(\n {\n juror: accord.signer,\n subaccord: input.accounts.subaccord,\n dispute: input.accounts.dispute,\n round: input.accounts.round,\n vote: input.vote,\n salt: input.salt,\n },\n { programAddress: input.programId },\n );\n },\n buildFinalizeRound(input) {\n const ix = getFinalizeRoundInstruction(\n {\n caller: accord.signer,\n subaccord: input.accounts.subaccord,\n dispute: input.accounts.dispute,\n round: input.accounts.round,\n },\n { programAddress: input.programId },\n );\n return appendRemaining(ix, input.remainingAccounts ?? []);\n },\n buildFinalizeDispute(input) {\n const ix = getFinalizeDisputeInstruction(\n {\n caller: accord.signer,\n subaccord: input.accounts.subaccord,\n dispute: input.accounts.dispute,\n round: input.accounts.round,\n },\n { programAddress: input.programId },\n );\n return appendRemaining(ix, input.remainingAccounts);\n },\n buildRedraw(input) {\n const ix = getRedrawInstruction(\n {\n caller: accord.signer,\n subaccord: input.accounts.subaccord,\n dispute: input.accounts.dispute,\n round: input.accounts.round,\n feeToken: input.accounts.feeToken,\n filerTokenAccount: input.accounts.filerTokenAccount,\n feeVault: input.accounts.feeVault,\n tokenProgram: input.accounts.tokenProgram,\n },\n { programAddress: input.programId },\n );\n return appendRemaining(ix, input.remainingAccounts ?? []);\n },\n encodeAddress(address) {\n return new Uint8Array(getAddressEncoder().encode(address));\n },\n\n // ── appeal ─────────────────────────────────────────────────────────────\n buildAppeal(input) {\n return getAppealInstruction(\n {\n appellant: accord.signer,\n ...mapAppealAccounts(input.accounts),\n newEvidenceHash: input.newEvidenceHash,\n },\n { programAddress: input.programId },\n );\n },\n buildClaimAppealRefund(input) {\n return getClaimAppealRefundInstruction(\n {\n caller: accord.signer,\n subaccord: input.accounts.subaccord,\n dispute: input.accounts.dispute,\n appealBond: input.accounts.appealBond,\n feeToken: input.accounts.feeToken,\n claimantTokenAccount: input.accounts.claimantTokenAccount,\n feeVault: input.accounts.feeVault,\n roundIdx: input.roundIdx,\n },\n { programAddress: input.programId },\n );\n },\n };\n}\n\n// ── helpers ─────────────────────────────────────────────────────────────────\n\n/** SDK `CreateSubaccordArgs` → generated instruction-data args. L-4: mints are\n * accounts (not instruction data) — extracted by the caller in\n * `buildCreateSubaccord`. */\nfunction mapCreateSubaccordArgs(\n args: CreateSubaccordArgs,\n): Omit<CreateSubaccordArgs, \"stakingToken\" | \"feeToken\" | \"jurorCredential\" | \"jurorSchema\"> & {\n jurorCredential: Address;\n jurorSchema: Address;\n} {\n return {\n domainRef: args.domainRef,\n evidenceSpec: args.evidenceSpec,\n minStake: args.minStake,\n alphaBps: args.alphaBps,\n reviewWindow: args.reviewWindow,\n commitWindow: args.commitWindow,\n revealWindow: args.revealWindow,\n appealWindow: args.appealWindow,\n maxAppeals: args.maxAppeals,\n minJurySize: args.minJurySize,\n aggregation: args.aggregation,\n feePerJuror: args.feePerJuror,\n revealThresholdBps: args.revealThresholdBps,\n shortfallPolicy: args.shortfallPolicy,\n maxDrawAttempts: args.maxDrawAttempts,\n coherenceTolBps: args.coherenceTolBps,\n authority: args.authority,\n evidenceOperator: args.evidenceOperator,\n depth: args.depth,\n // PROG-ATTESTTION: optional credential gate — default to the zero pubkey\n // (stake-only) when the caller omits them.\n jurorCredential:\n args.jurorCredential ??\n (\"11111111111111111111111111111111\" as Address),\n jurorSchema:\n args.jurorSchema ?? (\"11111111111111111111111111111111\" as Address),\n };\n}\n\n/** Map seam `AppealAccounts` → generated `appeal` instruction accounts. */\nfunction mapAppealAccounts(a: AppealAccounts) {\n return {\n subaccord: a.subaccord,\n accordState: a.accordState,\n dispute: a.dispute,\n round: a.round,\n appealBond: a.appealBond,\n feeToken: a.feeToken,\n appellantTokenAccount: a.appellantTokenAccount,\n feeVault: a.feeVault,\n };\n}\n\n/**\n * SDK MST `MSTNode` (byte-oriented) → generated args. `siblingHash` is a\n * `[u8;32]`; `siblingSum` is a u64. Shapes line up 1:1 — this wrapper keeps the\n * import boundary explicit.\n */\nfunction mapPath(\n path: MSTNode[],\n): { siblingHash: Uint8Array; siblingSum: number | bigint }[] {\n return path.map((p) => ({\n siblingHash: p.siblingHash,\n siblingSum: p.siblingSum,\n }));\n}\n\n/** SDK `LeafClaim` (byte-oriented juror) → generated args (`Address` juror). */\nfunction mapLeaf(leaf: { juror: Uint8Array; stake: bigint }): {\n juror: Address;\n stake: number | bigint;\n} {\n return {\n juror: getAddressDecoder().decode(leaf.juror),\n stake: leaf.stake,\n };\n}\n\n/**\n * Append `remaining_accounts` as non-signer metas. A bare {@link Address} is\n * WRITABLE (historical behavior — JurorStake/AppealBond PDAs the chain mutates:\n * slashes, refunds, `active_draws` bumps). Pass `{ address, isWritable: false }`\n * for read-only remaining accounts (PROG-ATTESTATION: the juror's SAS\n * attestation, which the handler only verifies, never mutates).\n */\ntype RemainingAccount = Address | { address: Address; isWritable?: boolean };\n\nfunction appendRemaining(\n ix: Instruction,\n extra: readonly RemainingAccount[],\n): Instruction {\n if (extra.length === 0) return ix;\n const metas: AccountMeta[] = extra.map((e) => {\n if (typeof e === \"string\") {\n return { address: e, role: AccountRole.WRITABLE };\n }\n return {\n address: e.address,\n role: e.isWritable === false ? AccountRole.READONLY : AccountRole.WRITABLE,\n };\n });\n return Object.freeze({\n ...ix,\n accounts: Object.freeze([...(ix.accounts ?? []), ...metas]),\n }) as Instruction;\n}\n\n// silence the unused-import lint for `VotingAccounts`/`VrfDrawAccounts`/etc.\n// which are referenced only in the seam composition above.\nexport type { SeatMembership, VrfDrawAccounts, VotingAccounts };\n","/**\n * dispute.ts — the PRIMARY external surface of @useaccord/sdk.\n *\n * Two methods every Arbitrable integrates against:\n * - {@link createDispute} — files a Dispute (CPI from an Arbitrable program,\n * - {@link getRuling} — lazy read of a dispute's `final_ruling`\n * (u64 with the `u64::MAX` no-ruling sentinel; `null` until the dispute\n * reaches `Final` — ADR-0025).\n *\n * Per ADR-0010 the SDK is two layers: a Codama-generated Kit client (drift-free\n * instruction builders + account codecs) and a thin hand-written facade that\n * owns domain logic. This module is the facade layer for dispute intake; it\n * stays orchestration-only and consumes the generated client through the\n * {@link AccordDisputeClient} seam, which the Foundation task wires to a real\n * adapter. The domain logic that is NOT generated — PDA derivation, fee math,\n * option validation — lives here and is unit-tested independently of the chain.\n *\n * Sources of truth:\n * - Instruction + accounts: programs/accord/src/lib.rs (create_dispute, get_ruling)\n * - Dispute struct + seeds: programs/accord/src/state.rs (Dispute, SEED_DISPUTE)\n * - v1 constants: programs/accord/src/constants.rs (MAX_OPTIONS)\n */\n\nimport {\n getAddressEncoder,\n getProgramDerivedAddress,\n type Address,\n type Instruction,\n} from \"@solana/kit\";\nimport { MAX_OPTIONS } from \"../constants.js\";\nimport { Aggregation } from \"../types.js\";\n\nexport { MAX_OPTIONS } from \"../constants.js\";\n\n/** Accord program id (declare_id! in programs/accord/src/lib.rs). */\nexport const ACCORD_PROGRAM_ID =\n \"RokLJyruq34Ubtaj8mFnQETKcZpNCbW6k6xsgrMoHEe\" as Address;\n\n/** u64 ceiling — guards fee math against overflow (lib.rs uses checked_mul). */\nconst U64_MAX = 0xffffffffffffffffn;\n\n/** Dispute PDA seed prefix, `b\"dispute\"` (state.rs: SEED_DISPUTE). */\nconst SEED_DISPUTE = new Uint8Array([100, 105, 115, 112, 117, 116, 101]);\n\n/**\n * A 32-byte option label hash (one row of `Dispute.options`). The Arbitrable\n * chooses these off-chain; the Accord only stores + tallies them.\n */\nexport type OptionHash = Uint8Array;\n\n/**\n * Args for `create_dispute` (lib.rs:254). All amounts in the Subaccord's\n * staking token.\n */\nexport interface CreateDisputeArgs {\n /**\n * Option label hashes, each 32 bytes. `Plurality`: 2..={@link MAX_OPTIONS}\n * (see {@link assertValidOptions}). `Median` (ADR-0025): file with none —\n * the vote is a u64 fixed-point scalar, not an index.\n */\n options: OptionHash[];\n /** ADR-0006 on-chain evidence commitment (`[u8; 32]`). */\n evidenceHash: Uint8Array;\n /** Filer-chosen nonce → private dispute namespace. Dispute PDA = `[\"dispute\", filer, nonce]`. */\n nonce: bigint;\n /** Total fee = `min_jury_size * fee_per_juror` (see {@link requiredFee}). Filer pays in full. */\n fee: bigint;\n /**\n * Aggregation rule of the Subaccord being filed against — gates\n * {@link CreateDisputeArgs.options} exactly like the on-chain handler\n * (instructions/create_dispute.rs). Omit for `Plurality` (v1 default).\n */\n aggregation?: Aggregation;\n}\n\n/** Signer + token accounts the filer brings to `create_dispute`. */\nexport interface CreateDisputeAccounts {\n /** The Arbitrable (a program signer via CPI) or any wallet. Fee source + signer. */\n filer: Address;\n /**\n * Data-free rent payer for the dispute `init` + fee_vault `init_if_needed`\n * (the system program rejects lamport transfers from data-carrying accounts,\n * so a PDA filer must not pay rent). Wallet filers pass themselves.\n */\n rentPayer: Address;\n /** The Subaccord this dispute is filed against (fee/panel source). */\n subaccord: Address;\n /** The Subaccord's staking_token mint (fee currency). */\n feeToken: Address;\n /** Filer's ATA of the fee token (fee source). */\n filerTokenAccount: Address;\n /** Subaccord PDA's fee_vault ATA (fee sink, ADR-0020). */\n feeVault: Address;\n /** Circuit-breaker singleton PDA (`[\"state\"]`); stake/create revert while paused. */\n accordState: Address;\n}\n\n/** Result of preparing a `create_dispute`: the derived Dispute PDA + its instruction. */\nexport interface CreateDisputeResult {\n /** The initialized Dispute PDA (`[\"dispute\", filer, nonce]`). */\n dispute: Address;\n /** Canonical bump stored on the account (state.rs: Dispute.bump). */\n bump: number;\n /** Unsigned instruction; the facade's wallet adapter signs + sends it. */\n instruction: Instruction;\n}\n\n/** Minimal decoded view `getRuling` consumes (avoids duplicating the full Dispute shape). */\nexport interface DisputeRulingView {\n /**\n * Winning value once `state == Final`: the option index for `Plurality`\n * disputes, the final median (settlement-mint base units) for `Median`\n * disputes (ADR-0025). `u64::MAX` ({@link NO_RULING}) → `null`.\n */\n finalRuling: bigint | null;\n}\n\n/**\n * Dispute `final_ruling` no-ruling sentinel — `u64::MAX`. ADR-0025 widened\n * the ruling from `Option<u8>` to a plain u64 (so `Median` disputes can carry\n * a scalar verdict); the old `u8::MAX` (255) sentinel is gone. Stored until\n * `finalize_dispute` writes the real value atomically with `state = Final`\n * (state.rs: `Dispute::ruling`). Same value as voting's `NO_VOTE`.\n */\nexport const NO_RULING = 0xffff_ffff_ffff_ffffn;\n\n/**\n * Seam to the Codama-generated Kit client + typed fetcher (ADR-0010). The\n * Foundation task provides a concrete adapter; dispute.ts stays pure\n * orchestration over this interface, so it is parallel-safe under fleet\n * dispatch and compile-verifiable before the generator lands.\n */\nexport interface AccordDisputeClient {\n /** Build the `create_dispute` instruction (Anchor discriminator + Borsh args). */\n buildCreateDispute(input: {\n programId: Address;\n accounts: CreateDisputeAccounts;\n args: CreateDisputeArgs;\n disputePda: Address;\n }): Instruction;\n /** Fetch + decode a Dispute account, or `null` if it does not exist yet. */\n fetchDispute(address: Address): Promise<DisputeRulingView | null>;\n}\n\n/**\n * Compute the required `create_dispute` round-1 fee. The panel is the\n * Subaccord's `min_jury_size` (accord-9q3e; default 3), so the fee is\n * `min_jury_size · fee_per_juror`. Mirrors lib.rs\n * (`(sub.min_jury_size as u64).checked_mul(sub.fee_per_juror)`). Returns `null`\n * on u64 overflow rather than throwing — callers surface a typed error.\n */\nexport function requiredFee(\n feePerJuror: bigint,\n minJurySize: number = 3,\n): bigint | null {\n if (feePerJuror < 0n || !Number.isInteger(minJurySize) || minJurySize < 1) {\n return null;\n }\n const product = BigInt(minJurySize) * feePerJuror;\n if (product < 0n || product > U64_MAX) return null;\n return product;\n}\n/**\n * Validate `create_dispute` options against the Subaccord's aggregation rule\n * (instructions/create_dispute.rs, ADR-0025). `Plurality` (default):\n * `2..=MAX_OPTIONS` hashes, each `[u8; 32]`. `Median`: none — the vote is a\n * u64 scalar, not an option index. Throws a typed `Error` on violation.\n * Pure — no chain access.\n */\nexport function assertValidOptions(\n options: OptionHash[],\n aggregation: Aggregation = Aggregation.Plurality,\n): void {\n if (aggregation === Aggregation.Median) {\n if (options.length !== 0) {\n throw new Error(\n `InvalidOptions: Median (scalar) disputes file without option hashes, got ${options.length}`,\n );\n }\n return;\n }\n if (options.length < 2 || options.length > MAX_OPTIONS) {\n throw new Error(\n `InvalidOptions: expected 2..=${MAX_OPTIONS} options, got ${options.length}`,\n );\n }\n for (let i = 0; i < options.length; i++) {\n const opt = options[i];\n if (opt === undefined || opt.length !== 32) {\n throw new Error(\n `InvalidOptions: option ${i} must be 32 bytes, got ${opt?.length ?? 0}`,\n );\n }\n }\n}\n\n/** Validate the evidence commitment is `[u8; 32]` (lib.rs:257 instruction arg). */\nexport function assertValidEvidenceHash(evidenceHash: Uint8Array): void {\n if (evidenceHash.length !== 32) {\n throw new Error(\n `InvalidEvidenceHash: expected 32 bytes, got ${evidenceHash.length}`,\n );\n }\n}\n\n/** Validate a `nonce` fits in a u64 (lib.rs:258 instruction arg). */\nexport function assertValidNonce(nonce: bigint): void {\n if (nonce < 0n || nonce > U64_MAX) {\n throw new Error(`InvalidNonce: expected u64, got ${nonce}`);\n }\n}\n\n/**\n * Build the Dispute PDA seed bytes (state.rs:1872):\n * `[\"dispute\", filer.key().as_ref(), &nonce.to_le_bytes()]`.\n *\n * `filerBytes` is the filer's 32-byte pubkey encoding (Kit's\n * `getAddressEncoder().encode(filer)`). Pure + deterministic — the unit-test\n * entry point; {@link findDisputePda} wraps it with Kit's resolver.\n */\nexport function disputeSeeds(\n filerBytes: Uint8Array,\n nonce: bigint,\n): Uint8Array[] {\n const nonceLe = new Uint8Array(8);\n new DataView(nonceLe.buffer).setBigUint64(0, nonce, true);\n return [SEED_DISPUTE, filerBytes, nonceLe];\n}\n\n/**\n * Derive the canonical Dispute PDA (`[\"dispute\", filer, nonce.to_le()]`).\n */\nexport async function findDisputePda(\n programAddress: Address,\n filer: Address,\n nonce: bigint,\n): Promise<{ address: Address; bump: number }> {\n // kit's encoder returns ReadonlyUint8Array (TS 5.7+ typed-array generics);\n // copy into a mutable Uint8Array for the seeds vector.\n const filerBytes = new Uint8Array(getAddressEncoder().encode(filer));\n const [address, bump] = await getProgramDerivedAddress({\n programAddress,\n seeds: disputeSeeds(filerBytes, nonce),\n });\n return { address, bump };\n}\n\n/**\n * Prepare a `create_dispute`: validate args, derive the Dispute PDA, and build\n * the instruction via the client seam. The caller (Accord facade) signs + sends\n * `result.instruction` with its wallet adapter.\n *\n * On success the Dispute PDA is `init`-ialized (instructions/create_dispute.rs)\n * and reads `state == Created`, `final_ruling == u64::MAX` ({@link NO_RULING}).\n */\nexport async function createDispute(\n client: AccordDisputeClient,\n accounts: CreateDisputeAccounts,\n args: CreateDisputeArgs,\n programId: Address = ACCORD_PROGRAM_ID,\n): Promise<CreateDisputeResult> {\n assertValidOptions(args.options, args.aggregation);\n assertValidEvidenceHash(args.evidenceHash);\n assertValidNonce(args.nonce);\n const { address, bump } = await findDisputePda(\n programId,\n accounts.filer,\n args.nonce,\n );\n const instruction = client.buildCreateDispute({\n programId,\n accounts,\n args,\n disputePda: address,\n });\n return { dispute: address, bump, instruction };\n}\n\n/**\n * Lazily read a dispute's final ruling. Returns the winning value once the\n * dispute reaches `Final` — the option index for `Plurality` disputes, the\n * final median in settlement-mint base units for `Median` disputes\n * (ADR-0025) — or `null` beforehand; on-chain `final_ruling` holds the\n * `u64::MAX` sentinel ({@link NO_RULING}) until then, and both the adapter\n * and {@link getRuling} fold it to `null` (matches the on-chain `get_ruling`\n * CPI entry, lib.rs:480 → `Dispute::ruling()`). Returns `null` if the\n * Dispute account does not exist yet.\n */\nexport async function getRuling(\n client: AccordDisputeClient,\n dispute: Address,\n): Promise<bigint | null> {\n const view = await client.fetchDispute(dispute);\n // Defense in depth: the adapter already folds the sentinel, but fold here\n // too so no seam implementor can leak it — same posture as on-chain\n // `Dispute::ruling()` (state.rs) checking the sentinel even though the\n // Final⟺ruling-written invariant makes it unreachable.\n const fr = view?.finalRuling ?? NO_RULING;\n return fr === NO_RULING ? null : fr;\n}\n","import type { Address } from \"@solana/kit\";\n\n/**\n * v1 protocol constants and defaults.\n *\n * Sourced from `programs/accord/src/constants.rs` and AGENTS.md \"v1 Defaults\".\n * Per-Subaccord params are configurable at creation; these are the milestone\n * defaults.\n */\n\n// --- Account-size bounds (constants.rs) ---\n\nexport const MAX_JURORS = 31;\nexport const MAX_APPEALS = 3;\nexport const MAX_OPTIONS = 8;\n\n// --- Timelocks (constants.rs, in slots @ ~400ms mainnet) ---\n\nexport const UPDATE_TIMELOCK_SLOTS = 432_000n; // 48h\nexport const UNPAUSE_TIMELOCK_SLOTS = 216_000n; // 24h\n\n// --- Windows (constants.rs, in seconds) ---\n\n/** Default appeal window (ADR-0022). Per-Subaccord now; this is the\n * `createSubaccord` default + the \"v1 default\" the docs cite — the runtime\n * value is `dispute.terms.appealWindow` (frozen at filing). 3 days. */\nexport const DEFAULT_APPEAL_WINDOW_SECS = 259_200n;\n/** Floor on the per-Subaccord appeal window (ADR-0022). 1 hour. */\nexport const MIN_APPEAL_WINDOW_SECS = 3_600n;\n\n// --- Accumulator (ADR-0012) ---\n\n/**\n * Maximum tree depth that fits a `stake`/`requestWithdraw`/`reconcileStake`\n * instruction within the 1232-byte serialized transaction limit when signed\n * via a browser wallet. The MST proof is `depth × 40` bytes of instruction\n * data; the `stake` ix has ~490 bytes of fixed overhead (7 accounts + headers\n * + discriminator + amount). `490 + depth×40 ≤ 1232` ⇒ depth ≤ 18, but we\n * cap at 16 (102-byte margin) for safety.\n */\nexport const MAX_SAFE_TREE_DEPTH = 16;\n\n/**\n * Default Merkle accumulator tree depth. 2^16 = 65,536 seats; per-Subaccord.\n * Capped at {@link MAX_SAFE_TREE_DEPTH} so browser-wallet signing works.\n */\nexport const DEFAULT_TREE_DEPTH = 16;\n\n// --- v1 default economics (per-Subaccord; AGENTS.md \"v1 Defaults\") ---\n\n/**\n * Round-1 juror panel size (ADR-0019). Fixed protocol constant — not\n * per-Subaccord configurable. The appeal ladder grows it via `2N+1`:\n * 3 → 7 → 15 → 31 (the last exactly fills `MAX_JURORS` at `max_appeals = 3`).\n */\nexport const INITIAL_NUM_JURORS = 3;\nexport const DEFAULT_ALPHA_BPS = 1_000; // 10%\nexport const DEFAULT_REVIEW_WINDOW_SECS = 604_800n; // 7 days\nexport const DEFAULT_COMMIT_WINDOW_SECS = 172_800n; // 2 days\nexport const DEFAULT_REVEAL_WINDOW_SECS = 172_800n; // 2 days\nexport const DEFAULT_MAX_APPEALS = 3;\n/**\n * Default reveal-quorum fraction in bps (ADR-0021): 6_666 = 2/3. A round is\n * authoritative only once `reveal_count >= ceil(panel × bps / 10_000)`.\n */\nexport const DEFAULT_REVEAL_THRESHOLD_BPS = 6_666;\n/** Program ceiling on per-round redraw attempts (bounds the redraw ladder). */\nexport const MAX_DRAW_ATTEMPTS = 10;\n/** Default same-size redraw cap per round before a dispute fails (ADR-0021). */\nexport const DEFAULT_MAX_DRAW_ATTEMPTS = 3;\n/**\n * Default `Median` coherence tolerance in bps (ADR-0025): a revealed vote is\n * coherent iff `|vote − ruling| · 10_000 ≤ ruling · coherence_tol_bps`. 100 =\n * a 1% band around the final median. Inert for `Plurality` (exact option\n * equality) — Plurality-only pools pass `0`.\n */\nexport const DEFAULT_COHERENCE_TOL_BPS = 100;\nexport const DEFAULT_MIN_STAKE = 1_000n;\nexport const DEFAULT_FEE_PER_JUROR = 0n; // set per-Subaccord\n\n// --- Panel ladder: round-1 = min_jury_size (per-Subaccord, accord-9q3e; default\n// INITIAL_NUM_JURORS); N_{k+1} = 2·N_k + 1, closed form (J+1)·2^k − 1,\n// capped at MAX_JURORS ---\n\n/**\n * Panel size for round `roundIdx`, seeded by `baseJurySize` (the Subaccord's\n * `min_jury_size`). Defaults to {@link INITIAL_NUM_JURORS} (=3) for backward\n * compatibility — pass the Subaccord's value explicitly for non-default pools.\n */\nexport function panelSizeForRound(\n roundIdx: number,\n baseJurySize: number = INITIAL_NUM_JURORS,\n): number | null {\n if (\n !Number.isInteger(roundIdx) ||\n roundIdx < 0 ||\n roundIdx >= 31 ||\n !Number.isInteger(baseJurySize) ||\n baseJurySize < 1\n ) {\n return null;\n }\n const factor = 1 << roundIdx;\n const panel = (baseJurySize + 1) * factor - 1;\n if (!Number.isSafeInteger(panel) || panel < 0) return null;\n return Math.min(panel, MAX_JURORS);\n}\n\n/**\n * Largest panel a Subaccord with `maxAppeals` appeals can reach, seeded by\n * `baseJurySize` (the Subaccord's `min_jury_size`). Defaults to\n * {@link INITIAL_NUM_JURORS} (=3).\n */\nexport function maxAppealPanelSize(\n maxAppeals: number,\n baseJurySize: number = INITIAL_NUM_JURORS,\n): number {\n const factor = 1 << maxAppeals;\n return Math.min((baseJurySize + 1) * factor - 1, MAX_JURORS);\n}\n\n// --- MagicBlock VRF oracle queues (ephemeral_rollups_sdk::vrf::consts) ---\n//\n// Every randomness request names an oracle queue. A delegated queue is writable\n// only from inside an ephemeral rollup; a non-delegated (base-layer) queue is\n// writable on L1. The cranker and Arbitrables run on L1, so they reference the\n// base-layer queue. Mainnet and devnet share the same addresses.\n//\n// @see https://docs.magicblock.dev\n\n/** Mainnet/devnet base-layer VRF oracle queue (`DEFAULT_QUEUE`). */\nexport const VRF_ORACLE_QUEUE =\n \"Cuj97ggrhhidhbu39TijNVqE74xvKJ69gDervRUXAxGh\" as Address;\n/** Mainnet/devnet delegated (ephemeral rollup) VRF oracle queue (`DEFAULT_EPHEMERAL_QUEUE`). */\nexport const VRF_ORACLE_EPHEMERAL_QUEUE =\n \"5hBR571xnXppuCPveTrctfTU7tJLSN94nq7kv7FRK5Tc\" as Address;\n/** Localnet base-layer test VRF oracle queue (`DEFAULT_TEST_QUEUE`). */\nexport const VRF_ORACLE_TEST_QUEUE =\n \"GKE6d7iv8kCBrsxr78W3xVdjGLLLJnxsGiuzrsZCGEvb\" as Address;\n/** Localnet delegated (ephemeral rollup) test VRF oracle queue (`DEFAULT_EPHEMERAL_TEST_QUEUE`). */\nexport const VRF_ORACLE_EPHEMERAL_TEST_QUEUE =\n \"Sc9MJUngNbQXSXGP3F67KvKwVnhaYn6kcioxXNVowYT\" as Address;\n","/**\n * lifecycle.ts — Subaccord lifecycle + circuit breaker (ADR-0005, ADR-0007).\n *\n * Seven instructions:\n * - {@link createSubaccord} permissionless pool creation.\n * - {@link proposeSubaccordUpdate} authority-gated; arms a 48h timelock.\n * - {@link executeSubaccordUpdate} permissionless crank; lands post-timelock.\n * - {@link initializePause} / {@link pause} / {@link proposeUnpause} /\n * {@link executeUnpause} the ADR-0007 circuit-breaker quartet.\n *\n * Client-side timelock awareness (ADR-0010 §4): `propose_subaccord_update`\n * writes `execute_after_slot = slot + UPDATE_TIMELOCK_SLOTS` on-chain. The SDK\n * cannot predict the exact landing slot, so the flow is: propose → read\n * `execute_after_slot` back from the PendingUpdate account → wait until\n * `canExecuteAt(executeAfterSlot, currentSlot)` → execute. The same shape backs\n * the unpause timelock (`UNPAUSE_TIMELOCK_SLOTS`).\n *\n * Same ADR-0010 facade pattern as the other method modules: pure orchestration\n * over a typed {@link AccordLifecycleClient} seam; Kit type-only; PDAs lazy.\n *\n * Sources of truth:\n * - instructions: programs/accord/src/lib.rs (146-397, 77-144)\n * - accounts/PDAs: programs/accord/src/lib.rs (1693-1845, 1640-1690)\n * - constants: programs/accord/src/constants.rs\n * - UpdatePayload: programs/accord/src/state.rs (254-266)\n */\nimport {\n getAddressEncoder,\n getProgramDerivedAddress,\n type Address,\n type Instruction,\n} from \"@solana/kit\";\nimport {\n MAX_APPEALS,\n MAX_DRAW_ATTEMPTS,\n MAX_JURORS,\n MIN_APPEAL_WINDOW_SECS,\n UPDATE_TIMELOCK_SLOTS,\n UNPAUSE_TIMELOCK_SLOTS,\n} from \"../constants.js\";\nimport type { Aggregation, ShortfallPolicy, UpdatePayload } from \"../types.js\";\n\nexport {\n MAX_APPEALS,\n MAX_DRAW_ATTEMPTS,\n MAX_JURORS,\n MIN_APPEAL_WINDOW_SECS,\n UPDATE_TIMELOCK_SLOTS,\n UNPAUSE_TIMELOCK_SLOTS,\n} from \"../constants.js\";\nexport { type ShortfallPolicy, type UpdatePayload } from \"../types.js\";\n\n// ---------------------------------------------------------------------------\n// PDA seed prefixes + local constants\n// ---------------------------------------------------------------------------\n\n/** Subaccord PDA seed prefix (state.rs: SEED_SUBACCORD = b\"subaccord\"). */\nconst SEED_SUBACCORD = new Uint8Array([\n 115, 117, 98, 97, 99, 99, 111, 114, 100,\n]);\n\n/** PendingUpdate PDA seed prefix (state.rs: SEED_PENDING_UPDATE = b\"update\"). */\nconst SEED_PENDING_UPDATE = new Uint8Array([117, 112, 100, 97, 116, 101]); // \"update\"\n\n/** AccordState PDA seed prefix (state.rs: SEED_ACCORD_STATE = b\"state\"). */\nconst SEED_ACCORD_STATE = new Uint8Array([115, 116, 97, 116, 101]); // \"state\"\n\nconst U64_MAX = 0xffffffffffffffffn;\n\n// ---------------------------------------------------------------------------\n// Domain types\n// ---------------------------------------------------------------------------\n\n/** Args for `create_subaccord` (lib.rs:146). `domain_ref`/`evidence_spec` immutable. */\nexport interface CreateSubaccordArgs {\n /** Immutable identity hash: the class of dispute this pool adjudicates. ≠ [0;32]. */\n domainRef: Uint8Array; // 32 bytes\n /** Immutable evidence-format spec hash (ADR-0006). */\n evidenceSpec: Uint8Array; // 32 bytes\n /** SPL mint juror capital is staked in (collateral, ADR-0002/0020). */\n stakingToken: Address;\n /** Compensation mint — fees + appeal bonds (ADR-0020). Distinct from stakingToken. */\n feeToken: Address;\n minStake: bigint;\n /** Slash factor in bps (10% = 1000). */\n alphaBps: number; // u16\n reviewWindow: bigint; // seconds\n commitWindow: bigint; // seconds\n revealWindow: bigint; // seconds\n /** Appeal window after a round resolves before finality (ADR-0022). Per-\n * Subaccord, frozen onto `CaseTerms` at filing. ≥ {@link MIN_APPEAL_WINDOW_SECS}. */\n appealWindow: bigint; // seconds\n /** ≤ {@link MAX_APPEALS}; bounds the appeal ladder depth. The round-1 panel\n * size is per-Subaccord via {@link CreateSubaccordArgs.minJurySize}\n * (accord-9q3e); each appeal doubles+1. */\n maxAppeals: number; // u8\n /** Round-1 juror panel size (accord-9q3e). Default 3 ({@link INITIAL_NUM_JURORS});\n * must be odd and the appeal ladder `(J+1)·2^maxAppeals − 1` must fit\n * {@link MAX_JURORS}. Set 1 + `maxAppeals = 0` for a single-juror pool.\n * Immutable on the Subaccord (not in {@link UpdatePayload}). */\n minJurySize: number; // u32, odd ≥ 1\n /** Per-Subaccord aggregation rule (ADR-0019). v1 = `Plurality`. */\n aggregation: Aggregation;\n feePerJuror: bigint;\n /**\n * Reveal-quorum fraction in bps (ADR-0021). A round is authoritative only if\n * `reveal_count >= ceil(panel × bps / 10_000)`. Default 6_666 (2/3); the\n * absolute commitment escalates per appeal for free via panel growth.\n */\n revealThresholdBps: number; // u16, 0..=10_000\n /** Shortfall policy (ADR-0021). v1 = `Redraw` (same-size redraw via `draw_attempt`). */\n shortfallPolicy: ShortfallPolicy;\n /**\n * Same-size redraw cap per round before the dispute fails (ADR-0021).\n * Orthogonal to {@link CreateSubaccordArgs.maxAppeals} (which bounds rounds).\n */\n maxDrawAttempts: number; // u8, 1..=MAX_DRAW_ATTEMPTS\n /**\n * Coherence tolerance for `Median` pools, in bps of the final median\n * (ADR-0025): a revealed vote is coherent iff\n * `|vote − ruling| · 10_000 ≤ ruling · coherence_tol_bps`. `0` = exact\n * match. Inert for `Plurality`. Immutable on the Subaccord (not in\n * `UpdatePayload`); frozen onto `CaseTerms` at filing. Docs default 100\n * (1% band) for `Median` pools; use `0` for `Plurality`-only pools.\n */\n coherenceTolBps: number; // u16, 0..=10_000\n /** `Pubkey::default()` => immutable Subaccord; else signs propose/execute. */\n authority: Address;\n /** ADR-0006 trusted re-encryption service. */\n evidenceOperator: Address;\n /**\n * Fixed accumulator tree depth (ADR-0012). Bounds the juror pool at\n * `2^depth`; the tree never grows a level during operation. Default 20.\n */\n depth: number; // u8\n /**\n * PROG-ATTESTTION: optional credential gate. Omit (or set both to the default\n * pubkey) ⇒ stake-only Subaccord (today's behaviour). Set both ⇒ jurors must\n * hold a valid SAS attestation to stake/draw. Both-or-neither.\n */\n jurorCredential?: Address;\n jurorSchema?: Address;\n}\n\n/**\n * Tagged Subaccord parameter update (state.rs:254-266). `domain_ref` and\n * `evidence_spec` are immutable and absent. Re-exported from\n * {@link ../types.js} (Codama-generated canonical shape).\n */\n\n// ---------------------------------------------------------------------------\n// Pure helpers (testable, no chain)\n// ---------------------------------------------------------------------------\n\n/** u64 → 8-byte little-endian. */\nfunction le8(v: bigint): Uint8Array {\n const b = new Uint8Array(8);\n new DataView(b.buffer).setBigUint64(0, v, true);\n return b;\n}\n\n/** Subaccord PDA seeds (state.rs:1697): `[\"subaccord\", creator, domain_ref]`. */\nexport function subaccordSeeds(\n creatorBytes: Uint8Array,\n domainRef: Uint8Array,\n): Uint8Array[] {\n assertValidRiskType(domainRef);\n if (creatorBytes.length !== 32)\n throw new Error(\"InvalidCreator: expected 32 bytes\");\n return [SEED_SUBACCORD, creatorBytes, domainRef];\n}\n\n/** PendingUpdate PDA seeds (state.rs:1816): `[\"update\", subaccord, nonce_le]`. */\nexport function pendingUpdateSeeds(\n subaccordBytes: Uint8Array,\n nonce: bigint,\n): Uint8Array[] {\n if (subaccordBytes.length !== 32)\n throw new Error(\"InvalidSubaccord: expected 32 bytes\");\n if (nonce < 0n || nonce > U64_MAX)\n throw new Error(`InvalidNonce: expected u64, got ${nonce}`);\n return [SEED_PENDING_UPDATE, subaccordBytes, le8(nonce)];\n}\n\n/** AccordState PDA seeds (state.rs: `[\"state\"]`). Singleton. */\nexport function accordStateSeeds(): Uint8Array[] {\n return [SEED_ACCORD_STATE];\n}\n\n/** Validate `max_appeals ≤ MAX_APPEALS` (lib.rs). With a configurable round-1\n * panel size (accord-9q3e), `maxAppeals` bounds the appeal ladder depth; the\n * ladder must also fit `MAX_JURORS` — see {@link assertValidMinJurySize}. */\nexport function assertValidMaxAppeals(maxAppeals: number): void {\n if (\n !Number.isInteger(maxAppeals) ||\n maxAppeals < 0 ||\n maxAppeals > MAX_APPEALS\n ) {\n throw new Error(\n `MaxAppealsLimitExceeded: expected 0..${MAX_APPEALS}, got ${maxAppeals}`,\n );\n }\n}\n\n/** Validate `min_jury_size` is odd and the appeal ladder fits `MAX_JURORS`\n * (lib.rs create_subaccord, accord-9q3e). The ladder top\n * `(J+1)·2^maxAppeals − 1` must not exceed {@link MAX_JURORS} or panel growth\n * would be silently truncated by the on-chain `.min()` cap. Throws on violation. */\nexport function assertValidMinJurySize(\n minJurySize: number,\n maxAppeals: number,\n): void {\n if (!Number.isInteger(minJurySize) || minJurySize < 1) {\n throw new Error(\n `InvalidMinJurySize: expected odd integer ≥ 1, got ${minJurySize}`,\n );\n }\n if (minJurySize % 2 !== 1) {\n throw new Error(\n `InvalidMinJurySize: must be odd (tie avoidance under plurality), got ${minJurySize}`,\n );\n }\n const ladderTop = (minJurySize + 1) * (1 << maxAppeals) - 1;\n if (ladderTop > MAX_JURORS) {\n throw new Error(\n `InvalidMinJurySize: appeal ladder top (${ladderTop}) exceeds MAX_JURORS (${MAX_JURORS})` +\n ` for min_jury_size=${minJurySize}, max_appeals=${maxAppeals}`,\n );\n }\n}\n\n/** Validate `appeal_window ≥ MIN_APPEAL_WINDOW_SECS` (lib.rs, ADR-0022). A pool\n * that wants no appeals sets `max_appeals == 0`; a 0 window is rejected. */\nexport function assertValidAppealWindow(appealWindow: bigint): void {\n if (appealWindow < MIN_APPEAL_WINDOW_SECS) {\n throw new Error(\n `AppealWindowTooShort: expected >= ${MIN_APPEAL_WINDOW_SECS}, got ${appealWindow}`,\n );\n }\n}\n\n/** Validate `reveal_threshold_bps ≤ 10_000` (lib.rs, ADR-0021). */\nexport function assertValidRevealThreshold(revealThresholdBps: number): void {\n if (\n !Number.isInteger(revealThresholdBps) ||\n revealThresholdBps < 0 ||\n revealThresholdBps > 10_000\n ) {\n throw new Error(\n `InvalidThreshold: expected 0..10000 bps, got ${revealThresholdBps}`,\n );\n }\n}\n\n/** Validate `1 ≤ max_draw_attempts ≤ MAX_DRAW_ATTEMPTS` (lib.rs, ADR-0021). */\nexport function assertValidMaxDrawAttempts(maxDrawAttempts: number): void {\n if (\n !Number.isInteger(maxDrawAttempts) ||\n maxDrawAttempts < 1 ||\n maxDrawAttempts > MAX_DRAW_ATTEMPTS\n ) {\n throw new Error(\n `MaxDrawAttemptsLimitExceeded: expected 1..${MAX_DRAW_ATTEMPTS}, got ${maxDrawAttempts}`,\n );\n }\n}\n\n/** Validate `coherence_tol_bps ≤ 10_000` (lib.rs create_subaccord, ADR-0025).\n * Mirrors the on-chain `InvalidThreshold` gate — same bound as\n * {@link assertValidRevealThreshold}. */\nexport function assertValidCoherenceTol(coherenceTolBps: number): void {\n if (\n !Number.isInteger(coherenceTolBps) ||\n coherenceTolBps < 0 ||\n coherenceTolBps > 10_000\n ) {\n throw new Error(\n `InvalidThreshold: expected 0..10000 bps, got ${coherenceTolBps}`,\n );\n }\n}\n\n/** Reject the degenerate zero domain_ref (lib.rs:164 namespace squat guard). */\nexport function assertValidRiskType(domainRef: Uint8Array): void {\n if (domainRef.length !== 32) {\n throw new Error(\n `InvalidRiskType: expected 32 bytes, got ${domainRef.length}`,\n );\n }\n let allZero = 1;\n for (let i = 0; i < 32; i++) allZero &= domainRef[i] === 0 ? 1 : 0;\n if (allZero) throw new Error(\"InvalidRiskType: zero hash is reserved\");\n}\n\n/** Timelock gate: may a pending update/unpause land at `currentSlot`? */\nexport function canExecuteAt(\n executeAfterSlot: bigint,\n currentSlot: bigint,\n): boolean {\n return currentSlot >= executeAfterSlot;\n}\n\n// ---------------------------------------------------------------------------\n// PDA derivations (Kit lazy-imported)\n// ---------------------------------------------------------------------------\n\nexport async function findSubaccordPda(\n programAddress: Address,\n creator: Address,\n domainRef: Uint8Array,\n): Promise<{ address: Address; bump: number }> {\n const creatorBytes = new Uint8Array(getAddressEncoder().encode(creator));\n const [address, bump] = await getProgramDerivedAddress({\n programAddress,\n seeds: subaccordSeeds(creatorBytes, domainRef),\n });\n return { address, bump };\n}\n\nexport async function findPendingUpdatePda(\n programAddress: Address,\n subaccord: Address,\n nonce: bigint,\n): Promise<{ address: Address; bump: number }> {\n const subBytes = new Uint8Array(getAddressEncoder().encode(subaccord));\n const [address, bump] = await getProgramDerivedAddress({\n programAddress,\n seeds: pendingUpdateSeeds(subBytes, nonce),\n });\n return { address, bump };\n}\n\nexport async function findAccordStatePdaWithBump(\n programAddress: Address,\n): Promise<{ address: Address; bump: number }> {\n const [address, bump] = await getProgramDerivedAddress({\n programAddress,\n seeds: accordStateSeeds(),\n });\n return { address, bump };\n}\n\n// ---------------------------------------------------------------------------\n// Seam (ADR-0010) + orchestration\n// ---------------------------------------------------------------------------\n\n/**\n * Seam to the Codama-generated Kit client + fetcher. Foundation wires the\n * concrete adapter; lifecycle.ts stays orchestration-only.\n */\nexport interface AccordLifecycleClient {\n buildCreateSubaccord(input: {\n programId: Address;\n creator: Address;\n subaccordPda: Address;\n args: CreateSubaccordArgs;\n }): Instruction;\n buildProposeSubaccordUpdate(input: {\n programId: Address;\n authority: Address;\n subaccord: Address;\n pendingUpdatePda: Address;\n nonce: bigint;\n payload: UpdatePayload;\n }): Instruction;\n buildExecuteSubaccordUpdate(input: {\n programId: Address;\n caller: Address;\n subaccord: Address;\n pendingUpdate: Address;\n }): Instruction;\n buildInitializePause(input: {\n programId: Address;\n authority: Address;\n accordStatePda: Address;\n }): Instruction;\n buildPause(input: {\n programId: Address;\n authority: Address;\n accordState: Address;\n }): Instruction;\n buildProposeUnpause(input: {\n programId: Address;\n authority: Address;\n accordState: Address;\n }): Instruction;\n buildExecuteUnpause(input: {\n programId: Address;\n caller: Address;\n accordState: Address;\n }): Instruction;\n /** Read `execute_after_slot` back from a PendingUpdate account (timelock flow). */\n fetchPendingUpdateExecuteAfter(\n pendingUpdate: Address,\n ): Promise<bigint | null>;\n}\n\n/** Build `create_subaccord` (lib.rs:146). Permissionless; creator owns the namespace. */\nexport async function createSubaccord(\n client: AccordLifecycleClient,\n programId: Address,\n creator: Address,\n args: CreateSubaccordArgs,\n): Promise<{ instruction: Instruction; subaccord: Address; bump: number }> {\n assertValidRiskType(args.domainRef);\n if (args.evidenceSpec.length !== 32)\n throw new Error(\"InvalidEvidenceSpec: expected 32 bytes\");\n assertValidMaxAppeals(args.maxAppeals);\n assertValidAppealWindow(args.appealWindow);\n assertValidRevealThreshold(args.revealThresholdBps);\n assertValidMaxDrawAttempts(args.maxDrawAttempts);\n assertValidCoherenceTol(args.coherenceTolBps);\n assertValidMinJurySize(args.minJurySize, args.maxAppeals);\n const { address, bump } = await findSubaccordPda(\n programId,\n creator,\n args.domainRef,\n );\n const instruction = client.buildCreateSubaccord({\n programId,\n creator,\n subaccordPda: address,\n args,\n });\n return { instruction, subaccord: address, bump };\n}\n\n/**\n * Build `propose_subaccord_update` (lib.rs:331). Authority-gated; arms a 48h\n * timelock. The adapter pins the data-free rent payer to its wallet signer\n * (ADR-0028) — wallet authorities pay their own PendingUpdate rent; a PDA\n * authority CPIs from its program with a crank caller as rent payer.\n * The exact `execute_after_slot` is set on-chain from the landing\n * slot — read it back via `fetchPendingUpdateExecuteAfter` and gate execution\n * with `canExecuteAt`. Returns the derived PendingUpdate PDA.\n */\nexport async function proposeSubaccordUpdate(\n client: AccordLifecycleClient,\n programId: Address,\n authority: Address,\n subaccord: Address,\n nonce: bigint,\n payload: UpdatePayload,\n): Promise<{ instruction: Instruction; pendingUpdate: Address }> {\n if (nonce < 0n || nonce > U64_MAX)\n throw new Error(`InvalidNonce: expected u64, got ${nonce}`);\n const { address } = await findPendingUpdatePda(programId, subaccord, nonce);\n const instruction = client.buildProposeSubaccordUpdate({\n programId,\n authority,\n subaccord,\n pendingUpdatePda: address,\n nonce,\n payload,\n });\n return { instruction, pendingUpdate: address };\n}\n\n/**\n * Resolve the timelock for a pending update: read `execute_after_slot` back\n * from the PendingUpdate account. Pair with {@link canExecuteAt}.\n */\nexport async function getUpdateExecuteAfterSlot(\n client: AccordLifecycleClient,\n pendingUpdate: Address,\n): Promise<bigint | null> {\n return client.fetchPendingUpdateExecuteAfter(pendingUpdate);\n}\n\n/** Build `execute_subaccord_update` (lib.rs:372). Permissionless; lands post-timelock. */\nexport function executeSubaccordUpdate(\n client: AccordLifecycleClient,\n programId: Address,\n caller: Address,\n subaccord: Address,\n pendingUpdate: Address,\n): Instruction {\n return client.buildExecuteSubaccordUpdate({\n programId,\n caller,\n subaccord,\n pendingUpdate,\n });\n}\n\n/** Build `initialize_pause` (lib.rs:77). One-time: sets the pause authority. */\nexport async function initializePause(\n client: AccordLifecycleClient,\n programId: Address,\n authority: Address,\n): Promise<{ instruction: Instruction; accordState: Address }> {\n const { address } = await findAccordStatePdaWithBump(programId);\n const instruction = client.buildInitializePause({\n programId,\n authority,\n accordStatePda: address,\n });\n return { instruction, accordState: address };\n}\n\n/** Build `pause` (lib.rs:86). Instant, authority-gated emergency freeze. */\nexport function pause(\n client: AccordLifecycleClient,\n programId: Address,\n authority: Address,\n accordState: Address,\n): Instruction {\n return client.buildPause({ programId, authority, accordState });\n}\n\n/** Build `propose_unpause` (lib.rs:102). Arms `UNPAUSE_TIMELOCK_SLOTS` notice. */\nexport function proposeUnpause(\n client: AccordLifecycleClient,\n programId: Address,\n authority: Address,\n accordState: Address,\n): Instruction {\n return client.buildProposeUnpause({ programId, authority, accordState });\n}\n\n/** Build `execute_unpause` (lib.rs:120). Permissionless; lands post-timelock. */\nexport function executeUnpause(\n client: AccordLifecycleClient,\n programId: Address,\n caller: Address,\n accordState: Address,\n): Instruction {\n return client.buildExecuteUnpause({ programId, caller, accordState });\n}\n","/**\n * staking.ts — Juror capital stake / unstake + the `active_draws` guard.\n *\n * `unstake` is blocked on-chain while a juror is drawn into any open dispute\n * (`JurorStake.active_draws > 0` → `StakeLocked`, lib.rs:272) — stake is frozen\n * until every drawn dispute settles (ADR-0003). The facade surfaces this as a\n * typed pre-check ({@link canUnstake} / {@link assertCanUnstake}) so a client\n * rejects the unstake BEFORE building or sending the transaction (matches the\n * on-chain error; test-matrix row 4).\n *\n * `stake` SPL-transfers `amount` of the Subaccord's staking token from the\n * juror's ATA into the Subaccord PDA's vault ATA (lazily created on first\n * stake). Reverts while the circuit breaker is paused (ADR-0007).\n *\n * Same ADR-0010 facade pattern: pure orchestration over a typed\n * {@link AccordStakingClient} seam; Kit type-only; PDA lazy.\n *\n * Sources of truth:\n * - stake / unstake handlers: programs/accord/src/lib.rs (206-324)\n * - Stake / Unstake accounts: programs/accord/src/lib.rs (1716-1798)\n * - JurorStake struct + seeds: programs/accord/src/state.rs (60-70)\n */\nimport {\n AccountRole,\n getAddressEncoder,\n getProgramDerivedAddress,\n type Address,\n type Instruction,\n} from \"@solana/kit\";\nimport type { MSTNode } from \"./mst.js\";\n\n/** JurorStake PDA seed prefix (state.rs: SEED_JUROR_STAKE = b\"stake\"). */\nconst SEED_JUROR_STAKE = new Uint8Array([115, 116, 97, 107, 101]); // \"stake\"\n\nconst U64_MAX = 0xffffffffffffffffn;\n\n/** The decoded JurorStake fields the guard + caller need. */\nexport interface JurorStakeView {\n juror: Address;\n /** Collateral (stake_token, ADR-0020). */\n staked: bigint;\n /** Aggregate earned fees (fee_token, ADR-0020). Withdrawable via `withdrawFees`. */\n feesEarned: bigint;\n /** Disputes this juror is currently drawn into; >0 blocks unstake. */\n activeDraws: number;\n}\n\n/**\n * Typed unstake guard result. `ok === false` ⇒ do not build the tx; the\n * `reason` matches the on-chain error class (StakeLocked / InvalidAmount /\n * InsufficientBalance).\n */\nexport interface UnstakeGuard {\n ok: boolean;\n reason?: \"StakeLocked\" | \"InvalidAmount\" | \"InsufficientBalance\";\n}\n\n/**\n * Pre-flight the `unstake` against the juror's live stake. Mirrors the three\n * on-chain requires (lib.rs:270-277): `amount > 0`, `active_draws == 0`,\n * `amount ≤ staked`. Pure — no chain access.\n */\nexport function canUnstake(\n stake: JurorStakeView,\n amount: bigint,\n): UnstakeGuard {\n if (amount <= 0n) return { ok: false, reason: \"InvalidAmount\" };\n if (stake.activeDraws > 0) return { ok: false, reason: \"StakeLocked\" };\n if (amount > stake.staked)\n return { ok: false, reason: \"InsufficientBalance\" };\n return { ok: true };\n}\n\n/** Throw a typed `Error` if the unstake would revert on-chain. */\nexport function assertCanUnstake(stake: JurorStakeView, amount: bigint): void {\n const g = canUnstake(stake, amount);\n if (!g.ok)\n throw new Error(\n `${g.reason}: cannot unstake ${amount} (staked=${stake.staked}, activeDraws=${stake.activeDraws})`,\n );\n}\n\n/** Validate a stake/unstake `amount` is a positive u64 (lib.rs:208 / 270). */\nexport function assertValidAmount(amount: bigint): void {\n if (amount <= 0n)\n throw new Error(`InvalidAmount: expected > 0, got ${amount}`);\n if (amount > U64_MAX)\n throw new Error(`InvalidAmount: exceeds u64, got ${amount}`);\n}\n\n/** u64 → 8-byte little-endian. */\nfunction le8(v: bigint): Uint8Array {\n const b = new Uint8Array(8);\n new DataView(b.buffer).setBigUint64(0, v, true);\n return b;\n}\n\n/** JurorStake PDA seeds (state.rs:1732): `[\"stake\", subaccord, juror]`. */\nexport function jurorStakeSeeds(\n subaccordBytes: Uint8Array,\n jurorBytes: Uint8Array,\n): Uint8Array[] {\n if (subaccordBytes.length !== 32)\n throw new Error(\"InvalidSubaccord: expected 32 bytes\");\n if (jurorBytes.length !== 32)\n throw new Error(\"InvalidJuror: expected 32 bytes\");\n return [SEED_JUROR_STAKE, subaccordBytes, jurorBytes];\n}\n\n/** Derive the canonical JurorStake PDA. */\nexport async function findJurorStakePda(\n programAddress: Address,\n subaccord: Address,\n juror: Address,\n): Promise<{ address: Address; bump: number }> {\n const enc = getAddressEncoder();\n const [address, bump] = await getProgramDerivedAddress({\n programAddress,\n seeds: jurorStakeSeeds(\n new Uint8Array(enc.encode(subaccord)),\n new Uint8Array(enc.encode(juror)),\n ),\n });\n return { address, bump };\n}\n\n/** Accounts shared by `stake` / `unstake` (the juror signs). */\nexport interface StakingAccounts {\n juror: Address;\n subaccord: Address;\n /** `stake` only — the ADR-0007 circuit breaker (unstake is never halted). */\n accordState?: Address;\n jurorStake: Address;\n stakingToken: Address;\n /** Juror's ATA of the staking token (source on stake, dest on unstake). */\n jurorTokenAccount: Address;\n /** Subaccord PDA's stake_vault ATA (dest on stake, source on unstake). */\n stakeVault: Address;\n}\n\n/**\n * Seam to the Codama-generated Kit client + JurorStake fetcher. Foundation\n * wires the concrete adapter; staking.ts stays orchestration-only.\n *\n * ADR-0012: `stake`/`unstake` take a client-supplied accumulator `path`\n * (sibling hash + sum per level). The chain verifies it against the stored\n * root and recomputes a new canonical root — O(log N). A wrong path reverts;\n * build it via `proofFor(tree, jurorIndex)` from `./mst.js`.\n */\nexport interface AccordStakingClient {\n buildStake(input: {\n programId: Address;\n accounts: StakingAccounts;\n amount: bigint;\n path: MSTNode[];\n attestation?: Address;\n }): Instruction;\n buildRequestWithdraw(input: {\n programId: Address;\n accounts: StakingAccounts;\n amount: bigint;\n path: MSTNode[];\n }): Instruction;\n buildWithdraw(input: {\n programId: Address;\n accounts: StakingAccounts;\n }): Instruction;\n buildReconcileStake(input: {\n programId: Address;\n accounts: StakingAccounts;\n path: MSTNode[];\n }): Instruction;\n buildReclaimSlot(input: {\n programId: Address;\n accounts: { subaccord: Address; jurorStake: Address };\n path: MSTNode[];\n }): Instruction;\n /** Fetch the decoded JurorStake fields the guard needs. */\n fetchJurorStake(jurorStake: Address): Promise<JurorStakeView | null>;\n /** Build `withdraw_fees` (ADR-0020). */\n buildWithdrawFees(input: {\n programId: Address;\n accounts: WithdrawFeesAccounts;\n }): Instruction;\n /**\n * Build `prune_juror` (PROG-ATTESTATION) — permissionless crank that evicts\n * an expired juror's stake from a credential-gated Subaccord. The cranker\n * signs; the expired `juror` does not. `attestation` is appended as\n * `remaining_accounts[0]` (read-only).\n */\n buildPruneJuror(input: {\n programId: Address;\n accounts: PruneJurorAccounts;\n path: MSTNode[];\n attestation: Address;\n }): Instruction;\n}\n\n/** Build `stake` (lib.rs). SPL-transfers `amount` into the vault.\n * RECLAIM-LEAF: when `freedSlotAccount` is provided, the stake pops from the\n * free list (the freed JurorStake is appended as a remaining account). */\nexport function stake(\n client: AccordStakingClient,\n programId: Address,\n accounts: StakingAccounts,\n amount: bigint,\n path: MSTNode[],\n /** PROG-ATTESTATION: juror SAS attestation (required on credential-gated Subaccords). */\n attestation?: Address,\n /** RECLAIM-LEAF: freed JurorStake PDA to pop from the free list when staking into a recycled slot. */\n freedSlotAccount?: Address,\n): Instruction {\n assertValidAmount(amount);\n // An empty `path` is the canonical proof for a depth-0 Subaccord (single\n // leaf = root). The on-chain verifier authenticates the path against the\n // stored root + depth; do not reject it here (REVIEW #13).\n const ix = client.buildStake({ programId, accounts, amount, path, attestation });\n // RECLAIM-LEAF: append the freed JurorStake PDA as a remaining account when\n // staking into a recycled slot. The adapter placed the attestation (if any)\n // at remaining_accounts[0]; the freed slot follows at [1] on gated pools, or\n // sits at [0] on stake-only pools — matching the on-chain gated-aware layout.\n if (freedSlotAccount) {\n return {\n ...ix,\n accounts: [\n ...(ix.accounts ?? []),\n { address: freedSlotAccount, role: AccountRole.WRITABLE },\n ],\n };\n }\n return ix;\n}\n\n/**\n * Build `request_withdraw` (lib.rs) — phase 1 of the two-phase withdraw\n * (REVIEW #5). Ledger-only: subtracts `amount` from `JurorStake.amount`, banks\n * it in `pending_withdrawal`, and recomputes the accumulator root. No tokens\n * move; no `active_draws` gate (the lock is enforced at `withdraw`). Allowed\n * while paused. `path` is the juror's accumulator proof (ADR-0012).\n *\n * Precondition: `settlementDelta == 0` — call `reconcileStake` first when the\n * juror has a pending reward/slash. DRY with `reconcileStake` (the delta fold\n * lives in one place); withdraw only ever reads the canonical `amount`.\n */\nexport function requestWithdraw(\n client: AccordStakingClient,\n programId: Address,\n accounts: StakingAccounts,\n amount: bigint,\n path: MSTNode[],\n): Instruction {\n assertValidAmount(amount);\n // Empty `path` is valid for depth-0 Subaccords (REVIEW #13).\n return client.buildRequestWithdraw({ programId, accounts, amount, path });\n}\n\n/**\n * Build `withdraw` (lib.rs:407) — phase 2 of the two-phase withdraw. Moves the\n * banked `pending_withdrawal` from the vault to the juror's ATA. On-chain gates:\n * `WITHDRAWAL_DELAY` elapsed since `request_withdraw` AND `active_draws == 0`.\n * No args — reads `pending_withdrawal` from `JurorStake`.\n */\nexport function withdraw(\n client: AccordStakingClient,\n programId: Address,\n accounts: StakingAccounts,\n): Instruction {\n if (\n !accounts.stakingToken ||\n !accounts.jurorTokenAccount ||\n !accounts.stakeVault\n ) {\n throw new Error(\n \"InvalidWithdrawAccounts: withdraw requires stakingToken, jurorTokenAccount, stakeVault\",\n );\n }\n return client.buildWithdraw({ programId, accounts });\n}\n\n/**\n * Build `reconcile_stake` (lib.rs:460) — permissionless crank (REVIEW #4) that\n * folds a juror's `settlement_delta` into their canonical `amount` and updates\n * the accumulator root via a Merkle proof. After reconcile, the ledger and the\n * accumulator agree again. No tokens move; any caller may trigger it. `path` is\n * the juror's accumulator proof (ADR-0012).\n */\nexport function reconcileStake(\n client: AccordStakingClient,\n programId: Address,\n accounts: StakingAccounts,\n path: MSTNode[],\n): Instruction {\n // Empty `path` is valid for depth-0 Subaccords (REVIEW #13).\n return client.buildReconcileStake({ programId, accounts, path });\n}\n\n/**\n * Build `reclaim_slot` (RECLAIM-LEAF) — permissionless crank that pushes a\n * fully-drained JurorStake's `tree_index` onto the free list, blanking the\n * leaf identity to `(default, 0)`. This recycles the tree slot for reuse by a\n * new staker. No tokens move; any caller may trigger it. `path` is the juror's\n * accumulator proof (ADR-0012).\n *\n * Preconditions: the juror must be fully drained (`staked == 0`,\n * `active_draws == 0`, `stake_delta == 0`, `fees_earned == 0`).\n */\nexport function reclaimSlot(\n client: AccordStakingClient,\n programId: Address,\n accounts: { subaccord: Address; jurorStake: Address },\n path: MSTNode[],\n): Instruction {\n return client.buildReclaimSlot({ programId, accounts, path });\n}\n\n/** Accounts for `withdraw_fees` (ADR-0020). */\nexport interface WithdrawFeesAccounts {\n juror: Address;\n subaccord: Address;\n jurorStake: Address;\n feeToken: Address;\n /** Juror's ATA of the fee token (withdraw destination). */\n jurorFeeTokenAccount: Address;\n /** Subaccord PDA's fee_vault ATA (withdraw source). */\n feeVault: Address;\n}\n\n/**\n * Accounts for `prune_juror` (PROG-ATTESTATION). `caller` is the cranker\n * (signer = the adapter's wallet); `juror` is the EXPIRED juror being pruned\n * (NOT a signer — read-only on chain). Mirrors the on-chain `PruneJuror` struct\n * (lib.rs).\n */\nexport interface PruneJurorAccounts {\n caller: Address;\n juror: Address;\n subaccord: Address;\n jurorStake: Address;\n}\n\n/**\n * Build `withdraw_fees` (ADR-0020). Per-juror: pulls aggregate `fees_earned`\n * from the Subaccord's `fee_vault` → the juror's `fee_token` ATA. No\n * `active_draws` gate, no timelock — earned fees are not at-risk capital.\n */\nexport function withdrawFees(\n client: AccordStakingClient,\n programId: Address,\n accounts: WithdrawFeesAccounts,\n): Instruction {\n return client.buildWithdrawFees({ programId, accounts });\n}\n\n/**\n * Build `prune_juror` (PROG-ATTESTATION) — permissionless crank. Evicts an\n * expired juror's `JurorStake` from a credential-gated Subaccord and recomputes\n * the accumulator root via `path`. The cranker (`caller`) signs; the expired\n * `juror` does NOT. `attestation` is the expired juror's SAS attestation,\n * passed as `remaining_accounts[0]` (read-only) so the handler can revoke it.\n */\nexport function pruneJuror(\n client: AccordStakingClient,\n programId: Address,\n accounts: PruneJurorAccounts,\n path: MSTNode[],\n attestation: Address,\n): Instruction {\n if (!attestation) {\n throw new Error(\n \"PruneJurorMissingAttestation: pruneJuror requires the expired juror's SAS attestation\",\n );\n }\n return client.buildPruneJuror({ programId, accounts, path, attestation });\n}\n","/**\n * settlement.ts — per-round settlement crank + dispute cancellation.\n *\n * `settle_round` is the permissionless per-round crank that settles a single\n * round's economics (slashing incoherent jurors + redistributing the pool) once\n * revealed. `cancel_dispute` refunds the filer's fee when a round fails to\n * reach a ruling within its timeout window — a permissionless timeout exit.\n *\n * Same ADR-0010 facade pattern: pure orchestration over a typed\n * {@link AccordSettlementClient} seam; Kit type-only; `remainingAccounts`\n * carry the JurorStake / Round / AppealBond PDAs the handlers mutate.\n *\n * Sources of truth:\n * - settle_round: programs/accord/src/lib.rs (1291)\n * - cancel_dispute: programs/accord/src/lib.rs (1539)\n */\nimport type { Address, Instruction } from \"@solana/kit\";\n\n/** Accounts for `settle_round`. */\nexport interface SettleRoundAccounts {\n /** Any caller (permissionless crank). Signer. */\n caller: Address;\n subaccord: Address;\n dispute: Address;\n round: Address;\n}\n\n/** Accounts for `cancel_dispute`. */\nexport interface CancelDisputeAccounts {\n /** Any caller (permissionless crank). Signer. */\n caller: Address;\n subaccord: Address;\n dispute: Address;\n feeToken: Address;\n /** Filer's ATA — refund destination (owner checked on-chain). */\n filerTokenAccount: Address;\n feeVault: Address;\n}\n\n/**\n * Seam to the Codama-generated Kit client (ADR-0010). Foundation wires the\n * concrete adapter; settlement.ts stays orchestration-only.\n */\nexport interface AccordSettlementClient {\n buildSettleRound(input: {\n programId: Address;\n accounts: SettleRoundAccounts;\n roundIdx: number;\n /** remaining_accounts: drawn JurorStake PDAs the crank mutates. */\n remainingAccounts: Address[];\n }): Instruction;\n buildCancelDispute(input: {\n programId: Address;\n accounts: CancelDisputeAccounts;\n /** remaining_accounts: Round + JurorStake + AppealBond PDAs. */\n remainingAccounts: Address[];\n }): Instruction;\n}\n\n/**\n * Build the permissionless `settle_round` crank (lib.rs:1291). Settles one\n * round's economics after reveal — slashing incoherent jurors, redistributing\n * the pool. `roundIdx` selects the round; `remainingAccounts` are the drawn\n * JurorStake PDAs for that round (writable, mutated for slashes/rewards).\n */\nexport function settleRound(\n client: AccordSettlementClient,\n programId: Address,\n accounts: SettleRoundAccounts,\n roundIdx: number,\n remainingAccounts: Address[],\n): Instruction {\n if (!Number.isInteger(roundIdx) || roundIdx < 0 || roundIdx > 0xffffffff) {\n throw new Error(`InvalidRoundIdx: expected u32, got ${roundIdx}`);\n }\n return client.buildSettleRound({\n programId,\n accounts,\n roundIdx,\n remainingAccounts,\n });\n}\n\n/**\n * Build the permissionless `cancel_dispute` crank (lib.rs:1539). Refunds the\n * filer's fee when a round times out without a ruling. `remainingAccounts`\n * carries the Round + JurorStake + AppealBond PDAs the handler closes/refunds.\n */\nexport function cancelDispute(\n client: AccordSettlementClient,\n programId: Address,\n accounts: CancelDisputeAccounts,\n remainingAccounts: Address[],\n): Instruction {\n return client.buildCancelDispute({\n programId,\n accounts,\n remainingAccounts,\n });\n}\n","/**\n * mst.ts — subtree-sum stake accumulator builder (ADR-0012).\n *\n * Replaces the ADR-0009 cumulative-from-left snapshot MST. The on-chain\n * program maintains only the root (`Subaccord.root_hash` + `total_stake`);\n * the full tree lives off-chain (indexers). This module is the byte-exact\n * reference the chain verifies against:\n *\n * leaf = H(juror[32] ‖ stake_le[8])\n * node = H(left_hash[32] ‖ left_sum_le[8] ‖ right_hash[32] ‖ right_sum_le[8])\n * node.sum = left_sum + right_sum\n *\n * Sums are bound into node hashes, so stake-weighted ranges are\n * cryptographically authenticated (CONCEPT-REVIEW Bad 5, fixed by\n * construction). A one-leaf change touches only that leaf's ancestors →\n * O(log N) updates via {@link proofFor}.\n *\n * Sortition uses the cumulative-from-left prefix (sum of left-sibling subtree\n * sums on right-branch levels), reconstructed from the authenticated path:\n * the selected leaf's range is `[prefix, prefix + stake)`.\n *\n * Sources of truth:\n * - on-chain helpers: programs/accord/src/lib.rs (mst_leaf_hash, mst_node_hash,\n * empty_tree_root, verify_and_recompute, verify_membership_and_prefix)\n * - state: LeafClaim / MSTNode in programs/accord/src/state.rs\n *\n * @see ADR-0012\n */\n\n// ---------------------------------------------------------------------------\n// Types (byte-oriented; the generated Address-typed variants are used at the\n// instruction boundary in adapter.ts)\n// ---------------------------------------------------------------------------\n\n/** A subtree-sum proof element: the sibling subtree's hash + total stake. */\nexport interface MSTNode {\n siblingHash: Uint8Array; // 32 bytes\n siblingSum: bigint; // u64\n}\n\n/** A leaf of the accumulator: `(juror, stake)`. */\nexport interface LeafClaim {\n juror: Uint8Array; // 32 bytes\n stake: bigint; // u64\n}\n\n/**\n * Internal cache of all hash/sum levels. `levels[0]` = leaf hashes,\n * `levels[d]` = root. Stored so `proofFor` is O(log N) instead of O(N).\n */\ninterface LevelCache {\n hashes: Uint8Array[][];\n sums: bigint[][];\n}\n\n/** A built accumulator: leaves + the canonical root. */\nexport interface MerkleAccumulator {\n /** Fixed tree depth (bounds the pool at 2^depth). */\n depth: number;\n /** Index → leaf. Empty slots hold the all-zero leaf `(default, 0)`. */\n leaves: LeafClaim[];\n rootHash: Uint8Array; // 32 bytes\n rootSum: bigint; // == total stake\n /** Opaque cache — don't inspect; use {@link proofFor}. */\n _levels?: LevelCache;\n}\n\n/** Maximum depth the SDK accepts. The on-chain program allows up to 31, but\n * `buildAccumulator` hashes `2^depth` leaves — impractical beyond 20 in a\n * browser. Deeper pools should use a dedicated indexer for proofs. */\nexport const MAX_SDK_DEPTH = 20;\n\n// ---------------------------------------------------------------------------\n// Hashing — must match solana_program::hash::hashv (SHA-256 over concat).\n// ---------------------------------------------------------------------------\n\nasync function sha256(...parts: Uint8Array[]): Promise<Uint8Array> {\n let len = 0;\n for (const p of parts) len += p.length;\n const buf = new Uint8Array(len);\n let off = 0;\n for (const p of parts) {\n buf.set(p, off);\n off += p.length;\n }\n return new Uint8Array(await globalThis.crypto.subtle.digest(\"SHA-256\", buf));\n}\n\nfunction le8(v: bigint): Uint8Array {\n const b = new Uint8Array(8);\n new DataView(b.buffer).setBigUint64(0, v, true);\n return b;\n}\n\n/** Leaf hash `H(juror ‖ stake_le)` (lib.rs mst_leaf_hash). */\nexport async function leafHash(\n juror: Uint8Array,\n stake: bigint,\n): Promise<Uint8Array> {\n if (juror.length !== 32) throw new Error(\"InvalidJuror: expected 32 bytes\");\n return sha256(juror, le8(stake));\n}\n\n/** Node hash `H(left_hash ‖ left_sum ‖ right_hash ‖ right_sum)` (lib.rs mst_node_hash). */\nasync function nodeHash(\n leftHash: Uint8Array,\n leftSum: bigint,\n rightHash: Uint8Array,\n rightSum: bigint,\n): Promise<Uint8Array> {\n return sha256(leftHash, le8(leftSum), rightHash, le8(rightSum));\n}\n\n/** Root hash of an all-zero tree at `depth` (lib.rs empty_tree_root). */\nexport async function emptyRoot(depth: number): Promise<Uint8Array> {\n let h = await leafHash(new Uint8Array(32), 0n);\n for (let i = 0; i < depth; i++) {\n h = await nodeHash(h, 0n, h, 0n);\n }\n return h;\n}\n\n// ---------------------------------------------------------------------------\n// Builder\n// ---------------------------------------------------------------------------\n\n/**\n * Build a depth-`depth` accumulator from `leaves` (index = position), padding\n * the remaining `2^depth` slots with zero leaves. Returns the canonical root\n * the on-chain program would hold after these stakes (the audit property: an\n * off-chain rebuild from `JurorStake` via `getProgramAccounts` reproduces it).\n *\n * Caches all intermediate hash levels so {@link proofFor} is O(log N).\n */\nexport async function buildAccumulator(\n leaves: LeafClaim[],\n depth: number,\n): Promise<MerkleAccumulator> {\n if (!Number.isInteger(depth) || depth < 0 || depth > MAX_SDK_DEPTH) {\n throw new Error(`InvalidDepth: expected 0..${MAX_SDK_DEPTH}, got ${depth}`);\n }\n const size = 2 ** depth;\n if (leaves.length > size) {\n throw new Error(\n `TreeFull: ${leaves.length} leaves exceed 2^depth(${depth})=${size}`,\n );\n }\n const padded: LeafClaim[] = new Array(size);\n for (let i = 0; i < size; i++) {\n padded[i] =\n i < leaves.length ? leaves[i]! : { juror: new Uint8Array(32), stake: 0n };\n }\n\n const levelHashes: Uint8Array[][] = [];\n const levelSums: bigint[][] = [];\n\n levelHashes.push(\n await Promise.all(padded.map((l) => leafHash(l.juror, l.stake))),\n );\n levelSums.push(padded.map((l) => l.stake));\n\n let hashes = levelHashes[0]!;\n let sums = levelSums[0]!;\n for (let level = 0; level < depth; level++) {\n const nextH: Uint8Array[] = [];\n const nextS: bigint[] = [];\n for (let k = 0; k < hashes.length; k += 2) {\n nextH.push(\n await nodeHash(hashes[k]!, sums[k]!, hashes[k + 1]!, sums[k + 1]!),\n );\n nextS.push(sums[k]! + sums[k + 1]!);\n }\n levelHashes.push(nextH);\n levelSums.push(nextS);\n hashes = nextH;\n sums = nextS;\n }\n\n return {\n depth,\n leaves: padded,\n rootHash: hashes[0]!,\n rootSum: sums[0]!,\n _levels: { hashes: levelHashes, sums: levelSums },\n };\n}\n\n// ---------------------------------------------------------------------------\n// Proofs + verification\n// ---------------------------------------------------------------------------\n\n/**\n * The client-supplied Merkle path for `index` (sibling hash + sum per level,\n * leaf → root). Used by `stake`/`requestWithdraw`/`reconcileStake`\n * (verify-and-recompute) and by `draw_seat` (membership + sortition prefix).\n *\n * O(log N) — reads siblings from the cached levels built by\n * {@link buildAccumulator}. Falls back to O(N) rehash if the cache is absent\n * (e.g. the accumulator was constructed by hand without `_levels`).\n */\nexport async function proofFor(\n tree: MerkleAccumulator,\n index: number,\n): Promise<MSTNode[]> {\n const size = 2 ** tree.depth;\n if (!Number.isInteger(index) || index < 0 || index >= size) {\n throw new Error(`InvalidIndex: expected 0..<${size}, got ${index}`);\n }\n\n // Fast path: read siblings from cached levels.\n if (tree._levels) {\n const path: MSTNode[] = [];\n let idx = index;\n for (let level = 0; level < tree.depth; level++) {\n const sib = idx % 2 === 0 ? idx + 1 : idx - 1;\n path.push({\n siblingHash: tree._levels.hashes[level]![sib]!,\n siblingSum: tree._levels.sums[level]![sib]!,\n });\n idx = Math.floor(idx / 2);\n }\n return path;\n }\n\n // Slow fallback: rebuild all levels (for hand-constructed accumulators).\n let hashes = await Promise.all(\n tree.leaves.map((l) => leafHash(l.juror, l.stake)),\n );\n let sums = tree.leaves.map((l) => l.stake);\n const path: MSTNode[] = [];\n let idx = index;\n for (let level = 0; level < tree.depth; level++) {\n const sib = idx % 2 === 0 ? idx + 1 : idx - 1;\n path.push({ siblingHash: hashes[sib]!, siblingSum: sums[sib]! });\n const nextH: Uint8Array[] = [];\n const nextS: bigint[] = [];\n for (let k = 0; k < hashes.length; k += 2) {\n nextH.push(\n await nodeHash(hashes[k]!, sums[k]!, hashes[k + 1]!, sums[k + 1]!),\n );\n nextS.push(sums[k]! + sums[k + 1]!);\n }\n hashes = nextH;\n sums = nextS;\n idx = Math.floor(idx / 2);\n }\n return path;\n}\n\n/** Reconstruct the path root from a leaf (for off-chain audit / debugging). */\nexport async function recomputeRoot(\n leaf: LeafClaim,\n index: number,\n path: MSTNode[],\n): Promise<{ hash: Uint8Array; sum: bigint }> {\n let h = await leafHash(leaf.juror, leaf.stake);\n let s = leaf.stake;\n let idx = index;\n for (const node of path) {\n const leafIsLeft = (idx & 1) === 0;\n if (leafIsLeft) {\n h = await nodeHash(h, s, node.siblingHash, node.siblingSum);\n } else {\n h = await nodeHash(node.siblingHash, node.siblingSum, h, s);\n }\n s = s + node.siblingSum;\n idx = Math.floor(idx / 2);\n }\n return { hash: h, sum: s };\n}\n\n/**\n * Verify `leaf` at `index` authenticates against `(rootHash, rootSum)` and\n * return the cumulative-from-left prefix (lib.rs verify_membership_and_prefix).\n * The leaf's sortition range is `[prefix, prefix + stake)`.\n */\nexport async function verifyMembership(\n leaf: LeafClaim,\n index: number,\n path: MSTNode[],\n rootHash: Uint8Array,\n rootSum: bigint,\n): Promise<{ ok: boolean; prefix: bigint }> {\n const { hash, sum } = await recomputeRoot(leaf, index, path);\n // prefix = sum of left-sibling subtree sums on levels where the leaf is the\n // right child (bit `level` of `index` is 1).\n let prefix = 0n;\n let idx = index;\n for (const node of path) {\n if ((idx & 1) === 1) prefix += node.siblingSum;\n idx = Math.floor(idx / 2);\n }\n const ok = eq(hash, rootHash) && sum === rootSum;\n return { ok, prefix };\n}\n\nfunction eq(a: Uint8Array, b: Uint8Array): boolean {\n if (a.length !== b.length) return false;\n let diff = 0;\n for (let i = 0; i < a.length; i++) diff |= a[i]! ^ b[i]!;\n return diff === 0;\n}\n","/**\n * vrf.ts — VRF request + per-seat draw choreography (ADR-0009 §2 + ADR-0012).\n *\n * 1. request_vrf — CPI into the magicblock VRF oracle (one-shot).\n * 2. commit_vrf_callback — oracle calls back; sets `dispute.committed_vrf`\n * AND atomically freezes `dispute.frozen_root`.\n * 3. draw_seat(seat, mem) — submit one seat's membership against the frozen\n * root. One tx per seat (1232B can't hold N proofs).\n *\n * The VRF result is committed ONCE and immutable. The frozen root is the live\n * accumulator root captured atomically at callback time — all N draw_seat txs\n * (and every appeal round) select against the SAME root.\n *\n * The chain is a dumb verifier: per seat `i`, it derives\n * vrf_seed = sha256(committed_vrf ‖ dispute ‖ round_idx_le4 ‖ draw_attempt_le4)\n * r_i = u64_le(sha256(vrf_seed ‖ seat_le4 ‖ retry_le4)[0..8]) % frozen_total_stake\n * and checks the submitted leaf's reconstructed prefix ranges contains `r_i`.\n * `draw_attempt` (ADR-0021) is orthogonal to `round_idx`: a shortfall redraw\n * increments it to re-seed the panel at the same size (no appeal consumed).\n * Deterministic collision re-roll (sampling without replacement) is computed\n * client-side to match the chain — bean accord-tzo0.\n *\n * Sources of truth:\n * - request_vrf / commit_vrf_callback / draw_seat: lib.rs\n * - sortition criterion: ADR-0009 §2 (subtree-sum form, ADR-0012)\n */\nimport type { Address, Instruction } from \"@solana/kit\";\nimport {\n type LeafClaim,\n type MSTNode,\n type MerkleAccumulator,\n proofFor,\n verifyMembership,\n} from \"./mst.js\";\n\n// ---------------------------------------------------------------------------\n// Pure crypto helpers (sha256 via Web Crypto; le encoders)\n// ---------------------------------------------------------------------------\n\nasync function sha256(...parts: Uint8Array[]): Promise<Uint8Array> {\n let len = 0;\n for (const p of parts) len += p.length;\n const buf = new Uint8Array(len);\n let off = 0;\n for (const p of parts) {\n buf.set(p, off);\n off += p.length;\n }\n return new Uint8Array(await globalThis.crypto.subtle.digest(\"SHA-256\", buf));\n}\n\nfunction le4(v: number): Uint8Array {\n const b = new Uint8Array(4);\n new DataView(b.buffer).setUint32(0, v, true);\n return b;\n}\n\n/** First 8 bytes of a hash, read little-endian as a u64. */\nfunction leU64At(b: Uint8Array, off = 0): bigint {\n return new DataView(b.buffer, b.byteOffset, b.byteLength).getBigUint64(\n off,\n true,\n );\n}\n\n// ---------------------------------------------------------------------------\n// Sortition slot derivation (lib.rs draw_seat) — pure, deterministic\n// ---------------------------------------------------------------------------\n\n/**\n * `vrf_seed = sha256(committed_vrf ‖ dispute ‖ round_idx_le4 ‖ draw_attempt_le4)`\n * (lib.rs draw_seat, ADR-0021). Binds the committed VRF to this dispute + round\n * + redraw attempt. `drawAttempt` defaults to 0 (the initial draw); a shortfall\n * redraw bumps it so the same panel size yields fresh seats.\n */\nexport async function vrfSeed(\n committedVrf: Uint8Array,\n disputeBytes: Uint8Array,\n roundIdx: number,\n drawAttempt: number = 0,\n): Promise<Uint8Array> {\n if (committedVrf.length !== 32)\n throw new Error(\"InvalidVrf: expected 32 bytes\");\n if (disputeBytes.length !== 32)\n throw new Error(\"InvalidDispute: expected 32 bytes\");\n if (!Number.isInteger(roundIdx) || roundIdx < 0 || roundIdx > 0xffffffff)\n throw new Error(`InvalidRoundIdx: expected u32, got ${roundIdx}`);\n if (\n !Number.isInteger(drawAttempt) ||\n drawAttempt < 0 ||\n drawAttempt > 0xffffffff\n )\n throw new Error(`InvalidDrawAttempt: expected u32, got ${drawAttempt}`);\n return sha256(committedVrf, disputeBytes, le4(roundIdx), le4(drawAttempt));\n}\n\n/**\n * Derive the sortition point for a single seat at a given retry:\n * `r_i = u64_le(sha256(vrf_seed ‖ seat_le4 ‖ retry_le4)[0..8]) % frozen_total_stake`.\n * `retry` defaults to 0 (the common case — no collision). The on-chain\n * `draw_seat` includes the same retry counter in its sortition hash and verifies\n * that every prior retry (0..retries) genuinely collided with an already-drawn\n * juror (bean accord-tzo0).\n */\nexport async function seatSlot(\n committedVrf: Uint8Array,\n disputeBytes: Uint8Array,\n roundIdx: number,\n seat: number,\n frozenTotalStake: bigint,\n retry: number = 0,\n drawAttempt: number = 0,\n): Promise<bigint> {\n if (frozenTotalStake <= 0n) throw new Error(\"InvalidTotalStake: must be > 0\");\n if (!Number.isInteger(seat) || seat < 0 || seat > 0xffffffff)\n throw new Error(`InvalidSeat: expected u32, got ${seat}`);\n if (!Number.isInteger(retry) || retry < 0)\n throw new Error(\n `InvalidRetry: expected non-negative integer, got ${retry}`,\n );\n const seed = await vrfSeed(committedVrf, disputeBytes, roundIdx, drawAttempt);\n const rHash = await sha256(seed, le4(seat), le4(retry));\n return leU64At(rHash, 0) % frozenTotalStake;\n}\n\n/**\n * Find the leaf in `tree` whose sortition range `[prefix, prefix+stake)`\n * contains `slot`, and return it with its index + proof. Returns `null` if the\n * slot lands in a zero-stake gap (no eligible leaf).\n */\nexport async function findLeafForSlot(\n tree: MerkleAccumulator,\n slot: bigint,\n): Promise<{ leaf: LeafClaim; index: number; proof: MSTNode[] } | null> {\n let running = 0n;\n for (let i = 0; i < tree.leaves.length; i++) {\n const leaf = tree.leaves[i]!;\n if (leaf.stake > 0n && slot >= running && slot - running < leaf.stake) {\n const proof = await proofFor(tree, i);\n return { leaf, index: i, proof };\n }\n running += leaf.stake;\n }\n return null;\n}\n\n/**\n * Resolve a single seat using the deterministic collision re-roll algorithm\n * (bean accord-tzo0). Iterates `retry = 0, 1, 2, …` computing\n * `r_i = sha256(seed ‖ seat ‖ retry) % total_stake`; the first retry whose\n * selected leaf is NOT in `alreadyDrawn` is the terminal. Returns the leaf,\n * proof, and the `retries` count the cranker must submit to `draw_seat`.\n *\n * The on-chain verifier independently confirms every prior retry collided — so\n * there is exactly one valid (leaf, retries) pair per seat. No caller choice.\n */\nexport async function resolveSeat(\n committedVrf: Uint8Array,\n disputeBytes: Uint8Array,\n roundIdx: number,\n seat: number,\n tree: MerkleAccumulator,\n alreadyDrawn: Uint8Array[],\n maxRetries: number = 1024,\n drawAttempt: number = 0,\n): Promise<{\n leaf: LeafClaim;\n index: number;\n proof: MSTNode[];\n retries: number;\n}> {\n const total = tree.rootSum;\n if (total <= 0n) throw new Error(\"InvalidTotalStake: must be > 0\");\n const drawnHex = new Set(alreadyDrawn.map((j) => hex(j)));\n for (let retry = 0; retry <= maxRetries; retry++) {\n const slot = await seatSlot(\n committedVrf,\n disputeBytes,\n roundIdx,\n seat,\n total,\n retry,\n drawAttempt,\n );\n const found = await findLeafForSlot(tree, slot);\n if (found && !drawnHex.has(hex(found.leaf.juror))) {\n return { ...found, retries: retry };\n }\n // else: collision (already drawn) or zero-stake gap → re-roll\n }\n throw new Error(\n `MaxRetriesExceeded: seat ${seat} could not resolve in ${maxRetries} retries`,\n );\n}\n\nfunction hex(b: Uint8Array): string {\n let s = \"\";\n for (const x of b) s += x.toString(16).padStart(2, \"0\");\n return s;\n}\n\n/** Verify a seat's membership reconstructs to the frozen root (client-side precheck). */\nexport async function verifySeat(\n leaf: LeafClaim,\n index: number,\n proof: MSTNode[],\n frozenRoot: Uint8Array,\n frozenTotalStake: bigint,\n): Promise<boolean> {\n const { ok } = await verifyMembership(\n leaf,\n index,\n proof,\n frozenRoot,\n frozenTotalStake,\n );\n return ok;\n}\n\n// ---------------------------------------------------------------------------\n// Seam (ADR-0010) + instruction orchestration\n// ---------------------------------------------------------------------------\n\n/** Accounts for `request_vrf` / `draw_seat` (the cranker signs). */\nexport interface VrfDrawAccounts {\n caller: Address;\n subaccord: Address;\n dispute: Address;\n}\n\n/** Extra accounts `request_vrf` needs for the VRF oracle CPI. */\nexport interface RequestVrfExtras {\n /** magicblock VRF oracle queue account. */\n oracleQueue: Address;\n /** Accord program-identity PDA (CPI authority for the VRF oracle). */\n programIdentity: Address;\n}\n\n/**\n * One seat's resolved membership: the leaf `(juror, stake)` at `index` plus its\n * accumulator proof, the juror's `JurorStake` PDA (remaining_accounts[0]), and\n * the deterministic collision re-roll count (bean accord-tzo0).\n */\nexport interface SeatMembership {\n leaf: LeafClaim;\n index: number;\n proof: MSTNode[];\n jurorStake: Address;\n /** Number of sortition retries (collisions) before this leaf was selected. */\n retries: number;\n}\n\n/**\n * Seam to the Codama-generated Kit client + Dispute fetcher. Foundation wires\n * the concrete adapter; vrf.ts stays orchestration-only.\n */\nexport interface AccordVrfClient {\n buildRequestVrf(input: {\n programId: Address;\n accounts: VrfDrawAccounts;\n extras: RequestVrfExtras;\n }): Instruction;\n buildDrawSeat(input: {\n programId: Address;\n accounts: VrfDrawAccounts;\n /** Round PDA — `init_if_needed` by draw_seat (`[\"round\", dispute, current_round]`). */\n roundPda: Address;\n seat: number;\n /** Sortition collision re-roll count (bean accord-tzo0). */\n retries: number;\n leaf: LeafClaim;\n proof: MSTNode[];\n index: number;\n jurorStake: Address;\n }): Instruction;\n /** Read `committed_vrf` from a Dispute; `null` until the oracle callback lands. */\n fetchCommittedVrf(dispute: Address): Promise<Uint8Array | null>;\n}\n\n/** Build `request_vrf`. One-shot; triggers the oracle callback (freezes the root). */\nexport function requestVrf(\n client: AccordVrfClient,\n programId: Address,\n accounts: VrfDrawAccounts,\n extras: RequestVrfExtras,\n): Instruction {\n return client.buildRequestVrf({ programId, accounts, extras });\n}\n\n/**\n * Poll a Dispute's `committed_vrf` until the oracle callback lands (or\n * `timeoutMs` elapses). Returns the 32-byte randomness. Use between\n * {@link requestVrf} and {@link drawSeat}.\n */\nexport async function awaitCommittedVrf(\n client: AccordVrfClient,\n dispute: Address,\n opts: { pollIntervalMs?: number; timeoutMs?: number } = {},\n): Promise<Uint8Array> {\n const interval = opts.pollIntervalMs ?? 400;\n const deadline = Date.now() + (opts.timeoutMs ?? 30_000);\n while (Date.now() < deadline) {\n const vrf = await client.fetchCommittedVrf(dispute);\n if (vrf && vrf.length === 32) return vrf;\n await sleep(interval);\n }\n throw new Error(`VrfTimeout: committed_vrf not set on ${dispute}`);\n}\n\nfunction sleep(ms: number): Promise<void> {\n return new Promise((r) => setTimeout(r, ms));\n}\n\n/**\n * Build `draw_seat` for one seat (lib.rs). Pass the pre-resolved `seat` +\n * membership (from {@link resolveSeat}) and the juror's `JurorStake` PDA. The\n * round is `init_if_needed` on-chain and persists across the N seat txs.\n * `membership.retries` carries the deterministic collision re-roll count.\n */\nexport function drawSeat(\n client: AccordVrfClient,\n programId: Address,\n accounts: VrfDrawAccounts,\n roundPda: Address,\n seat: number,\n membership: SeatMembership,\n): Instruction {\n return client.buildDrawSeat({\n programId,\n accounts,\n roundPda,\n seat,\n retries: membership.retries,\n leaf: membership.leaf,\n proof: membership.proof,\n index: membership.index,\n jurorStake: membership.jurorStake,\n });\n}\n","/**\n * voting.ts — commit-reveal voting + finalization cranks (ADR-0010) with\n * scalar u64 votes (ADR-0025).\n *\n * The load-bearing client-side cryptography lives here: the commit hash\n * `sha256(vote_le[8] ‖ salt[32] ‖ juror_pubkey[32])`\n * where `vote_le` is the vote's 8-byte little-endian encoding — votes are\n * `u64` on the wire (option index for `Plurality`, fixed-point scalar in\n * settlement-mint base units for `Median`). The on-chain `reveal`\n * recomputes this via `solana_program::hash::hashv` (instructions/reveal.rs:\n * `hashv(&[&vote.to_le_bytes(), &salt, juror_key.as_ref()])`) and checks it\n * against the stored commitment. Mismatching the byte order or lengths here\n * silently breaks every dispute, so `commitHash` is unit-tested against a\n * hardcoded digest vector.\n *\n * Four instructions are orchestrated:\n * - {@link commit} juror commits `hash(vote, salt, juror)`.\n * - {@link reveal} juror reveals `{vote, salt}` (chain re-derives hash).\n * - {@link finalizeRound} permissionless crank: tally (plurality or median) → RoundResolved.\n * - {@link finalizeDispute} permissionless crank: settles economics, writes ruling.\n *\n * As in dispute.ts, the module is pure facade orchestration over a typed\n * {@link AccordVotingClient} seam that Foundation wires to the Codama-generated\n * Kit client. Kit is imported type-only (erased at runtime); the PDA helper\n * lazy-imports Kit so the unit tests load zero runtime deps.\n *\n * Sources of truth:\n * - commit/reveal/finalize_*: programs/accord/src/instructions/{commit,reveal,finalize_round,finalize_dispute}.rs\n * - Round struct + seeds: programs/accord/src/state.rs (Round, SEED_ROUND)\n */\nimport type { Address, Instruction } from \"@solana/kit\";\n\n/**\n * No-reveal sentinel: `u64::MAX` marks \"not revealed\" in `Round.reveals` and\n * \"not set\" in `Round.result` (ADR-0025; was `u8::MAX` before scalar votes).\n * Both aggregation modes reject it as an actual vote on-chain.\n */\nexport const NO_VOTE = 0xffff_ffff_ffff_ffffn;\n\n/** Round PDA seed prefix, `b\"round\"` (state.rs: SEED_ROUND). */\nconst SEED_ROUND = new Uint8Array([114, 111, 117, 110, 100]); // \"round\"\n\n/** Commit-hash preimage length: 8 vote bytes (u64 LE) + 32 salt + 32 juror pubkey. */\nconst COMMIT_PREIMAGE_LEN = 8 + 32 + 32;\n\n/**\n * Shared accounts every voting instruction takes (juror or cranker signs).\n *\n * `commit`/`reveal`/`finalizeRound`/`finalizeDispute` use only the first four.\n * The `stakingToken`/`jurorTokenAccount`/`vault` fields are vestigial: pre\n * ADR-0020 `reveal` paid a fee on reveal; that credit now happens in\n * `finalize_round`. The adapter ignores them and the chain doesn't ask.\n * `tokenProgram` is a fixed constant.\n */\nexport interface VotingAccounts {\n /** Commit/reveal: the drawn juror. finalize_*: any cranker. Always a signer. */\n signer: Address;\n subaccord: Address;\n dispute: Address;\n round: Address;\n /** @deprecated vestigial — reveal no longer moves tokens (ADR-0020). */\n stakingToken?: Address;\n /** @deprecated vestigial — reveal no longer moves tokens (ADR-0020). */\n jurorTokenAccount?: Address;\n /** @deprecated vestigial — reveal no longer moves tokens (ADR-0020). */\n vault?: Address;\n}\n\n/** A juror's vote + salt (the reveal preimage). */\nexport interface VoteArgs {\n /**\n * The vote, `u64` on the wire (ADR-0025): an option index for `Plurality`\n * disputes or a scaled scalar for `Median` (see {@link encodeScalarVote}).\n */\n vote: bigint;\n /** 32-byte random salt — secret until reveal. */\n salt: Uint8Array;\n}\n\n/**\n * Compute the commit hash `sha256(vote_le[8] ‖ salt[32] ‖ juror_pubkey[32])`.\n *\n * Bit-for-bit compatible with the on-chain `reveal` check\n * (instructions/reveal.rs): `hashv(&[&vote.to_le_bytes(), &salt,\n * juror_key.as_ref()]).to_bytes()` — the vote is hashed as 8-byte\n * little-endian (ADR-0025), so the preimage is 72 bytes.\n *\n * Uses the Web Crypto API (`globalThis.crypto.subtle`): zero-dependency,\n * available in Node ≥ 18 and all browsers. `jurorBytes` is the juror's 32-byte\n * pubkey encoding (Kit's `getAddressEncoder().encode(juror)`).\n */\nexport async function commitHash(\n vote: bigint,\n salt: Uint8Array,\n jurorBytes: Uint8Array,\n): Promise<Uint8Array> {\n if (typeof vote !== \"bigint\" || vote < 0n || vote > NO_VOTE) {\n throw new Error(`InvalidVote: vote must fit a u64 bigint, got ${vote}`);\n }\n if (salt.length !== 32) {\n throw new Error(`InvalidSalt: expected 32 bytes, got ${salt.length}`);\n }\n if (jurorBytes.length !== 32) {\n throw new Error(\n `InvalidJuror: expected 32-byte pubkey, got ${jurorBytes.length}`,\n );\n }\n const preimage = new Uint8Array(COMMIT_PREIMAGE_LEN);\n new DataView(preimage.buffer).setBigUint64(0, vote, true); // vote LE\n preimage.set(salt, 8);\n preimage.set(jurorBytes, 40);\n const digest = await globalThis.crypto.subtle.digest(\"SHA-256\", preimage);\n return new Uint8Array(digest);\n}\n\n/**\n * Validate an option-index vote for `Plurality` disputes: `vote <\n * num_options` (instructions/reveal.rs). `Median` scalars carry no\n * client-side range beyond the u64 fit checked in {@link commitHash} and the\n * facades. Pure.\n */\nexport function assertValidVote(vote: bigint, numOptions: number): void {\n if (vote < 0n || vote >= BigInt(numOptions)) {\n throw new Error(`InvalidVote: expected 0..${numOptions}, got ${vote}`);\n }\n}\n\n/** Validate the salt is 32 bytes. Pure. */\nexport function assertValidSalt(salt: Uint8Array): void {\n if (salt.length !== 32) {\n throw new Error(`InvalidSalt: expected 32 bytes, got ${salt.length}`);\n }\n}\n\n/**\n * Client-side mirror of the vote gates common to both aggregation modes\n * (instructions/reveal.rs): the vote must be a u64 and must not be the\n * no-reveal sentinel — `Plurality` bounds it further to a real option index\n * ({@link assertValidVote}); `Median` only excludes the sentinel.\n */\nfunction assertVotable(vote: bigint): void {\n if (typeof vote !== \"bigint\" || vote < 0n || vote >= NO_VOTE) {\n throw new Error(\n `InvalidVote: expected a u64 below the no-reveal sentinel, got ${vote}`,\n );\n }\n}\n\n/**\n * Encode a human-readable scalar vote (ADR-0025 `Median` disputes) as the\n * u64 base-unit bigint the wire takes: `input · 10^decimals`. Accepts plain\n * decimal strings (`\"123\"`, `\"123.45\"`); rejects anything else (sign,\n * exponent, separators, empty string) and fractions longer than `decimals`.\n * The `u64` fit is enforced downstream ({@link commitHash} / the facades).\n * Inverse of {@link decodeScalarVote}.\n */\nexport function encodeScalarVote(input: string, decimals = 6): bigint {\n const m = /^([0-9]+)(?:\\.([0-9]+))?$/.exec(input);\n if (!m) {\n throw new Error(\n `InvalidScalarVote: expected a plain decimal string like \"123\" or \"123.45\", got ${JSON.stringify(input)}`,\n );\n }\n const frac = m[2] ?? \"\";\n if (frac.length > decimals) {\n throw new Error(\n `InvalidScalarVote: ${frac.length} fraction digits exceed decimals=${decimals}: ${JSON.stringify(input)}`,\n );\n }\n return BigInt(m[1]! + frac.padEnd(decimals, \"0\"));\n}\n\n/**\n * Decode a u64 base-unit vote back to a plain decimal string (inverse of\n * {@link encodeScalarVote}): `123450000n` → `\"123.45\"` at the default 6\n * decimals. Trailing fraction zeros are trimmed; a zero fraction collapses\n * to the integer form. Pure.\n */\nexport function decodeScalarVote(vote: bigint, decimals = 6): string {\n if (vote < 0n) {\n throw new Error(\n `InvalidScalarVote: expected a non-negative u64, got ${vote}`,\n );\n }\n if (decimals === 0) return vote.toString();\n const padded = vote.toString().padStart(decimals + 1, \"0\");\n const whole = padded.slice(0, -decimals);\n const frac = padded.slice(-decimals).replace(/0+$/, \"\");\n return frac ? `${whole}.${frac}` : whole;\n}\n\n/**\n * Build the Round PDA seed bytes (state.rs:2124):\n * `[\"round\", dispute.key(), ¤t_round.to_le_bytes()]`.\n *\n * `roundIdx` is `u32` little-endian (4 bytes). Pure + deterministic.\n */\nexport function roundSeeds(\n disputeBytes: Uint8Array,\n roundIdx: number,\n): Uint8Array[] {\n if (!Number.isInteger(roundIdx) || roundIdx < 0 || roundIdx > 0xffffffff) {\n throw new Error(`InvalidRoundIdx: expected u32, got ${roundIdx}`);\n }\n const le = new Uint8Array(4);\n new DataView(le.buffer).setUint32(0, roundIdx, true);\n return [SEED_ROUND, disputeBytes, le];\n}\n\n/** Derive the canonical Round PDA. Kit lazy-imported. */\nexport async function findRoundPda(\n programAddress: Address,\n dispute: Address,\n roundIdx: number,\n): Promise<{ address: Address; bump: number }> {\n const { getAddressEncoder, getProgramDerivedAddress } =\n await import(\"@solana/kit\");\n const disputeBytes = new Uint8Array(getAddressEncoder().encode(dispute));\n const [address, bump] = await getProgramDerivedAddress({\n programAddress,\n seeds: roundSeeds(disputeBytes, roundIdx),\n });\n return { address, bump };\n}\n\n/**\n * Seam to the Codama-generated Kit client (ADR-0010). Foundation provides the\n * concrete adapter; voting.ts stays orchestration-only, so it is parallel-safe\n * under fleet dispatch and compile-verifiable before the generator lands.\n */\nexport interface AccordVotingClient {\n buildCommit(input: {\n programId: Address;\n accounts: VotingAccounts;\n commitment: Uint8Array; // [u8; 32]\n }): Instruction;\n buildReveal(input: {\n programId: Address;\n accounts: VotingAccounts;\n vote: bigint;\n salt: Uint8Array;\n }): Instruction;\n buildFinalizeRound(input: {\n programId: Address;\n accounts: VotingAccounts;\n remainingAccounts?: Address[];\n }): Instruction;\n buildFinalizeDispute(input: {\n programId: Address;\n accounts: VotingAccounts;\n /** remaining_accounts: drawn JurorStake PDAs (+ AppealBond PDAs). */\n remainingAccounts: Address[];\n }): Instruction;\n /** `redraw` (ADR-0021) — see {@link redraw}. */\n buildRedraw(input: {\n programId: Address;\n accounts: RedrawAccounts;\n remainingAccounts?: Address[];\n }): Instruction;\n /** Encode a juror Address to its 32-byte pubkey (Kit `getAddressEncoder`). */\n encodeAddress(address: Address): Uint8Array;\n}\n\n/**\n * Build a `commit` instruction: compute `commitHash(vote, salt, juror)` and\n * hand the 32-byte commitment to the chain (instructions/commit.rs). The\n * juror must be drawn into the round and inside the commit window; those\n * gates are enforced on-chain. Returns the instruction + the computed\n * commitment (for local bookkeeping / indexing).\n */\nexport async function commit(\n client: AccordVotingClient,\n programId: Address,\n accounts: VotingAccounts,\n args: VoteArgs,\n): Promise<{ instruction: Instruction; commitment: Uint8Array }> {\n assertValidSalt(args.salt);\n assertVotable(args.vote);\n const jurorBytes = client.encodeAddress(accounts.signer);\n const commitment = await commitHash(args.vote, args.salt, jurorBytes);\n const instruction = client.buildCommit({\n programId,\n accounts,\n commitment,\n });\n return { instruction, commitment };\n}\n\n/**\n * Build a `reveal` instruction with `{vote, salt}` (instructions/reveal.rs).\n * The chain recomputes `hash(vote_le ‖ salt ‖ juror)` and checks it equals\n * the stored commitment — so `args` MUST be the exact pair used in\n * {@link commit}.\n */\nexport function reveal(\n client: AccordVotingClient,\n programId: Address,\n accounts: VotingAccounts,\n args: VoteArgs,\n): Instruction {\n assertVotable(args.vote);\n assertValidSalt(args.salt);\n // ponytail: ADR-0020 moved reveal's fee credit to finalize_round — on-chain\n // Reveal (instructions/reveal.rs) takes only juror/subaccord/dispute/round.\n // The optional token fields on VotingAccounts are vestigial; the adapter\n // ignores them.\n return client.buildReveal({\n programId,\n accounts,\n vote: args.vote,\n salt: args.salt,\n });\n}\n\n/**\n * Build the permissionless `finalize_round` crank\n * (instructions/finalize_round.rs). After the reveal window elapses, anyone\n * can advance the dispute to `RoundResolved` with the tally winner written\n * to `round.result` (plurality option or median scalar, ADR-0025).\n * ADR-0020: credits\n * `fees_earned` to each revealer — pass the panel's JurorStake PDAs as\n * `remainingAccounts` when `fee_per_juror > 0`.\n */\nexport function finalizeRound(\n client: AccordVotingClient,\n programId: Address,\n accounts: VotingAccounts,\n remainingAccounts: Address[] = [],\n): Instruction {\n return client.buildFinalizeRound({ programId, accounts, remainingAccounts });\n}\n\n/**\n * Build the permissionless `finalize_dispute` crank\n * (instructions/finalize_dispute.rs). After the appeal window elapses,\n * anyone can settle the final round: slash incoherent\n * jurors, redistribute the pool, decrement `active_draws`, and write\n * `final_ruling` (transition to `Final`).\n *\n * `remainingAccounts` = the drawn `JurorStake` PDAs (panel), followed by one\n * `AppealBond` PDA per prior appeal (`current_round` of them). With no appeals\n * this collapses to just the juror stakes.\n */\nexport function finalizeDispute(\n client: AccordVotingClient,\n programId: Address,\n accounts: VotingAccounts,\n remainingAccounts: Address[],\n): Instruction {\n return client.buildFinalizeDispute({\n programId,\n accounts,\n remainingAccounts,\n });\n}\n\n// --- Shortfall redraw (ADR-0021) -------------------------------------------\n\n/**\n * Accounts for `redraw` (lib.rs). The Fail branch refunds the filer from\n * `feeVault`, so it carries the filer's `feeToken` ATA + the vault (validated\n * but unused on the Redraw branch).\n */\nexport interface RedrawAccounts {\n /** Permissionless cranker. */\n caller: Address;\n subaccord: Address;\n dispute: Address;\n /** The shortfall round (`dispute.current_round`). */\n round: Address;\n feeToken: Address;\n /** Filer's `feeToken` ATA — refund destination on exhaustion. */\n filerTokenAccount: Address;\n feeVault: Address;\n tokenProgram: Address;\n}\n\n/**\n * Build the permissionless `redraw` crank (lib.rs, ADR-0021). Only callable\n * from `RedrawEligible`. Slashes no-shows into `stake_delta`, bumps\n * `round.draw_attempt` (orthogonal to `round_idx` — same panel size, no appeal\n * consumed), clears the round → `Created`; on `draw_attempt + 1 ≥\n * max_draw_attempts` → `Failed` (filer `fee_paid` refunded, slashes stand).\n *\n * `remainingAccounts` = the round's drawn `JurorStake` PDAs (panel); on the Fail\n * branch additionally prior-round `Round` PDAs + their `JurorStake` PDAs + the\n * dispute's `AppealBond` PDAs (same layout as `cancel_dispute`).\n */\nexport function redraw(\n client: AccordVotingClient,\n programId: Address,\n accounts: RedrawAccounts,\n remainingAccounts: Address[] = [],\n): Instruction {\n return client.buildRedraw({ programId, accounts, remainingAccounts });\n}\n","/**\n * appeal.ts — dispute appeal + bond refund (ADR-0004).\n *\n * `appeal` is permissionless: any appellant pays the new (larger) round's fee\n * plus an equal bond, opening round `current_round + 1` with a `2N+1` panel\n * and resetting the dispute to `Created` so snapshot→draw→vote reruns. The\n * bond is custodied in a per-appeal `AppealBond` PDA keyed by the round it\n * opened.\n *\n * `claim_appeal_refund` returns a FLIPPED bond to its appellant after\n * `finalize_dispute` (no-flip bonds are folded into the coherent pool there).\n * Idempotent: zeroing the bond on payout makes re-invocation a no-op.\n *\n * Client-side helpers mirror the on-chain appeal ladder (`panel_size_for_round`,\n * lib.rs:2555) and cost math so the facade can quote a panel + fee before\n * sending. Same ADR-0010 facade pattern: Kit type-only, PDA lazy.\n *\n * Sources of truth:\n * - appeal / claim_appeal_refund: lib.rs:1643 (appeal), :1772 (claim_appeal_refund)\n * - Appeal / ClaimAppealRefund accounts: lib.rs:3422 (Appeal), :3486 (ClaimAppealRefund)\n * - AppealBond struct + seeds: state.rs (174-193) `[\"bond\", dispute, round_idx]`\n * - appeal ladder: lib.rs:2553-2570, ADR-0004\n */\nimport {\n getAddressEncoder,\n getProgramDerivedAddress,\n type Address,\n type Instruction,\n} from \"@solana/kit\";\nimport { MAX_JURORS, panelSizeForRound } from \"../constants.js\";\n\nexport {\n MAX_JURORS,\n DEFAULT_APPEAL_WINDOW_SECS,\n panelSizeForRound,\n} from \"../constants.js\";\n\n/** AppealBond PDA seed prefix (state.rs: SEED_APPEAL_BOND = b\"bond\"). */\nconst SEED_APPEAL_BOND = new Uint8Array([98, 111, 110, 100]); // \"bond\"\n\n// ---------------------------------------------------------------------------\n// Pure helpers (mirror on-chain math, testable)\n// ---------------------------------------------------------------------------\n\n/** u32 → 4-byte little-endian. */\nfunction le4(v: number): Uint8Array {\n const b = new Uint8Array(4);\n new DataView(b.buffer).setUint32(0, v, true);\n return b;\n}\n\n/**\n * Required panel size for round `roundIdx` — the appeal ladder\n * `N_{k+1} = 2·N_k + 1` (closed form `(J+1)·2^k − 1`), capped at\n * {@link MAX_JURORS}. Direct port of `panel_size_for_round` (lib.rs:2555).\n * Returns `null` on overflow (round_idx ≥ 31).\n *\n * Re-exported from {@link ../constants.js} for module-internal use.\n */\n\n/** Appeal cost breakdown for opening round `currentRound + 1` (lib.rs:1688-1695). */\nexport interface AppealCost {\n newRound: number;\n panel: number;\n /** New-round fee = panel · fee_per_juror. */\n fee: bigint;\n /** Bond == new-round fee (forfeited if no flip, returned if flipped). */\n bond: bigint;\n /** Appellant pays fee + bond up front. */\n total: bigint;\n}\n\n/**\n * Quote the panel + fee + bond for an appeal from `currentRound`. Mirrors\n * lib.rs:1688-1695 (`panel_new = panel_size_for_round(J, current+1)`,\n * `fee_new = panel_new · fee_per_juror`, `bond = fee_new`,\n * `total = fee_new + bond`). Returns `null` if the panel math overflows.\n */\nexport function appealCost(\n currentRound: number,\n feePerJuror: bigint,\n minJurySize: number = 3,\n): AppealCost | null {\n const newRound = currentRound + 1;\n const panel = panelSizeForRound(newRound, minJurySize);\n if (panel === null) return null;\n const fee = BigInt(panel) * feePerJuror;\n const bond = fee;\n return { newRound, panel, fee, bond, total: fee + bond };\n}\n\n/** Gate: a fresh appeal requires `currentRound < maxAppeals` (lib.rs:1660). */\nexport function canAppeal(currentRound: number, maxAppeals: number): boolean {\n return currentRound < maxAppeals;\n}\n\n/** AppealBond PDA seeds (state.rs:2286): `[\"bond\", dispute, round_idx_le4]`. */\nexport function appealBondSeeds(\n disputeBytes: Uint8Array,\n roundIdx: number,\n): Uint8Array[] {\n if (disputeBytes.length !== 32)\n throw new Error(\"InvalidDispute: expected 32 bytes\");\n if (!Number.isInteger(roundIdx) || roundIdx < 0 || roundIdx > 0xffffffff) {\n throw new Error(`InvalidRoundIdx: expected u32, got ${roundIdx}`);\n }\n return [SEED_APPEAL_BOND, disputeBytes, le4(roundIdx)];\n}\n\n// ---------------------------------------------------------------------------\n// PDA derivation (Kit lazy-imported)\n// ---------------------------------------------------------------------------\n\nexport async function findAppealBondPda(\n programAddress: Address,\n dispute: Address,\n roundIdx: number,\n): Promise<{ address: Address; bump: number }> {\n const disputeBytes = new Uint8Array(getAddressEncoder().encode(dispute));\n const [address, bump] = await getProgramDerivedAddress({\n programAddress,\n seeds: appealBondSeeds(disputeBytes, roundIdx),\n });\n return { address, bump };\n}\n\n// ---------------------------------------------------------------------------\n// Seam (ADR-0010) + orchestration\n// ---------------------------------------------------------------------------\n\n/** Accounts for `appeal`. */\nexport interface AppealAccounts {\n /** Any appellant (permissionless). Fee + bond payer. Signer. */\n appellant: Address;\n subaccord: Address;\n accordState: Address;\n dispute: Address;\n /** The just-resolved round (`current_round`) — read for `prior_result`. */\n round: Address;\n /** AppealBond PDA for the NEW round (`[\"bond\", dispute, current_round+1]`). */\n appealBond: Address;\n feeToken: Address;\n appellantTokenAccount: Address;\n feeVault: Address;\n}\n\n/** Accounts for `claim_appeal_refund`. */\nexport interface ClaimRefundAccounts {\n /** Any caller (permissionless crank). Signer. */\n caller: Address;\n subaccord: Address;\n dispute: Address;\n /** AppealBond PDA for `roundIdx` (the round the appeal opened). */\n appealBond: Address;\n feeToken: Address;\n /** Appellant's ATA — sweep destination (owner checked on-chain). */\n claimantTokenAccount: Address;\n feeVault: Address;\n}\n\n/**\n * Seam to the Codama-generated Kit client. Foundation wires the concrete\n * adapter; appeal.ts stays orchestration-only.\n */\nexport interface AccordAppealClient {\n buildAppeal(input: {\n programId: Address;\n accounts: AppealAccounts;\n newEvidenceHash: Uint8Array;\n }): Instruction;\n buildClaimAppealRefund(input: {\n programId: Address;\n accounts: ClaimRefundAccounts;\n roundIdx: number;\n }): Instruction;\n}\n\n/**\n * Validate a per-round evidence commitment is `[u8; 32]` (lib.rs appeal arg).\n * The `[0u8; 32]` sentinel (no new evidence this round) is a legal value, so\n * only the length is checked. Mirrors {@link assertValidEvidenceHash} in\n * dispute.ts but is duplicated here to keep appeal.ts self-contained.\n */\nexport function assertValidNewEvidenceHash(newEvidenceHash: Uint8Array): void {\n if (newEvidenceHash.length !== 32) {\n throw new Error(\n `InvalidNewEvidenceHash: expected 32 bytes, got ${newEvidenceHash.length}`,\n );\n }\n}\n\n/**\n * Build `appeal` (lib.rs:1643). Opens `current_round + 1` with a `2N+1` panel;\n * the appellant pays `fee_new + bond` (bond == fee_new). The AppealBond PDA is\n * keyed by the round BEING appealed (`current_round`, pre-increment) — derive it\n * via {@link findAppealBondPda} with `currentRound`.\n *\n * `newEvidenceHash` optionally introduces fresh evidence for the new round\n * (stored at `evidence_hashes[current_round + 1]`); pass the `[0u8; 32]`\n * sentinel (milestone accord-qp7c) to carry forward prior rounds' evidence\n * without adding any.\n */\nexport function appeal(\n client: AccordAppealClient,\n programId: Address,\n accounts: AppealAccounts,\n newEvidenceHash: Uint8Array,\n): Instruction {\n assertValidNewEvidenceHash(newEvidenceHash);\n return client.buildAppeal({ programId, accounts, newEvidenceHash });\n}\n\n/**\n * Build `claim_appeal_refund` (lib.rs:1772) for a specific appeal's bond.\n * `roundIdx` is the round that was appealed (`current_round` at appeal time —\n * the AppealBond PDA seed, pre-increment), selecting which bond to claim.\n * Idempotent\n * on-chain (the bond is zeroed on payout).\n */\nexport function claimAppealRefund(\n client: AccordAppealClient,\n programId: Address,\n accounts: ClaimRefundAccounts,\n roundIdx: number,\n): Instruction {\n if (!Number.isInteger(roundIdx) || roundIdx < 0 || roundIdx > 0xffffffff) {\n throw new Error(`InvalidRoundIdx: expected u32, got ${roundIdx}`);\n }\n return client.buildClaimAppealRefund({ programId, accounts, roundIdx });\n}\n","/**\n * Bound orchestration namespace — the eight Accord method groups, pre-bound to\n * a concrete {@link AccordAdapter} + the canonical program id.\n *\n * Each entry forwards to the pure orchestration function in `src/methods/*.ts`,\n * injecting the adapter as the `client` argument. The pure crypto helpers\n * (`buildMst`, `resolvePanel`, `commitHash`, `appealCost`, …) are NOT bound\n * here — they take no client, so import them directly from `@useaccord/sdk`.\n *\n * @see ADR-0010\n */\n\nimport type { Address, Instruction, TransactionSigner } from \"@solana/kit\";\n\nimport {\n createDispute as pureCreateDispute,\n getRuling as pureGetRuling,\n type CreateDisputeAccounts,\n type CreateDisputeArgs,\n} from \"./methods/dispute.js\";\nimport {\n createSubaccord as pureCreateSubaccord,\n executeSubaccordUpdate as pureExecuteSubaccordUpdate,\n executeUnpause as pureExecuteUnpause,\n getUpdateExecuteAfterSlot as pureGetUpdateExecuteAfterSlot,\n initializePause as pureInitializePause,\n pause as purePause,\n proposeSubaccordUpdate as pureProposeSubaccordUpdate,\n proposeUnpause as pureProposeUnpause,\n type CreateSubaccordArgs,\n type UpdatePayload,\n} from \"./methods/lifecycle.js\";\nimport type { MSTNode } from \"./methods/mst.js\";\nimport {\n stake as pureStake,\n requestWithdraw as pureRequestWithdraw,\n withdraw as pureWithdraw,\n reconcileStake as pureReconcileStake,\n withdrawFees as pureWithdrawFees,\n pruneJuror as purePruneJuror,\n type StakingAccounts,\n type WithdrawFeesAccounts,\n type PruneJurorAccounts,\n} from \"./methods/staking.js\";\nimport {\n settleRound as pureSettleRound,\n cancelDispute as pureCancelDispute,\n type CancelDisputeAccounts,\n type SettleRoundAccounts,\n} from \"./methods/settlement.js\";\nimport {\n awaitCommittedVrf as pureAwaitCommittedVrf,\n drawSeat as pureDrawSeat,\n requestVrf as pureRequestVrf,\n type SeatMembership,\n type RequestVrfExtras,\n type VrfDrawAccounts,\n} from \"./methods/vrf.js\";\nimport {\n commit as pureCommit,\n finalizeDispute as pureFinalizeDispute,\n finalizeRound as pureFinalizeRound,\n redraw as pureRedraw,\n reveal as pureReveal,\n type RedrawAccounts,\n type VoteArgs,\n type VotingAccounts,\n} from \"./methods/voting.js\";\nimport {\n appeal as pureAppeal,\n claimAppealRefund as pureClaimAppealRefund,\n type AppealAccounts,\n type ClaimRefundAccounts,\n} from \"./methods/appeal.js\";\n\nimport type { AccordAdapter } from \"./adapter.js\";\nimport { ACCORD_PROGRAM_ID } from \"./pda.js\";\n\n/** Bound method groups returned by `accord.methods`. */\nexport interface AccordMethods {\n // dispute (Arbitrable CPI API)\n createDispute(\n accounts: CreateDisputeAccounts,\n args: CreateDisputeArgs,\n ): Promise<{ instruction: Instruction; dispute: Address; bump: number }>;\n getRuling(dispute: Address): Promise<bigint | null>;\n\n // lifecycle\n createSubaccord(\n creator: Address,\n args: CreateSubaccordArgs,\n ): Promise<{ instruction: Instruction; subaccord: Address; bump: number }>;\n proposeSubaccordUpdate(\n authority: Address,\n subaccord: Address,\n nonce: bigint,\n payload: UpdatePayload,\n ): Promise<{ instruction: Instruction; pendingUpdate: Address }>;\n getUpdateExecuteAfterSlot(pendingUpdate: Address): Promise<bigint | null>;\n executeSubaccordUpdate(\n caller: Address,\n subaccord: Address,\n pendingUpdate: Address,\n ): Instruction;\n initializePause(\n authority: Address,\n ): Promise<{ instruction: Instruction; accordState: Address }>;\n pause(authority: Address, accordState: Address): Instruction;\n proposeUnpause(authority: Address, accordState: Address): Instruction;\n executeUnpause(caller: Address, accordState: Address): Instruction;\n\n // staking (ADR-0012: path-verified accumulator update)\n stake(\n accounts: StakingAccounts,\n amount: bigint,\n path: MSTNode[],\n attestation?: Address,\n ): Instruction;\n requestWithdraw(\n accounts: StakingAccounts,\n amount: bigint,\n path: MSTNode[],\n ): Instruction;\n withdraw(accounts: StakingAccounts): Instruction;\n reconcileStake(accounts: StakingAccounts, path: MSTNode[]): Instruction;\n withdrawFees(accounts: WithdrawFeesAccounts): Instruction;\n pruneJuror(\n accounts: PruneJurorAccounts,\n path: MSTNode[],\n attestation: Address,\n ): Instruction;\n\n // settlement (per-round crank + dispute cancellation)\n settleRound(\n accounts: SettleRoundAccounts,\n roundIdx: number,\n remainingAccounts: Address[],\n ): Instruction;\n cancelDispute(\n accounts: CancelDisputeAccounts,\n remainingAccounts: Address[],\n ): Instruction;\n\n // vrf + per-seat draw (ADR-0009/0012)\n requestVrf(accounts: VrfDrawAccounts, extras: RequestVrfExtras): Instruction;\n awaitCommittedVrf(\n dispute: Address,\n opts?: { pollIntervalMs?: number; timeoutMs?: number },\n ): Promise<Uint8Array>;\n drawSeat(\n accounts: VrfDrawAccounts,\n roundPda: Address,\n seat: number,\n membership: SeatMembership,\n ): Instruction;\n\n // voting\n commit(\n accounts: VotingAccounts,\n args: VoteArgs,\n ): Promise<{ instruction: Instruction; commitment: Uint8Array }>;\n reveal(accounts: VotingAccounts, args: VoteArgs): Instruction;\n finalizeRound(\n accounts: VotingAccounts,\n remainingAccounts?: Address[],\n ): Instruction;\n finalizeDispute(\n accounts: VotingAccounts,\n remainingAccounts: Address[],\n ): Instruction;\n redraw(\n accounts: RedrawAccounts,\n remainingAccounts?: Address[],\n ): Instruction;\n\n // appeal\n appeal(accounts: AppealAccounts, newEvidenceHash: Uint8Array): Instruction;\n claimAppealRefund(\n accounts: ClaimRefundAccounts,\n roundIdx: number,\n ): Instruction;\n}\n\n/**\n * Build the bound method namespace. `signer` is accepted so future per-call\n * signer overrides can route through the facade; today the adapter uses the\n * facade's wallet.\n */\nexport function createAccordMethods(\n adapter: AccordAdapter,\n programId: Address = ACCORD_PROGRAM_ID,\n // ponytail: reserved for per-call signer routing; the adapter currently uses\n // the facade wallet. Kept on the signature so the public type is stable.\n _signer?: TransactionSigner,\n): AccordMethods {\n return {\n // dispute\n createDispute: (accounts, args) =>\n pureCreateDispute(adapter, accounts, args, programId),\n getRuling: (dispute) => pureGetRuling(adapter, dispute),\n\n // lifecycle\n createSubaccord: (creator, args) =>\n pureCreateSubaccord(adapter, programId, creator, args),\n proposeSubaccordUpdate: (authority, subaccord, nonce, payload) =>\n pureProposeSubaccordUpdate(\n adapter,\n programId,\n authority,\n subaccord,\n nonce,\n payload,\n ),\n getUpdateExecuteAfterSlot: (pendingUpdate) =>\n pureGetUpdateExecuteAfterSlot(adapter, pendingUpdate),\n executeSubaccordUpdate: (caller, subaccord, pendingUpdate) =>\n pureExecuteSubaccordUpdate(\n adapter,\n programId,\n caller,\n subaccord,\n pendingUpdate,\n ),\n initializePause: (authority) =>\n pureInitializePause(adapter, programId, authority),\n pause: (authority, accordState) =>\n purePause(adapter, programId, authority, accordState),\n proposeUnpause: (authority, accordState) =>\n pureProposeUnpause(adapter, programId, authority, accordState),\n executeUnpause: (caller, accordState) =>\n pureExecuteUnpause(adapter, programId, caller, accordState),\n\n // staking\n stake: (accounts, amount, path, attestation) =>\n pureStake(adapter, programId, accounts, amount, path, attestation),\n requestWithdraw: (accounts, amount, path) =>\n pureRequestWithdraw(adapter, programId, accounts, amount, path),\n withdraw: (accounts) => pureWithdraw(adapter, programId, accounts),\n reconcileStake: (accounts, path) =>\n pureReconcileStake(adapter, programId, accounts, path),\n withdrawFees: (accounts) => pureWithdrawFees(adapter, programId, accounts),\n pruneJuror: (accounts, path, attestation) =>\n purePruneJuror(adapter, programId, accounts, path, attestation),\n\n // settlement\n settleRound: (accounts, roundIdx, remainingAccounts) =>\n pureSettleRound(\n adapter,\n programId,\n accounts,\n roundIdx,\n remainingAccounts,\n ),\n cancelDispute: (accounts, remainingAccounts) =>\n pureCancelDispute(adapter, programId, accounts, remainingAccounts),\n\n // vrf + per-seat draw\n requestVrf: (accounts, extras) =>\n pureRequestVrf(adapter, programId, accounts, extras),\n awaitCommittedVrf: (dispute, opts) =>\n pureAwaitCommittedVrf(adapter, dispute, opts),\n drawSeat: (accounts, roundPda, seat, membership) =>\n pureDrawSeat(adapter, programId, accounts, roundPda, seat, membership),\n\n // voting\n commit: (accounts, args) => pureCommit(adapter, programId, accounts, args),\n reveal: (accounts, args) => pureReveal(adapter, programId, accounts, args),\n finalizeRound: (accounts, remainingAccounts = []) =>\n pureFinalizeRound(adapter, programId, accounts, remainingAccounts),\n finalizeDispute: (accounts, remainingAccounts) =>\n pureFinalizeDispute(adapter, programId, accounts, remainingAccounts),\n redraw: (accounts, remainingAccounts = []) =>\n pureRedraw(adapter, programId, accounts, remainingAccounts),\n\n // appeal\n appeal: (accounts, newEvidenceHash) =>\n pureAppeal(adapter, programId, accounts, newEvidenceHash),\n claimAppealRefund: (accounts, roundIdx) =>\n pureClaimAppealRefund(adapter, programId, accounts, roundIdx),\n };\n}\n","/**\n * Wallet adapter: Keypair bytes | IWallet → Kit TransactionSigner.\n *\n * Kit's `KeyPairSigner` already implements `TransactionSigner`, so the keypair\n * path is a direct factory. External wallets (browser extensions, hardware)\n * implement `IWallet`; `signerFromWallet` adapts them into a Kit\n * `TransactionPartialSigner` (which satisfies `TransactionSigner`).\n */\n\nimport {\n createKeyPairSignerFromBytes,\n type Address,\n type KeyPairSigner,\n type SignatureDictionary,\n type Transaction,\n type TransactionPartialSigner,\n type TransactionSigner,\n} from \"@solana/kit\";\n\nexport type AccordSigner = TransactionSigner;\n\n/**\n * Minimal external-wallet interface. Compatible with @solana/wallet-adapter\n * wallets that expose `signMessage`, or any custom signing provider.\n */\nexport interface IWallet {\n readonly publicKey: Address;\n signMessage(message: Uint8Array): Promise<Uint8Array>;\n}\n\n/**\n * Create a Kit `KeyPairSigner` from raw 64-byte keypair bytes (e.g. a\n * Solana keypair JSON file). The resulting signer is a full `TransactionSigner`.\n */\nexport async function signerFromKeypairBytes(\n bytes: Uint8Array,\n): Promise<KeyPairSigner> {\n return createKeyPairSignerFromBytes(bytes);\n}\n\n/**\n * Adapt an external `IWallet` into a Kit `TransactionPartialSigner` for use\n * with the Accord facade. Signs each transaction's compiled message bytes\n * via the wallet's `signMessage` and returns a per-transaction signature map.\n */\nexport function signerFromWallet(wallet: IWallet): TransactionPartialSigner {\n return Object.freeze({\n address: wallet.publicKey,\n async signTransactions(\n transactions: readonly Transaction[],\n ): Promise<SignatureDictionary[]> {\n return Promise.all(\n transactions.map(async (tx) => {\n const signature = await wallet.signMessage(\n new Uint8Array(tx.messageBytes),\n );\n return { [wallet.publicKey]: signature } as SignatureDictionary;\n }),\n );\n },\n });\n}\n","/**\n * SPL Token + Associated Token Account (ATA) derivation.\n *\n * Single source of truth for the canonical ATA address used across fee and\n * collateral flows (ADR-0020). `@solana/kit` v7 does not export the SPL\n * program ids, so they live here. Hand-rolled (no `@solana/spl-token`\n * dependency) to keep the jest e2e suite free of the web3.js v1 `uuid` break —\n * matches the on-chain `create_associated_token_account` layout:\n * `ATA_PROGRAM ‖ [owner, TOKEN_PROGRAM, mint]`.\n *\n * @see ADR-0020\n */\nimport {\n getAddressEncoder,\n getProgramDerivedAddress,\n type Address,\n} from \"@solana/kit\";\n\n/** SPL Token program id (not exported by @solana/kit v7). */\nexport const TOKEN_PROGRAM_ADDRESS =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\" as Address;\n\n/** SPL Associated Token Account program id (not exported by @solana/kit v7). */\nexport const ASSOCIATED_TOKEN_PROGRAM_ADDRESS =\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\" as Address;\n\n/**\n * Derive the canonical Associated Token Account (ATA) address for `mint`\n * owned by `owner`. Argument order follows `@solana/spl-token`'s\n * `getAssociatedTokenAddress(mint, owner, …)`.\n */\nexport async function findAssociatedTokenAddress(\n mint: Address,\n owner: Address,\n): Promise<Address> {\n const enc = getAddressEncoder();\n const [ata] = await getProgramDerivedAddress({\n programAddress: ASSOCIATED_TOKEN_PROGRAM_ADDRESS,\n seeds: [enc.encode(owner), enc.encode(TOKEN_PROGRAM_ADDRESS), enc.encode(mint)],\n });\n return ata;\n}\n","/**\n * Typed `getProgramAccounts` wrappers — bulk reads that hide discriminator +\n * memcmp-offset construction from the caller. Each function returns fully\n * decoded `Account<T>[]`; no raw bytes, no memcmp offsets, no decoders leak.\n *\n * Filters match the 8-byte Anchor discriminator at offset 0 plus an optional\n * 32-byte `Address` field. Offsets below are fixed by the generated struct\n * layouts (see `./generated/accounts/*.ts`); the round-trip in `query.test.ts`\n * fails if they ever drift.\n *\n * Accepts a raw Kit `Rpc<GetProgramAccountsApi>` — the same `rpc` the facade\n * (`Accord.rpc`) or a bare `createSolanaRpc(...)` exposes.\n *\n * @see ADR-0010\n */\n\nimport {\n getAddressEncoder,\n getBase58Decoder,\n getBase64Encoder,\n type Account,\n type Address,\n type Base58EncodedBytes,\n type GetProgramAccountsApi,\n type GetProgramAccountsMemcmpFilter,\n type ReadonlyUint8Array,\n type Rpc,\n} from \"@solana/kit\";\n\nimport { ACCORD_PROGRAM_ID } from \"./pda.js\";\nimport {\n DISPUTE_DISCRIMINATOR,\n JUROR_STAKE_DISCRIMINATOR,\n SUBACCORD_DISCRIMINATOR,\n getDisputeDecoder,\n getJurorStakeDecoder,\n getSubaccordDecoder,\n type Dispute,\n type JurorStake,\n type Subaccord,\n} from \"./generated/accounts/index.js\";\n\n// --- internal filter builders ----------------------------------------------\n\nconst base58 = getBase58Decoder();\nconst addressEncoder = getAddressEncoder();\n\n/** Anchor account discriminator sits at offset 0 (8 bytes). */\nfunction discriminatorFilter(\n discriminator: ReadonlyUint8Array,\n): GetProgramAccountsMemcmpFilter {\n return {\n memcmp: {\n offset: 0n,\n // Kit's base58 decoder yields plain `string`; brand it for the filter.\n bytes: base58.decode(discriminator) as Base58EncodedBytes,\n encoding: \"base58\",\n },\n };\n}\n\n/** A 32-byte `Address` field at a fixed byte offset (base58-encoded). */\nfunction addressFilter(\n offset: bigint,\n address: Address,\n): GetProgramAccountsMemcmpFilter {\n return {\n memcmp: {\n offset,\n bytes: base58.decode(\n addressEncoder.encode(address),\n ) as Base58EncodedBytes,\n encoding: \"base58\",\n },\n };\n}\n\n// --- byte offsets (from the generated struct layouts) ----------------------\n// Field order per `./generated/accounts/*.ts` encoders:\n// JurorStake: disc(8) | subaccord(32) | juror(32) | ...\n// Dispute: disc(8) | subaccord(32) | filer(32) | ...\n// Discriminator = 8 bytes; the first Address field follows at 8, the next at 40.\nconst OFFSET_FIRST_ADDRESS = 8n;\nconst OFFSET_SECOND_ADDRESS = 40n;\n\n// --- core GPA + decode ------------------------------------------------------\n\nasync function fetchDecodedAccounts<T extends object>(\n rpc: Rpc<GetProgramAccountsApi>,\n filters: GetProgramAccountsMemcmpFilter[],\n decode: (bytes: ReadonlyUint8Array | Uint8Array) => T,\n programAddress: Address = ACCORD_PROGRAM_ID,\n): Promise<Account<T>[]> {\n const accountInfos = await rpc\n .getProgramAccounts(programAddress, { encoding: \"base64\", filters })\n .send();\n const base64 = getBase64Encoder();\n return accountInfos.map((info) => {\n const [data] = info.account.data;\n return {\n ...info.account,\n address: info.pubkey,\n programAddress,\n data: decode(base64.encode(data)),\n } as Account<T>;\n });\n}\n\n// --- public typed wrappers --------------------------------------------------\n\n/** All Subaccords on the Accord program (discriminator-only filter). */\nexport function findAllSubaccords(\n rpc: Rpc<GetProgramAccountsApi>,\n): Promise<Account<Subaccord>[]> {\n return fetchDecodedAccounts(\n rpc,\n [discriminatorFilter(SUBACCORD_DISCRIMINATOR)],\n (b) => getSubaccordDecoder().decode(b),\n );\n}\n\n/** Every JurorStake on the Accord program (global browse / aggregation). */\nexport function findAllJurorStakes(\n rpc: Rpc<GetProgramAccountsApi>,\n): Promise<Account<JurorStake>[]> {\n return fetchDecodedAccounts(\n rpc,\n [discriminatorFilter(JUROR_STAKE_DISCRIMINATOR)],\n (b) => getJurorStakeDecoder().decode(b),\n );\n}\n\n/** Every JurorStake for a Subaccord (draw pool / accumulator rebuild). */\nexport function findJurorStakesBySubaccord(\n rpc: Rpc<GetProgramAccountsApi>,\n subaccord: Address,\n): Promise<Account<JurorStake>[]> {\n return fetchDecodedAccounts(\n rpc,\n [\n discriminatorFilter(JUROR_STAKE_DISCRIMINATOR),\n addressFilter(OFFSET_FIRST_ADDRESS, subaccord),\n ],\n (b) => getJurorStakeDecoder().decode(b),\n );\n}\n\n/** Every JurorStake owned by a juror across all Subaccords. */\nexport function findJurorStakesByJuror(\n rpc: Rpc<GetProgramAccountsApi>,\n juror: Address,\n): Promise<Account<JurorStake>[]> {\n return fetchDecodedAccounts(\n rpc,\n [\n discriminatorFilter(JUROR_STAKE_DISCRIMINATOR),\n addressFilter(OFFSET_SECOND_ADDRESS, juror),\n ],\n (b) => getJurorStakeDecoder().decode(b),\n );\n}\n\n/** Every Dispute filed under a Subaccord. */\nexport function findDisputesBySubaccord(\n rpc: Rpc<GetProgramAccountsApi>,\n subaccord: Address,\n): Promise<Account<Dispute>[]> {\n return fetchDecodedAccounts(\n rpc,\n [\n discriminatorFilter(DISPUTE_DISCRIMINATOR),\n addressFilter(OFFSET_FIRST_ADDRESS, subaccord),\n ],\n (b) => getDisputeDecoder().decode(b),\n );\n}\n\n/** Every Dispute filed by a given filer. */\nexport function findDisputesByFiler(\n rpc: Rpc<GetProgramAccountsApi>,\n filer: Address,\n): Promise<Account<Dispute>[]> {\n return fetchDecodedAccounts(\n rpc,\n [\n discriminatorFilter(DISPUTE_DISCRIMINATOR),\n addressFilter(OFFSET_SECOND_ADDRESS, filer),\n ],\n (b) => getDisputeDecoder().decode(b),\n );\n}\n","/**\n * Typed mapping of AccordError codes.\n *\n * Anchor assigns sequential codes starting at 6000 (the `ERROR_CODE_OFFSET`).\n * The order matches the `#[error_code]` enum declaration in\n * `programs/accord/src/errors.rs`.\n */\n\nexport const ACCORD_ERROR_CODE_OFFSET = 6000;\n\nexport type AccordErrorCode = {\n readonly code: number;\n readonly name: string;\n readonly message: string;\n};\n\nfunction err(code: number, name: string, message: string): AccordErrorCode {\n return { code, name, message } as const;\n}\n\nconst BASE = ACCORD_ERROR_CODE_OFFSET;\n\nexport const AccordErrors = {\n // --- authority / timelock (ADR-0005) ---\n Unauthorized: err(\n BASE + 0,\n \"Unauthorized\",\n \"Signer is not the Subaccord authority.\",\n ),\n ImmutableSubaccord: err(\n BASE + 1,\n \"ImmutableSubaccord\",\n \"Subaccord is immutable (authority == default).\",\n ),\n TimelockNotElapsed: err(\n BASE + 2,\n \"TimelockNotElapsed\",\n \"Timelock has not elapsed yet.\",\n ),\n NoPendingUpdate: err(\n BASE + 3,\n \"NoPendingUpdate\",\n \"No pending update to execute.\",\n ),\n\n // --- circuit breaker (ADR-0007) ---\n NotPauseAuthority: err(\n BASE + 4,\n \"NotPauseAuthority\",\n \"Signer is not the pause authority.\",\n ),\n AlreadyPaused: err(BASE + 5, \"AlreadyPaused\", \"Program is already paused.\"),\n NotPaused: err(BASE + 6, \"NotPaused\", \"Program is not paused.\"),\n NoPendingUnpause: err(\n BASE + 7,\n \"NoPendingUnpause\",\n \"No pending unpause to execute.\",\n ),\n UnpauseTimelockNotElapsed: err(\n BASE + 8,\n \"UnpauseTimelockNotElapsed\",\n \"Unpause timelock has not elapsed yet.\",\n ),\n ProgramPaused: err(\n BASE + 9,\n \"ProgramPaused\",\n \"Program is paused; this instruction is halted.\",\n ),\n\n // --- staking ---\n InsufficientStake: err(\n BASE + 10,\n \"InsufficientStake\",\n \"Staked amount is below the Subaccord minimum.\",\n ),\n StakeLocked: err(\n BASE + 11,\n \"StakeLocked\",\n \"Cannot unstake while active_draws > 0 (stake is frozen until drawn disputes settle).\",\n ),\n InvalidAmount: err(\n BASE + 12,\n \"InvalidAmount\",\n \"Amount must be greater than zero.\",\n ),\n InsufficientBalance: err(\n BASE + 13,\n \"InsufficientBalance\",\n \"Withdrawal exceeds the Juror's staked balance.\",\n ),\n\n // --- dispute intake ---\n InsufficientJurors: err(\n BASE + 14,\n \"InsufficientJurors\",\n \"Subaccord has fewer active distinct stakers than the required panel size.\",\n ),\n InvalidOptions: err(\n BASE + 15,\n \"InvalidOptions\",\n \"Dispute options are invalid (need 2..=MAX_OPTIONS).\",\n ),\n InvalidState: err(\n BASE + 16,\n \"InvalidState\",\n \"Dispute is not in the required state for this instruction.\",\n ),\n FeeMismatch: err(\n BASE + 17,\n \"FeeMismatch\",\n \"Tendered fee does not match the required round-1 dispute fee (min_jury_size * fee_per_juror).\",\n ),\n\n // --- accumulator (ADR-0012) ---\n InvalidMerklePath: err(\n BASE + 18,\n \"InvalidMerklePath\",\n \"Accumulator Merkle path does not authenticate against the stored root.\",\n ),\n TreeFull: err(\n BASE + 19,\n \"TreeFull\",\n \"Accumulator tree is full (no free leaf within the configured depth).\",\n ),\n\n // --- draw ---\n DuplicateJuror: err(\n BASE + 20,\n \"DuplicateJuror\",\n \"Draw selected a duplicate Juror.\",\n ),\n InvalidMembershipProof: err(\n BASE + 21,\n \"InvalidMembershipProof\",\n \"Juror Merkle membership/weight proof is invalid.\",\n ),\n InvalidPanelSize: err(\n BASE + 22,\n \"InvalidPanelSize\",\n \"Number of juror memberships does not match the required panel size.\",\n ),\n InflatedStake: err(\n BASE + 23,\n \"InflatedStake\",\n \"Drawn juror's live stake is below the accumulator leaf's claim (inflation guard, ADR-0012).\",\n ),\n SortitionMismatch: err(\n BASE + 24,\n \"SortitionMismatch\",\n \"Submitted membership does not match the VRF-derived sortition selection (ADR-0009).\",\n ),\n VrfAlreadyCommitted: err(\n BASE + 25,\n \"VrfAlreadyCommitted\",\n \"VRF result already committed for this dispute.\",\n ),\n VrfNotCommitted: err(\n BASE + 26,\n \"VrfNotCommitted\",\n \"No VRF result committed for this dispute; the root is not yet frozen.\",\n ),\n\n // --- voting ---\n CommitAlreadyExists: err(\n BASE + 27,\n \"CommitAlreadyExists\",\n \"Juror has already committed.\",\n ),\n CommitMissing: err(\n BASE + 28,\n \"CommitMissing\",\n \"No commit to reveal for this Juror.\",\n ),\n RevealMismatch: err(\n BASE + 29,\n \"RevealMismatch\",\n \"Reveal does not match the committed hash.\",\n ),\n CommitWindowClosed: err(\n BASE + 30,\n \"CommitWindowClosed\",\n \"Commit window is closed.\",\n ),\n RevealWindowClosed: err(\n BASE + 31,\n \"RevealWindowClosed\",\n \"Reveal window is closed.\",\n ),\n NotDrawnJuror: err(\n BASE + 32,\n \"NotDrawnJuror\",\n \"Signer is not a drawn Juror for this round.\",\n ),\n InvalidVote: err(\n BASE + 33,\n \"InvalidVote\",\n \"Revealed vote index is out of range.\",\n ),\n AlreadyRevealed: err(\n BASE + 34,\n \"AlreadyRevealed\",\n \"Juror has already revealed.\",\n ),\n\n // --- finalization ---\n AppealWindowOpen: err(\n BASE + 35,\n \"AppealWindowOpen\",\n \"Appeal window has not elapsed yet.\",\n ),\n\n // --- appeals (ADR-0004) ---\n MaxAppealsReached: err(\n BASE + 36,\n \"MaxAppealsReached\",\n \"Maximum appeals reached for this dispute.\",\n ),\n MaxAppealsLimitExceeded: err(\n BASE + 37,\n \"MaxAppealsLimitExceeded\",\n \"Subaccord max_appeals exceeds the program ceiling.\",\n ),\n AppealWindowClosed: err(\n BASE + 38,\n \"AppealWindowClosed\",\n \"Appeal window has closed; the dispute can only be finalized.\",\n ),\n\n // --- finalization ---\n RoundNotFinalizable: err(\n BASE + 39,\n \"RoundNotFinalizable\",\n \"Round cannot be finalized yet (window not elapsed).\",\n ),\n DisputeNotFinal: err(\n BASE + 40,\n \"DisputeNotFinal\",\n \"Dispute is not in a finalizable state.\",\n ),\n\n // --- arithmetic ---\n ArithmeticOverflow: err(\n BASE + 41,\n \"ArithmeticOverflow\",\n \"Arithmetic overflow.\",\n ),\n\n // --- multi-round settlement (CONCEPT-REVIEW Ugly 5 / accord-r6ti) ---\n RoundAlreadySettled: err(\n BASE + 42,\n \"RoundAlreadySettled\",\n \"Round has already been settled.\",\n ),\n RoundNotSettlable: err(\n BASE + 43,\n \"RoundNotSettlable\",\n \"Round index out of range for settlement (must be < current_round).\",\n ),\n\n // --- cancel / Failed state (Ugly 4) ---\n DisputeFailed: err(\n BASE + 44,\n \"DisputeFailed\",\n \"Dispute is in terminal Failed state.\",\n ),\n CancelTooEarly: err(\n BASE + 45,\n \"CancelTooEarly\",\n \"Dispute has not exceeded its stage timeout; cancel_dispute is not yet available.\",\n ),\n\n // --- draw (bean accord-tzo0) ---\n MaxRetriesExceeded: err(\n BASE + 46,\n \"MaxRetriesExceeded\",\n \"Sortition retries exceeded the on-chain bound; the pool may be too concentrated.\",\n ),\n} as const;\n\nexport type AccordErrorName = keyof typeof AccordErrors;\n","/**\n * stakeFlow.ts — MST accumulator proof orchestration for stake / unstake.\n *\n * This is the domain logic the `/juror/stake` route executes after fetching\n * a Subaccord + all its JurorStake accounts:\n *\n * 1. Sort JurorStake leaves by `treeIndex` (canonical append-only order).\n * 2. Build `LeafClaim[]` at each juror's canonical position.\n * 3. `buildAccumulator(leafClaims, depth)` — rebuild the canonical tree.\n * 4. Verify `accumulator.rootHash === subaccord.rootHash` — a mismatch\n * means the local data is stale (race with a concurrent stake/unstake).\n * 5. Determine the juror's leaf index:\n * - Existing staker → their assigned `treeIndex`.\n * - New staker → `subaccord.nextIndex` (the next free leaf).\n * 6. `proofFor(accumulator, index)` — the Merkle path passed to `stake` /\n * `requestWithdraw` / `reconcileStake`.\n *\n * Pure — no chain access. Takes already-fetched typed data so it's testable\n * without a validator.\n *\n * Sources of truth:\n * - on-chain stake/requestWithdraw: programs/accord/src/lib.rs\n * - accumulator builder: ./mst.ts (ADR-0012)\n * - e2e flow reference: tests/src/staking.spec.ts (TreeTracker)\n */\n\nimport { getAddressEncoder, type Address } from \"@solana/kit\";\nimport {\n buildAccumulator,\n proofFor,\n type LeafClaim,\n type MerkleAccumulator,\n type MSTNode,\n} from \"./mst.js\";\n\n/** The Subaccord fields the proof builder needs. */\nexport interface SubaccordAccumulatorView {\n /** On-chain accumulator root (state.rs `root_hash`). */\n rootHash: Uint8Array;\n /** Next free leaf index (state.rs `next_index`). */\n nextIndex: number;\n /** Fixed tree depth (state.rs `depth`). */\n depth: number;\n}\n\n/** A JurorStake leaf needed for the accumulator. */\nexport interface JurorStakeLeaf {\n juror: Address;\n /** Canonical collateral (`staked`, not `staked + stakeDelta`). */\n staked: bigint;\n /** Leaf position assigned at first stake (state.rs `tree_index`). */\n treeIndex: number;\n}\n\n/** Result of proof computation for stake / unstake. */\nexport interface StakeProofResult {\n /** The Merkle path to pass to `stake` / `requestWithdraw` / `reconcileStake`. */\n path: MSTNode[];\n /** The leaf index the proof authenticates. */\n index: number;\n /** The root-verified accumulator (for audit / sortition prefix). */\n accumulator: MerkleAccumulator;\n /** `true` if this juror has never staked (proof for `nextIndex`). */\n isNewStaker: boolean;\n}\n\n/** Address → 32 raw bytes (the leaf's `juror` field). */\nfunction addrBytes(addr: Address): Uint8Array {\n return new Uint8Array(getAddressEncoder().encode(addr));\n}\n\n/**\n * Build the MST accumulator proof for a stake or unstake operation.\n *\n * @param subaccord The on-chain accumulator state (rootHash, nextIndex, depth).\n * @param jurorStakes All JurorStake accounts for this Subaccord (any order).\n * @param juror The staking juror's address.\n * @throws if the rebuilt root does not match the on-chain root (stale data).\n */\nexport async function prepareStakeProof(\n subaccord: SubaccordAccumulatorView,\n jurorStakes: readonly JurorStakeLeaf[],\n juror: Address,\n): Promise<StakeProofResult> {\n // 1) Sort by treeIndex (canonical leaf order in the append-only tree).\n const sorted = [...jurorStakes].sort((a, b) => a.treeIndex - b.treeIndex);\n\n // 2) Place each leaf at its canonical position; fill gaps with zero leaves.\n const size = 2 ** subaccord.depth;\n const leaves: LeafClaim[] = new Array(size);\n for (let i = 0; i < size; i++) {\n leaves[i] = { juror: new Uint8Array(32), stake: 0n };\n }\n for (const js of sorted) {\n if (js.treeIndex < 0 || js.treeIndex >= size) {\n throw new Error(\n `InvalidTreeIndex: ${js.treeIndex} out of range for depth ${subaccord.depth}`,\n );\n }\n leaves[js.treeIndex] = {\n juror: addrBytes(js.juror),\n stake: js.staked,\n };\n }\n\n // 3) Build the accumulator and verify the root matches on-chain state.\n const accumulator = await buildAccumulator(leaves, subaccord.depth);\n if (!bytesEqual(accumulator.rootHash, subaccord.rootHash)) {\n throw new Error(\n \"AccumulatorRootMismatch: local rebuild does not match on-chain root. \" +\n \"Data may be stale — retry with fresh JurorStake accounts.\",\n );\n }\n\n // 4) Determine the juror's leaf index.\n const existing = sorted.find((js) => js.juror === juror);\n const isNewStaker = !existing;\n const index = isNewStaker ? subaccord.nextIndex : existing.treeIndex;\n\n if (index < 0 || index >= size) {\n throw new Error(\n `TreeFull: index ${index} out of range for depth ${subaccord.depth} ` +\n `(pool at capacity — all ${size} leaves taken)`,\n );\n }\n\n // 5) Compute the Merkle proof for that index.\n const path = await proofFor(accumulator, index);\n\n return { path, index, accumulator, isNewStaker };\n}\n\n/** Constant-time byte comparison. */\nfunction bytesEqual(a: Uint8Array, b: Uint8Array): boolean {\n if (a.length !== b.length) return false;\n let diff = 0;\n for (let i = 0; i < a.length; i++) diff |= a[i]! ^ b[i]!;\n return diff === 0;\n}\n","/**\n * disputePhase.ts — dispute phase label + countdown for the juror dashboard.\n *\n * The juror dashboard (`/juror`) shows each active draw's current phase\n * (Review / Commit / Reveal) with a countdown timer. The phase is derived\n * from the Dispute's `state` enum + the Round's window deadlines\n * (`reviewEnd`, `commitEnd`, `revealEnd`).\n *\n * Pure — no chain access. Takes already-fetched typed data.\n */\n\nimport { DisputeState } from \"../generated/types/disputeState.js\";\n\n/** The Round window deadlines the phase computation needs. */\nexport interface RoundPhaseWindows {\n reviewEnd: bigint;\n commitEnd: bigint;\n revealEnd: bigint;\n}\n\n/** Human-readable phase + remaining seconds (null = no active countdown). */\nexport interface PhaseInfo {\n phase: string;\n /** Seconds remaining in the current window. `null` when past the deadline\n * or the state has no countdown. Negative = overdue (crank pending). */\n countdownSecs: bigint | null;\n}\n\n/**\n * Derive the juror-facing phase label + countdown for a dispute.\n *\n * @param state The Dispute's `state` field.\n * @param now Current Unix timestamp (seconds).\n * @param round The current Round's window deadlines (required for\n * Review/Commit/Reveal; pass `undefined` if not yet drawn).\n */\nexport function disputePhase(\n state: DisputeState,\n now: bigint,\n round?: RoundPhaseWindows,\n): PhaseInfo {\n switch (state) {\n case DisputeState.Created:\n case DisputeState.Drawn:\n return { phase: \"Pending draw\", countdownSecs: null };\n\n case DisputeState.Review:\n return {\n phase: \"Review\",\n countdownSecs: round ? round.reviewEnd - now : null,\n };\n\n case DisputeState.Commit:\n return {\n phase: \"Commit\",\n countdownSecs: round ? round.commitEnd - now : null,\n };\n\n case DisputeState.Reveal:\n return {\n phase: \"Reveal\",\n countdownSecs: round ? round.revealEnd - now : null,\n };\n\n case DisputeState.RoundResolved:\n return { phase: \"Awaiting appeal\", countdownSecs: null };\n\n case DisputeState.RedrawEligible:\n return { phase: \"Redraw eligible\", countdownSecs: null };\n\n case DisputeState.Final:\n return { phase: \"Finalized\", countdownSecs: null };\n\n case DisputeState.Closed:\n return { phase: \"Closed\", countdownSecs: null };\n\n case DisputeState.Failed:\n return { phase: \"Failed\", countdownSecs: null };\n\n default:\n return { phase: \"Unknown\", countdownSecs: null };\n }\n}\n","/**\n * Typed `getProgramAccounts` query wrappers.\n *\n * Each function encapsulates the discriminator + memcmp construction so the\n * caller never touches raw bytes. Returns typed `Account<T>[]` with the\n * account address preserved (needed for deep links, PDA navigation, etc.).\n *\n * @see ADR-0010\n */\n\nimport {\n type Account,\n type Address,\n type Base64EncodedBytes,\n type Commitment,\n type GetProgramAccountsApi,\n parseBase64RpcAccount,\n type ReadonlyUint8Array,\n type Rpc,\n} from \"@solana/kit\";\n\nimport {\n DISPUTE_DISCRIMINATOR,\n decodeDispute,\n type Dispute,\n} from \"./generated/accounts/dispute.js\";\nimport {\n PENDING_UPDATE_DISCRIMINATOR,\n decodePendingUpdate,\n type PendingUpdate,\n} from \"./generated/accounts/pendingUpdate.js\";\nimport { ACCORD_PROGRAM_ID } from \"./pda.js\";\n\nexport type QueryConfig = {\n commitment?: Commitment;\n abortSignal?: AbortSignal;\n};\n\nfunction discriminatorToBase64(d: ReadonlyUint8Array): Base64EncodedBytes {\n // ponytail: btoa for 8-byte discriminator — no perf concern\n return btoa(String.fromCharCode(...d)) as Base64EncodedBytes;\n}\n\n/**\n * Fetch every Dispute account on-chain, decoded and typed.\n * Filters by the 8-byte account discriminator at offset 0.\n */\nexport async function findAllDisputes(\n rpc: Rpc<GetProgramAccountsApi>,\n config?: QueryConfig,\n): Promise<Account<Dispute>[]> {\n const results = await rpc\n .getProgramAccounts(ACCORD_PROGRAM_ID, {\n encoding: \"base64\",\n filters: [\n {\n memcmp: {\n offset: 0n,\n bytes: discriminatorToBase64(DISPUTE_DISCRIMINATOR),\n encoding: \"base64\",\n },\n },\n ],\n commitment: config?.commitment,\n })\n .send();\n\n return results.map(({ pubkey, account }) =>\n decodeDispute(parseBase64RpcAccount(pubkey as Address, account)),\n );\n}\n\n/**\n * Fetch every PendingUpdate account on-chain, decoded and typed.\n * Filters by the 8-byte account discriminator at offset 0.\n */\nexport async function findAllPendingUpdates(\n rpc: Rpc<GetProgramAccountsApi>,\n config?: QueryConfig,\n): Promise<Account<PendingUpdate>[]> {\n const results = await rpc\n .getProgramAccounts(ACCORD_PROGRAM_ID, {\n encoding: \"base64\",\n filters: [\n {\n memcmp: {\n offset: 0n,\n bytes: discriminatorToBase64(PENDING_UPDATE_DISCRIMINATOR),\n encoding: \"base64\",\n },\n },\n ],\n commitment: config?.commitment,\n })\n .send();\n\n return results.map(({ pubkey, account }) =>\n decodePendingUpdate(parseBase64RpcAccount(pubkey as Address, account)),\n );\n}\n","/**\n * domain.ts — domain document convention (ADR-0027, milestone accord-lgof).\n *\n * Canon defines a Subaccord's 32-byte `domain_ref` / a CanonList's\n * `rules_hash` as `sha256(rules_doc)` where `rules_doc` is the raw file bytes\n * (YAML frontmatter included). This module is the convention's single home:\n * hashing, frontmatter parsing (zero deps), verification against the on-chain\n * field, and the daemon fetch pipeline (`GET /domains/{hash}` → verify →\n * parse). The daemon itself is a format-blind CAS — it never parses; this\n * module does.\n *\n * Recommended format: markdown with optional YAML frontmatter carrying\n * `title` / `description`; the body is the rules. There is no `version`\n * key: the doc is content-addressed and immutable, so the hash IS the\n * version (ADR-0027 amendment). Any other bytes are valid opaque content —\n * hash-verified, `body`-only.\n */\nimport { sha256 } from \"@noble/hashes/sha256\";\nimport { bytesToHex } from \"@noble/hashes/utils\";\n\n/** Parsed domain document: optional frontmatter metadata + the body. */\nexport interface ParsedDomainDoc {\n title?: string;\n description?: string;\n body: string;\n}\n\n/** Result of fetching a domain doc from the daemon: verified bytes + parse. */\nexport interface FetchedDomainDoc {\n bytes: Uint8Array;\n contentType: string;\n doc: ParsedDomainDoc;\n}\n\n/** Options for {@link putDomainDoc} (ADR-0027 amendment — chain-anchored PUT). */\nexport interface PutDomainDocOptions {\n /**\n * Anchor Subaccord address (`?subaccord=`): the daemon resolves it\n * on-chain and requires its `domain_ref` to equal the doc hash\n * (create-first — publish only after the create-tx confirms).\n */\n subaccord: string;\n /** Content-Type for the PUT; defaults to `text/markdown`. */\n contentType?: string;\n}\n\n/** Success result of {@link putDomainDoc}: 201 created / 200 idempotent no-op. */\nexport interface PutDomainDocResult {\n status: 200 | 201;\n /** The doc's canonical 64-hex sha256 — the on-chain `domain_ref` value. */\n hash: string;\n}\n\n/**\n * Typed failure of {@link putDomainDoc}: the daemon rejected the publish.\n * `status` mirrors the daemon's HTTP status (400 hash/anchor mismatch /\n * missing param, 404 anchor not found, 409 collision alarm, 413 over cap,\n * 5xx transport); `body` carries the raw response body for the message.\n */\nexport class DomainPublishError extends Error {\n readonly status: number;\n readonly body: string;\n\n constructor(status: number, body: string) {\n super(`domain daemon rejected publish with ${status}: ${body}`);\n this.name = \"DomainPublishError\";\n this.status = status;\n this.body = body;\n }\n}\n\nconst FRONTMATTER_DELIM = \"---\";\nconst HEX64 = /^[0-9a-fA-F]{64}$/;\n\n/** `sha256(bytes)` as lowercase 64-hex — the canonical `domain_ref` string form. */\nexport function hashDomainDoc(bytes: Uint8Array): string {\n return bytesToHex(sha256(bytes));\n}\n\n/**\n * Verify raw doc bytes against an on-chain `domain_ref` — either the 32 raw\n * bytes or its 64-hex string form. False on any mismatch or wrong ref shape.\n */\nexport function verifyDomainDoc(\n bytes: Uint8Array,\n domainRef: Uint8Array | string,\n): boolean {\n const digest = sha256(bytes);\n if (typeof domainRef === \"string\") {\n return (\n HEX64.test(domainRef) && domainRef.toLowerCase() === bytesToHex(digest)\n );\n }\n if (domainRef.length !== 32) return false;\n return domainRef.every((b, i) => b === digest[i]);\n}\n\n/**\n * Parse a domain doc: optional `---`-delimited frontmatter with `title` /\n * `description` (single-line `key: value`, surrounding quotes stripped),\n * everything after the closing delimiter is `body`. Absent or unterminated\n * frontmatter ⇒ the whole text is `body`. Unknown keys (including any\n * `version`) are ignored.\n */\nexport function parseDomainDoc(bytes: Uint8Array): ParsedDomainDoc {\n const text = new TextDecoder().decode(bytes);\n const split = splitFrontmatter(text);\n if (!split) return { body: text };\n const meta = parseFrontmatter(split.frontmatter);\n return { ...meta, body: split.body };\n}\n\n/**\n * Fetch a domain doc from the evidence daemon (`GET {daemonUrl}/domains/{hash}`),\n * verify `sha256(bytes) === hash`, and parse it. Throws on non-200 responses\n * and on verification failure (tampered or mismatched bytes).\n */\nexport async function fetchDomainDoc(\n daemonUrl: string,\n hash: string,\n): Promise<FetchedDomainDoc> {\n const res = await fetch(`${daemonUrl.replace(/\\/+$/, \"\")}/domains/${hash}`);\n if (!res.ok) {\n throw new Error(`domain daemon returned ${res.status} for ${hash}`);\n }\n const bytes = new Uint8Array(await res.arrayBuffer());\n if (!verifyDomainDoc(bytes, hash)) {\n throw new Error(`domain doc ${hash} failed sha256 verification`);\n }\n return {\n bytes,\n contentType: res.headers.get(\"content-type\") ?? \"text/markdown\",\n doc: parseDomainDoc(bytes),\n };\n}\n\n/**\n * Publish a domain doc to the evidence daemon's public CAS\n * (`PUT {daemonUrl}/domains/{sha256(bytes)}?subaccord=<addr>`) — the single\n * publish implementation; the CLI and both dApps consume this (ADR-0027\n * amendment, bean accord-uecf). Create-first: call only after the create-tx\n * with `domain_ref = hash` has confirmed — the daemon anchor-verifies.\n * Resolves `{ status, hash }` on 201 (created) / 200 (identical bytes already\n * stored — idempotent no-op); throws {@link DomainPublishError} on any other\n * status, carrying `status` + raw body.\n */\nexport async function putDomainDoc(\n daemonUrl: string,\n bytes: Uint8Array,\n options: PutDomainDocOptions,\n): Promise<PutDomainDocResult> {\n const hash = hashDomainDoc(bytes);\n const res = await fetch(\n `${daemonUrl.replace(/\\/+$/, \"\")}/domains/${hash}?subaccord=${encodeURIComponent(options.subaccord)}`,\n {\n method: \"PUT\",\n headers: { \"content-type\": options.contentType ?? \"text/markdown\" },\n // ponytail: cast — base lib.dom's BodyInit predates generic\n // Uint8Array<ArrayBufferLike>; no copy needed for a valid body.\n body: bytes as unknown as BodyInit,\n },\n );\n if (res.status === 200 || res.status === 201) {\n return { status: res.status, hash };\n }\n throw new DomainPublishError(res.status, await res.text());\n}\n\n/** Split `---\\n…\\n---\\n<body>`; null when there is no (well-formed) frontmatter. */\nfunction splitFrontmatter(\n text: string,\n): { frontmatter: string; body: string } | null {\n if (!text.startsWith(FRONTMATTER_DELIM)) return null;\n let rest = text.slice(FRONTMATTER_DELIM.length);\n if (rest.startsWith(\"\\r\\n\")) rest = rest.slice(2);\n else if (rest.startsWith(\"\\n\")) rest = rest.slice(1);\n else return null; // `---` is body content (e.g. a thematic break), not a delimiter\n const lines = rest.split(\"\\n\");\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i]!;\n const bare = line.endsWith(\"\\r\") ? line.slice(0, -1) : line;\n if (bare === FRONTMATTER_DELIM) {\n return {\n frontmatter: lines.slice(0, i).join(\"\\n\"),\n body: lines.slice(i + 1).join(\"\\n\"),\n };\n }\n }\n return null; // unterminated frontmatter — treat whole text as body\n}\n\n/** Line-based `key: value` scan of the frontmatter block (title/description only). */\nfunction parseFrontmatter(text: string): Partial<ParsedDomainDoc> {\n const out: Partial<ParsedDomainDoc> = {};\n for (const line of text.split(\"\\n\")) {\n const bare = line.endsWith(\"\\r\") ? line.slice(0, -1) : line;\n const idx = bare.indexOf(\":\");\n if (idx <= 0) continue;\n const key = bare.slice(0, idx).trim();\n const value = unquote(bare.slice(idx + 1).trim());\n if (!value) continue;\n if (key === \"title\") out.title = value;\n else if (key === \"description\") out.description = value;\n }\n return out;\n}\n\nfunction unquote(s: string): string {\n if (\n s.length >= 2 &&\n ((s[0] === '\"' && s.endsWith('\"')) || (s[0] === \"'\" && s.endsWith(\"'\")))\n ) {\n return s.slice(1, -1);\n }\n return s;\n}\n","/**\n * @useaccord/sdk — TypeScript SDK for the VeriDAO Accord program on Solana.\n *\n * Public surface:\n * - `Accord` — facade class (primary entry point)\n * - `wallet` — signer adapter (Keypair | IWallet → Kit TransactionSigner)\n * - `pda` — canonical PDA derivations (all 8 accounts)\n * - `constants` — v1 protocol defaults and bounds\n * - `errors` — typed AccordError code map\n * - `types` — domain enums and structs (re-exported from generated)\n * - `generated` — raw Codama output (codecs, Ix builders, account fetchers)\n * - `methods/*` — per-instruction facades (dispute, voting, snapshot,\n * lifecycle, vrf, staking, appeal) over the Kit client\n *\n * @see ADR-0010\n */\n\nexport { Accord, type AccordClient, type AccordConfig } from \"./accord\";\nexport { createAccordAdapter, type AccordAdapter } from \"./adapter\";\nexport { createAccordMethods, type AccordMethods } from \"./methods\";\nexport {\n type AccordSigner,\n type IWallet,\n signerFromKeypairBytes,\n signerFromWallet,\n} from \"./wallet\";\nexport {\n ACCORD_PROGRAM_ID,\n findAppealBondPda,\n findDisputePda,\n findJurorStakePda,\n findAccordStatePda,\n findPendingUpdatePda,\n findProgramIdentityPda,\n findRoundPda,\n findSubaccordPda,\n} from \"./pda\";\n// Generated program address — the single source the facade `ACCORD_PROGRAM_ID`\n// aliases. Exposed so Arbitrable SDKs (e.g. @useaccord/canon) can source the\n// Accord program identity from generated code instead of hard-coding it.\nexport { ACCORD_PROGRAM_ADDRESS } from \"./generated/programs/accord.js\";\nexport {\n ASSOCIATED_TOKEN_PROGRAM_ADDRESS,\n TOKEN_PROGRAM_ADDRESS,\n findAssociatedTokenAddress,\n} from \"./token\";\nexport * from \"./constants\";\nexport {\n fetchAppealBond,\n fetchAppealBondMaybe,\n fetchDispute,\n fetchDisputeMaybe,\n fetchJurorStake,\n fetchJurorStakeMaybe,\n fetchAccordState,\n fetchAccordStateMaybe,\n fetchPendingUpdate,\n fetchPendingUpdateMaybe,\n fetchRound,\n fetchRoundMaybe,\n fetchSubaccord,\n fetchSubaccordMaybe,\n} from \"./fetch\";\nexport {\n findAllJurorStakes,\n findAllSubaccords,\n findDisputesByFiler,\n findDisputesBySubaccord,\n findJurorStakesByJuror,\n findJurorStakesBySubaccord,\n} from \"./query\";\nexport {\n AccordErrors,\n ACCORD_ERROR_CODE_OFFSET,\n type AccordErrorCode,\n type AccordErrorName,\n} from \"./errors\";\nexport * from \"./types\";\n\nexport const SDK_NAME = \"@useaccord/sdk\";\nexport const SDK_VERSION = \"0.1.0\";\n\n// Arbitrable CPI API — the primary external surface (ADR-0010, bean veridao-50qy).\nexport * from \"./methods/dispute.js\";\n\n// Commit-reveal voting + finalization cranks + the commit-hash helper\n// (ADR-0010, bean veridao-a0mc).\nexport * from \"./methods/voting.js\";\n\n// Stake accumulator (ADR-0012): subtree-sum MST builder + proofs — the\n// byte-exact reference the on-chain verifier matches. Used by `stake`/\n// `requestWithdraw`/`reconcileStake` (path) and `draw_seat` (membership +\n// sortition prefix).\nexport {\n type MerkleAccumulator,\n type MSTNode,\n type LeafClaim,\n leafHash,\n emptyRoot,\n buildAccumulator,\n proofFor,\n recomputeRoot,\n verifyMembership,\n} from \"./methods/mst.js\";\n\n// Subaccord lifecycle + circuit breaker (ADR-0005/0007) + timelock helpers\n// (ADR-0010, bean veridao-erv7).\nexport * from \"./methods/lifecycle.js\";\n\n// VRF request + per-seat draw_seat choreography + sortition slot derivation\n// (ADR-0009 §2 + ADR-0012, bean veridao-j7tx).\nexport * from \"./methods/vrf.js\";\n\n// Juror capital stake / two-phase withdraw (requestWithdraw + withdraw) +\n// reconcileStake crank + the active_draws typed guard (ADR-0003/0007/0012,\n// REVIEW #4/#5, bean veridao-o8ki).\nexport * from \"./methods/staking.js\";\n\n// Per-round settlement crank + dispute cancellation (settleRound / cancelDispute,\n// ADR-0010, bean accord-dedf).\nexport * from \"./methods/settlement.js\";\n\n// Dispute appeal + bond refund + appeal-ladder math (ADR-0004, ADR-0010,\n// bean veridao-yny6).\nexport * from \"./methods/appeal.js\";\n\n// Stake / unstake MST accumulator proof orchestration (ADR-0012, bean\n// accord-bko6). Given a Subaccord's accumulator state + all its JurorStake\n// accounts, builds the canonical tree, verifies the root, and returns the\n// Merkle proof for stake / requestWithdraw / reconcileStake.\nexport {\n prepareStakeProof,\n type SubaccordAccumulatorView,\n type JurorStakeLeaf,\n type StakeProofResult,\n} from \"./methods/stakeFlow.js\";\n\n// Dispute phase label + countdown for the juror dashboard (bean accord-m4gt).\nexport {\n disputePhase,\n type RoundPhaseWindows,\n type PhaseInfo,\n} from \"./methods/disputePhase.js\";\n\n// Account codecs — exposed for advanced/test use (e.g. e2e VRF injection via\n// `surfnet_setAccount`: decode → set committedVrf → re-encode; daemon unit\n// tests encode fixtures over a stubbed RPC). Generated surface.\nexport {\n getDisputeEncoder,\n getDisputeCodec,\n DISPUTE_DISCRIMINATOR,\n} from \"./generated/accounts/dispute.js\";\nexport {\n getRoundEncoder,\n getRoundCodec,\n ROUND_DISCRIMINATOR,\n} from \"./generated/accounts/round.js\";\nexport {\n getSubaccordEncoder,\n getSubaccordCodec,\n SUBACCORD_DISCRIMINATOR,\n} from \"./generated/accounts/subaccord.js\";\n\n// Account decoders — pure (no `client.rpc`). The facade's typed fetchers\n// (`fetchX`) currently require a `ClientWithRpc` and break when the facade is\n// built over a raw `createSolanaRpc`; until that's fixed, read accounts via\n// raw `getAccountInfo` + these decoders.\n//\n// Generated `fetchMaybe*` functions work directly with a raw Kit RPC and return\n// typed `MaybeAccount<T>` — the correct read path for the frontend and tests.\nexport {\n type AppealBond,\n fetchMaybeAppealBond,\n fetchMaybeDispute,\n fetchMaybeJurorStake,\n fetchMaybeAccordState,\n fetchMaybePendingUpdate,\n fetchMaybeRound,\n fetchMaybeSubaccord,\n getAppealBondDecoder,\n getDisputeDecoder,\n getJurorStakeDecoder,\n getAccordStateDecoder,\n getPendingUpdateDecoder,\n getRoundDecoder,\n getSubaccordDecoder,\n type Dispute,\n type JurorStake,\n type AccordState,\n type PendingUpdate,\n type Round,\n type Subaccord,\n} from \"./generated/accounts/index.js\";\n\n// Typed getProgramAccounts query wrappers — no raw bytes leak to the caller\n// (ADR-0010, bean accord-3f19/accord-bp9y).\nexport {\n findAllDisputes,\n findAllPendingUpdates,\n type QueryConfig,\n} from \"./queries.js\";\n\n// Domain document convention (ADR-0027, milestone accord-lgof): sha256-CAS\n// hashing, frontmatter parsing, and daemon fetch/verify/publish for canon\n// rules docs. putDomainDoc is the single publish client (ADR-0027 amendment —\n// chain-anchored ?subaccord PUT).\nexport {\n DomainPublishError,\n hashDomainDoc,\n parseDomainDoc,\n putDomainDoc,\n verifyDomainDoc,\n fetchDomainDoc,\n type ParsedDomainDoc,\n type FetchedDomainDoc,\n type PutDomainDocOptions,\n type PutDomainDocResult,\n} from \"./domain.js\";\n"],"mappings":";;;;;AAUA;AAAA,EACE;AAAA,OAKK;;;ACRP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA,kBAAAA;AAAA,EACA,mBAAAC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAAC;AAAA,OAWK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAGK;;;AC1BP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAcK;AAEA,IAAM,6BAAiD,IAAI,WAAW;AAAA,EAC3E;AAAA,EAAK;AAAA,EAAG;AAAA,EAAK;AAAA,EAAK;AAAA,EAAI;AAAA,EAAI;AAAA,EAAI;AAChC,CAAC;AA8CM,SAAS,wBAAkD;AAChE,SAAO;AAAA,IACL,iBAAiB;AAAA,MACf,CAAC,iBAAiB,eAAe,gBAAgB,GAAG,CAAC,CAAC;AAAA,MACtD,CAAC,aAAa,kBAAkB,CAAC;AAAA,MACjC,CAAC,UAAU,kBAAkB,CAAC;AAAA,MAC9B,CAAC,uBAAuB,iBAAiB,cAAc,CAAC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M,MAAM,GAAG,CAAC,EAAE,KAAK,IAAI;AAAA,QACxC,MAAM,MAAM,MAAM,IAAI,CAAC,EAAE,KAAK,IAAI;AAAA,MACpC;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;AApBS;AAuBT,SAAS,iBAAiB,MAAwC;AAChE,QAAM,MAAgC,CAAC;AACvC,aAAW,QAAQ,KAAK,MAAM,IAAI,GAAG;AACnC,UAAM,OAAO,KAAK,SAAS,IAAI,IAAI,KAAK,MAAM,GAAG,EAAE,IAAI;AACvD,UAAM,MAAM,KAAK,QAAQ,GAAG;AAC5B,QAAI,OAAO,EAAG;AACd,UAAM,MAAM,KAAK,MAAM,GAAG,GAAG,EAAE,KAAK;AACpC,UAAM,QAAQ,QAAQ,KAAK,MAAM,MAAM,CAAC,EAAE,KAAK,CAAC;AAChD,QAAI,CAAC,MAAO;AACZ,QAAI,QAAQ,QAAS,KAAI,QAAQ;AAAA,aACxB,QAAQ,cAAe,KAAI,cAAc;AAAA,EACpD;AACA,SAAO;AACT;AAbS;AAeT,SAAS,QAAQ,GAAmB;AAClC,MACE,EAAE,UAAU,MACV,EAAE,CAAC,MAAM,OAAO,EAAE,SAAS,GAAG,KAAO,EAAE,CAAC,MAAM,OAAO,EAAE,SAAS,GAAG,IACrE;AACA,WAAO,EAAE,MAAM,GAAG,EAAE;AAAA,EACtB;AACA,SAAO;AACT;AARS;;;AChIF,IAAM,WAAW;AACjB,IAAM,cAAc;","names":["fixEncoderSize","getBytesEncoder","SolanaError","assertAccountExists","assertAccountsExist","combineCodec","decodeAccount","fetchEncodedAccount","fetchEncodedAccounts","fixDecoderSize","fixEncoderSize","getAddressDecoder","getAddressEncoder","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","getU64Decoder","getU64Encoder","getU8Decoder","getU8Encoder","transformEncoder","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getAddressEncoder","getU64Encoder","getU8Encoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getAddressDecoder","getU64Decoder","getU8Decoder","combineCodec","decodeAccount","assertAccountExists","fetchEncodedAccount","assertAccountExists","assertAccountsExist","combineCodec","decodeAccount","fetchEncodedAccount","fetchEncodedAccounts","fixDecoderSize","fixEncoderSize","getAddressDecoder","getAddressEncoder","getBytesDecoder","getBytesEncoder","getOptionDecoder","getOptionEncoder","getStructDecoder","getStructEncoder","getU32Decoder","getU32Encoder","getU64Decoder","getU64Encoder","getU8Decoder","getU8Encoder","transformEncoder","combineCodec","Aggregation","combineCodec","combineCodec","getStructDecoder","getStructEncoder","getU32Decoder","getU32Encoder","getU64Decoder","getU64Encoder","getU8Decoder","getU8Encoder","getStructEncoder","getU64Encoder","getU8Encoder","getU32Encoder","getStructDecoder","getU64Decoder","getU8Decoder","getU32Decoder","combineCodec","getEnumDecoder","getEnumEncoder","DisputeState","getEnumEncoder","getEnumDecoder","combineCodec","getAddressDecoder","getAddressEncoder","getStructDecoder","getStructEncoder","getU64Decoder","getU64Encoder","getStructEncoder","getAddressEncoder","getU64Encoder","getStructDecoder","getAddressDecoder","getU64Decoder","combineCodec","combineCodec","fixDecoderSize","fixEncoderSize","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","getU64Decoder","getU64Encoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getU64Encoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getU64Decoder","combineCodec","combineCodec","getEnumDecoder","getEnumEncoder","ShortfallPolicy","getEnumEncoder","getEnumDecoder","combineCodec","combineCodec","getAddressDecoder","getAddressEncoder","getStructDecoder","getStructEncoder","getU16Decoder","getU16Encoder","getU64Decoder","getU64Encoder","getU8Decoder","getU8Encoder","getStructEncoder","getU64Encoder","getU16Encoder","getU8Encoder","getAddressEncoder","getStructDecoder","getU64Decoder","getU16Decoder","getU8Decoder","getAddressDecoder","combineCodec","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getAddressEncoder","getU64Encoder","getU8Encoder","getU32Encoder","getOptionEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getAddressDecoder","getU64Decoder","getU8Decoder","getU32Decoder","getOptionDecoder","combineCodec","decodeAccount","assertAccountExists","fetchEncodedAccount","assertAccountExists","assertAccountsExist","combineCodec","decodeAccount","fetchEncodedAccount","fetchEncodedAccounts","fixDecoderSize","fixEncoderSize","getAddressDecoder","getAddressEncoder","getBytesDecoder","getBytesEncoder","getI64Decoder","getI64Encoder","getStructDecoder","getStructEncoder","getU32Decoder","getU32Encoder","getU64Decoder","getU64Encoder","getU8Decoder","getU8Encoder","transformEncoder","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getAddressEncoder","getU64Encoder","getU32Encoder","getU8Encoder","getI64Encoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getAddressDecoder","getU64Decoder","getU32Decoder","getU8Decoder","getI64Decoder","combineCodec","decodeAccount","assertAccountExists","fetchEncodedAccount","assertAccountExists","assertAccountsExist","combineCodec","decodeAccount","fetchEncodedAccount","fetchEncodedAccounts","fixDecoderSize","fixEncoderSize","getAddressDecoder","getAddressEncoder","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","getU64Decoder","getU64Encoder","getU8Decoder","getU8Encoder","transformEncoder","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getAddressEncoder","getU64Encoder","getU8Encoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getAddressDecoder","getU64Decoder","getU8Decoder","combineCodec","decodeAccount","assertAccountExists","fetchEncodedAccount","assertAccountExists","assertAccountsExist","combineCodec","decodeAccount","fetchEncodedAccount","fetchEncodedAccounts","fixDecoderSize","fixEncoderSize","getAddressDecoder","getAddressEncoder","getArrayDecoder","getArrayEncoder","getBytesDecoder","getBytesEncoder","getI64Decoder","getI64Encoder","getStructDecoder","getStructEncoder","getU32Decoder","getU32Encoder","getU64Decoder","getU64Encoder","getU8Decoder","getU8Encoder","transformEncoder","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getU32Encoder","getU8Encoder","getI64Encoder","getU64Encoder","getAddressEncoder","getArrayEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getU32Decoder","getU8Decoder","getI64Decoder","getU64Decoder","getAddressDecoder","getArrayDecoder","combineCodec","decodeAccount","assertAccountExists","fetchEncodedAccount","assertAccountExists","assertAccountsExist","combineCodec","decodeAccount","fetchEncodedAccount","fetchEncodedAccounts","fixDecoderSize","fixEncoderSize","getAddressDecoder","getAddressEncoder","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","getU16Decoder","getU16Encoder","getU32Decoder","getU32Encoder","getU64Decoder","getU64Encoder","getU8Decoder","getU8Encoder","transformEncoder","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getAddressEncoder","getU64Encoder","getU16Encoder","getU8Encoder","getU32Encoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getAddressDecoder","getU64Decoder","getU16Decoder","getU8Decoder","getU32Decoder","combineCodec","decodeAccount","assertAccountExists","fetchEncodedAccount","combineCodec","fixDecoderSize","fixEncoderSize","getAddressEncoder","getBytesDecoder","getBytesEncoder","getProgramDerivedAddress","getStructDecoder","getStructEncoder","transformEncoder","getBytesEncoder","getBytesEncoder","getAddressEncoder","getBytesEncoder","getProgramDerivedAddress","getU32Encoder","getProgramDerivedAddress","getBytesEncoder","getAddressEncoder","getU32Encoder","getAddressEncoder","getBytesEncoder","getProgramDerivedAddress","getU64Encoder","getProgramDerivedAddress","getBytesEncoder","getAddressEncoder","getU64Encoder","getAddressEncoder","getBytesEncoder","getProgramDerivedAddress","getProgramDerivedAddress","getBytesEncoder","getAddressEncoder","getAddressEncoder","getBytesEncoder","getProgramDerivedAddress","getU64Encoder","getProgramDerivedAddress","getBytesEncoder","getAddressEncoder","getU64Encoder","getBytesEncoder","getProgramDerivedAddress","getProgramDerivedAddress","getBytesEncoder","getAddressEncoder","getBytesEncoder","getProgramDerivedAddress","getU32Encoder","getProgramDerivedAddress","getBytesEncoder","getAddressEncoder","getU32Encoder","fixEncoderSize","getAddressEncoder","getBytesEncoder","getProgramDerivedAddress","getProgramDerivedAddress","getBytesEncoder","getAddressEncoder","fixEncoderSize","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getProgramDerivedAddress","getAddressEncoder","getBytesEncoder","combineCodec","fixDecoderSize","fixEncoderSize","getAddressEncoder","getBytesDecoder","getBytesEncoder","getProgramDerivedAddress","getStructDecoder","getStructEncoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getAddressFromResolvedInstructionAccount","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getProgramDerivedAddress","getAddressEncoder","getAddressFromResolvedInstructionAccount","getBytesEncoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getAddressEncoder","getBytesDecoder","getBytesEncoder","getProgramDerivedAddress","getStructDecoder","getStructEncoder","getU32Decoder","getU32Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getAddressFromResolvedInstructionAccount","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getU32Encoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getU32Decoder","getAddressFromResolvedInstructionAccount","getProgramDerivedAddress","getAddressEncoder","getBytesEncoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getAddressEncoder","getArrayDecoder","getArrayEncoder","getBytesDecoder","getBytesEncoder","getProgramDerivedAddress","getStructDecoder","getStructEncoder","getU64Decoder","getU64Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getAddressFromResolvedInstructionAccount","getNonNullResolvedInstructionInput","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getArrayEncoder","getU64Encoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getArrayDecoder","getU64Decoder","getAddressFromResolvedInstructionAccount","getNonNullResolvedInstructionInput","getProgramDerivedAddress","getAddressEncoder","getBytesEncoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getAddressDecoder","getAddressEncoder","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","getU16Decoder","getU16Encoder","getU32Decoder","getU32Encoder","getU64Decoder","getU64Encoder","getU8Decoder","getU8Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getAddressFromResolvedInstructionAccount","getNonNullResolvedInstructionInput","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getU64Encoder","getU16Encoder","getU8Encoder","getU32Encoder","getAddressEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getU64Decoder","getU16Decoder","getU8Decoder","getU32Decoder","getAddressDecoder","getAddressFromResolvedInstructionAccount","getNonNullResolvedInstructionInput","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getArrayDecoder","getArrayEncoder","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","getU32Decoder","getU32Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getU32Encoder","getArrayEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getU32Decoder","getArrayDecoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","getU64Decoder","getU64Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getAddressFromResolvedInstructionAccount","getNonNullResolvedInstructionInput","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getU64Encoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getU64Decoder","getAddressFromResolvedInstructionAccount","getNonNullResolvedInstructionInput","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getArrayDecoder","getArrayEncoder","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getAddressFromResolvedInstructionAccount","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getArrayEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getArrayDecoder","getAddressFromResolvedInstructionAccount","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getArrayDecoder","getArrayEncoder","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getArrayEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getArrayDecoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getArrayDecoder","getArrayEncoder","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getArrayEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getArrayDecoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getAddressEncoder","getBytesDecoder","getBytesEncoder","getProgramDerivedAddress","getStructDecoder","getStructEncoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getAddressFromResolvedInstructionAccount","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getProgramDerivedAddress","getAddressEncoder","getAddressFromResolvedInstructionAccount","getBytesEncoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getArrayDecoder","getArrayEncoder","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","getU64Decoder","getU64Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getAddressFromResolvedInstructionAccount","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getU64Encoder","getArrayEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getU64Decoder","getArrayDecoder","getAddressFromResolvedInstructionAccount","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","getU64Decoder","getU64Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getU64Encoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getU64Decoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","getU32Decoder","getU32Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getAddressFromResolvedInstructionAccount","getNonNullResolvedInstructionInput","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getU32Encoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getU32Decoder","getAddressFromResolvedInstructionAccount","getNonNullResolvedInstructionInput","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getAddressEncoder","getArrayDecoder","getArrayEncoder","getBytesDecoder","getBytesEncoder","getProgramDerivedAddress","getStructDecoder","getStructEncoder","getU64Decoder","getU64Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getAddressFromResolvedInstructionAccount","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getU64Encoder","getArrayEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getU64Decoder","getArrayDecoder","getAddressFromResolvedInstructionAccount","getProgramDerivedAddress","getAddressEncoder","getBytesEncoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getAddressEncoder","getBytesDecoder","getBytesEncoder","getProgramDerivedAddress","getStructDecoder","getStructEncoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getAddressFromResolvedInstructionAccount","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getAddressFromResolvedInstructionAccount","getProgramDerivedAddress","getAddressEncoder","getBytesEncoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getAddressEncoder","getBytesDecoder","getBytesEncoder","getProgramDerivedAddress","getStructDecoder","getStructEncoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getAddressFromResolvedInstructionAccount","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getAddressFromResolvedInstructionAccount","getProgramDerivedAddress","getAddressEncoder","getBytesEncoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","fixEncoderSize","getBytesEncoder","SolanaError","fixEncoderSize","getBytesEncoder","SolanaError","getAddressEncoder","getBytesEncoder","getProgramDerivedAddress","getU32Encoder","findRoundPda","getProgramDerivedAddress","getBytesEncoder","getAddressEncoder","getU32Encoder","getAddressDecoder","getAddressEncoder","getAddressEncoder","getProgramDerivedAddress","ACCORD_PROGRAM_ID","findDisputePda","getAddressEncoder","getProgramDerivedAddress","getAddressEncoder","getAddressDecoder","getAddressEncoder","getProgramDerivedAddress","U64_MAX","findSubaccordPda","getAddressEncoder","getProgramDerivedAddress","findPendingUpdatePda","AccountRole","getAddressEncoder","getProgramDerivedAddress","U64_MAX","stake","AccountRole","le8","stake","path","idx","sha256","getAddressEncoder","getProgramDerivedAddress","le4","getAddressEncoder","getProgramDerivedAddress","getAddressEncoder","getProgramDerivedAddress","getAddressEncoder","getAddressEncoder","getAddressEncoder","getAddressEncoder","sha256","sha256"]}
|
|
1
|
+
{"version":3,"sources":["../src/accord.ts","../src/generated/programs/accord.ts","../src/generated/accounts/accordState.ts","../src/generated/accounts/appealBond.ts","../src/generated/accounts/dispute.ts","../src/generated/types/aggregation.ts","../src/generated/types/caseTerms.ts","../src/generated/types/disputeState.ts","../src/generated/types/leafClaim.ts","../src/generated/types/mSTNode.ts","../src/generated/types/shortfallPolicy.ts","../src/generated/types/updatePayload.ts","../src/generated/accounts/jurorStake.ts","../src/generated/accounts/pendingUpdate.ts","../src/generated/accounts/round.ts","../src/generated/accounts/subaccord.ts","../src/generated/instructions/appeal.ts","../src/generated/pdas/accordState.ts","../src/generated/pdas/appealBond.ts","../src/generated/pdas/dispute.ts","../src/generated/pdas/jurorStake.ts","../src/generated/pdas/pendingUpdate.ts","../src/generated/pdas/programIdentity.ts","../src/generated/pdas/round.ts","../src/generated/pdas/subaccord.ts","../src/generated/instructions/cancelDispute.ts","../src/generated/instructions/claimAppealRefund.ts","../src/generated/instructions/claimFilingBounty.ts","../src/generated/instructions/commit.ts","../src/generated/instructions/commitVrfCallback.ts","../src/generated/instructions/createDispute.ts","../src/generated/instructions/createSubaccord.ts","../src/generated/instructions/drawSeat.ts","../src/generated/instructions/executeSubaccordUpdate.ts","../src/generated/instructions/executeUnpause.ts","../src/generated/instructions/finalizeDispute.ts","../src/generated/instructions/finalizeRound.ts","../src/generated/instructions/getRuling.ts","../src/generated/instructions/health.ts","../src/generated/instructions/initializePause.ts","../src/generated/instructions/pause.ts","../src/generated/instructions/proposeSubaccordUpdate.ts","../src/generated/instructions/proposeUnpause.ts","../src/generated/instructions/pruneJuror.ts","../src/generated/instructions/reclaimSlot.ts","../src/generated/instructions/reconcileStake.ts","../src/generated/instructions/redraw.ts","../src/generated/instructions/requestVrf.ts","../src/generated/instructions/requestWithdraw.ts","../src/generated/instructions/reveal.ts","../src/generated/instructions/settleRound.ts","../src/generated/instructions/stake.ts","../src/generated/instructions/withdraw.ts","../src/generated/instructions/withdrawFees.ts","../src/pda.ts","../src/adapter.ts","../src/methods/dispute.ts","../src/constants.ts","../src/methods/lifecycle.ts","../src/methods/staking.ts","../src/methods/settlement.ts","../src/methods/mst.ts","../src/methods/vrf.ts","../src/methods/voting.ts","../src/methods/appeal.ts","../src/methods.ts","../src/wallet.ts","../src/token.ts","../src/query.ts","../src/errors.ts","../src/methods/stakeFlow.ts","../src/methods/disputePhase.ts","../src/queries.ts","../src/domain.ts","../src/index.ts"],"sourcesContent":["/**\n * Accord facade — the primary consumer surface for the VeriDAO Accord SDK.\n *\n * Composes the generated Codama Kit client with domain-level orchestration.\n * Method-group modules (`src/methods/*.ts`) are standalone functions that take\n * the facade's client + args; this class pre-wires delegation to each group.\n *\n * @see ADR-0010\n */\n\nimport {\n createSolanaRpc,\n type Address,\n type Rpc,\n type SolanaRpcApi,\n type TransactionSigner,\n} from \"@solana/kit\";\n\nimport {\n accordProgram,\n type AccordPlugin,\n type AccordPluginRequirements,\n} from \"./generated/programs/accord\";\nimport { ACCORD_PROGRAM_ID } from \"./pda\";\nimport { createAccordAdapter, type AccordAdapter } from \"./adapter.js\";\nimport { createAccordMethods, type AccordMethods } from \"./methods.js\";\n\n/** A Kit client extended with the Accord plugin. */\nexport type AccordClient = ReturnType<ReturnType<typeof accordProgram>>;\n\nexport interface AccordConfig {\n /** JSON-RPC endpoint (e.g. \"http://localhost:8899\"). */\n endpoint: string;\n /** A Kit TransactionSigner (from wallet.ts or @solana/kit). */\n signer: TransactionSigner;\n}\n\nexport class Accord {\n /** The canonical Accord program address. */\n static readonly PROGRAM_ID = ACCORD_PROGRAM_ID;\n\n readonly rpc: Rpc<SolanaRpcApi>;\n readonly signer: TransactionSigner;\n readonly client: AccordClient;\n\n private _adapter?: AccordAdapter;\n\n constructor(config: AccordConfig) {\n this.rpc = createSolanaRpc(config.endpoint);\n this.signer = config.signer;\n // Extend the RPC with the Accord plugin (accounts, instructions, PDAs).\n // The RPC satisfies AccordPluginRequirements at runtime; the type assertion\n // bridges Kit's generic client interface for the shell.\n this.client = accordProgram()(\n this.rpc as unknown as AccordPluginRequirements,\n );\n }\n\n /**\n * The concrete seam adapter — implements all seven `Accord*Client` seams\n * against the generated Codama client. Pass to the pure orchestration\n * functions in `src/methods/*.ts`, or use {@link methods} for bound helpers.\n */\n get adapter(): AccordAdapter {\n if (!this._adapter) this._adapter = createAccordAdapter(this);\n return this._adapter;\n }\n\n /**\n * Bound orchestration namespace covering all eight method groups. Each helper\n * validates (pure) + builds the instruction via {@link adapter}; the caller\n * signs + sends the returned `Instruction` with `this.signer`.\n */\n get methods(): AccordMethods {\n return createAccordMethods(this.adapter, ACCORD_PROGRAM_ID, this.signer);\n }\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n assertIsInstructionWithAccounts,\n containsBytes,\n extendClient,\n fixEncoderSize,\n getBytesEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_ACCOUNT,\n SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION,\n SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE,\n SolanaError,\n type Address,\n type ClientWithRpc,\n type ClientWithTransactionPlanning,\n type ClientWithTransactionSending,\n type ExtendedClient,\n type GetAccountInfoApi,\n type GetMultipleAccountsApi,\n type Instruction,\n type InstructionWithData,\n type ReadonlyUint8Array,\n} from \"@solana/kit\";\nimport {\n addSelfFetchFunctions,\n addSelfPlanAndSendFunctions,\n type SelfFetchFunctions,\n type SelfPlanAndSendFunctions,\n} from \"@solana/kit/program-client-core\";\nimport {\n getAccordStateCodec,\n getAppealBondCodec,\n getDisputeCodec,\n getJurorStakeCodec,\n getPendingUpdateCodec,\n getRoundCodec,\n getSubaccordCodec,\n type AccordState,\n type AccordStateArgs,\n type AppealBond,\n type AppealBondArgs,\n type Dispute,\n type DisputeArgs,\n type JurorStake,\n type JurorStakeArgs,\n type PendingUpdate,\n type PendingUpdateArgs,\n type Round,\n type RoundArgs,\n type Subaccord,\n type SubaccordArgs,\n} from \"../accounts\";\nimport {\n getAppealInstructionAsync,\n getCancelDisputeInstructionAsync,\n getClaimAppealRefundInstructionAsync,\n getClaimFilingBountyInstructionAsync,\n getCommitInstruction,\n getCommitVrfCallbackInstruction,\n getCreateDisputeInstructionAsync,\n getCreateSubaccordInstructionAsync,\n getDrawSeatInstruction,\n getExecuteSubaccordUpdateInstruction,\n getExecuteUnpauseInstructionAsync,\n getFinalizeDisputeInstruction,\n getFinalizeRoundInstruction,\n getGetRulingInstruction,\n getHealthInstruction,\n getInitializePauseInstructionAsync,\n getPauseInstructionAsync,\n getProposeSubaccordUpdateInstructionAsync,\n getProposeUnpauseInstructionAsync,\n getPruneJurorInstructionAsync,\n getReclaimSlotInstruction,\n getReconcileStakeInstruction,\n getRedrawInstructionAsync,\n getRequestVrfInstructionAsync,\n getRequestWithdrawInstructionAsync,\n getRevealInstruction,\n getSettleRoundInstructionAsync,\n getStakeInstructionAsync,\n getWithdrawFeesInstructionAsync,\n getWithdrawInstructionAsync,\n parseAppealInstruction,\n parseCancelDisputeInstruction,\n parseClaimAppealRefundInstruction,\n parseClaimFilingBountyInstruction,\n parseCommitInstruction,\n parseCommitVrfCallbackInstruction,\n parseCreateDisputeInstruction,\n parseCreateSubaccordInstruction,\n parseDrawSeatInstruction,\n parseExecuteSubaccordUpdateInstruction,\n parseExecuteUnpauseInstruction,\n parseFinalizeDisputeInstruction,\n parseFinalizeRoundInstruction,\n parseGetRulingInstruction,\n parseHealthInstruction,\n parseInitializePauseInstruction,\n parsePauseInstruction,\n parseProposeSubaccordUpdateInstruction,\n parseProposeUnpauseInstruction,\n parsePruneJurorInstruction,\n parseReclaimSlotInstruction,\n parseReconcileStakeInstruction,\n parseRedrawInstruction,\n parseRequestVrfInstruction,\n parseRequestWithdrawInstruction,\n parseRevealInstruction,\n parseSettleRoundInstruction,\n parseStakeInstruction,\n parseWithdrawFeesInstruction,\n parseWithdrawInstruction,\n type AppealAsyncInput,\n type CancelDisputeAsyncInput,\n type ClaimAppealRefundAsyncInput,\n type ClaimFilingBountyAsyncInput,\n type CommitInput,\n type CommitVrfCallbackInput,\n type CreateDisputeAsyncInput,\n type CreateSubaccordAsyncInput,\n type DrawSeatInput,\n type ExecuteSubaccordUpdateInput,\n type ExecuteUnpauseAsyncInput,\n type FinalizeDisputeInput,\n type FinalizeRoundInput,\n type GetRulingInput,\n type HealthInput,\n type InitializePauseAsyncInput,\n type ParsedAppealInstruction,\n type ParsedCancelDisputeInstruction,\n type ParsedClaimAppealRefundInstruction,\n type ParsedClaimFilingBountyInstruction,\n type ParsedCommitInstruction,\n type ParsedCommitVrfCallbackInstruction,\n type ParsedCreateDisputeInstruction,\n type ParsedCreateSubaccordInstruction,\n type ParsedDrawSeatInstruction,\n type ParsedExecuteSubaccordUpdateInstruction,\n type ParsedExecuteUnpauseInstruction,\n type ParsedFinalizeDisputeInstruction,\n type ParsedFinalizeRoundInstruction,\n type ParsedGetRulingInstruction,\n type ParsedHealthInstruction,\n type ParsedInitializePauseInstruction,\n type ParsedPauseInstruction,\n type ParsedProposeSubaccordUpdateInstruction,\n type ParsedProposeUnpauseInstruction,\n type ParsedPruneJurorInstruction,\n type ParsedReclaimSlotInstruction,\n type ParsedReconcileStakeInstruction,\n type ParsedRedrawInstruction,\n type ParsedRequestVrfInstruction,\n type ParsedRequestWithdrawInstruction,\n type ParsedRevealInstruction,\n type ParsedSettleRoundInstruction,\n type ParsedStakeInstruction,\n type ParsedWithdrawFeesInstruction,\n type ParsedWithdrawInstruction,\n type PauseAsyncInput,\n type ProposeSubaccordUpdateAsyncInput,\n type ProposeUnpauseAsyncInput,\n type PruneJurorAsyncInput,\n type ReclaimSlotInput,\n type ReconcileStakeInput,\n type RedrawAsyncInput,\n type RequestVrfAsyncInput,\n type RequestWithdrawAsyncInput,\n type RevealInput,\n type SettleRoundAsyncInput,\n type StakeAsyncInput,\n type WithdrawAsyncInput,\n type WithdrawFeesAsyncInput,\n} from \"../instructions\";\nimport {\n findAccordStatePda,\n findAppealBondPda,\n findDisputePda,\n findJurorStakePda,\n findPendingUpdatePda,\n findProgramIdentityPda,\n findRoundPda,\n findSubaccordPda,\n} from \"../pdas\";\n\nexport const ACCORD_PROGRAM_ADDRESS =\n \"cordhVoshqRV6kzGBmM89A66wuusJGsDCvLMHPLyKed\" as Address<\"cordhVoshqRV6kzGBmM89A66wuusJGsDCvLMHPLyKed\">;\n\nexport enum AccordAccount {\n AccordState,\n AppealBond,\n Dispute,\n JurorStake,\n PendingUpdate,\n Round,\n Subaccord,\n}\n\nexport function identifyAccordAccount(\n account: { data: ReadonlyUint8Array } | ReadonlyUint8Array,\n): AccordAccount {\n const data = \"data\" in account ? account.data : account;\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([218, 6, 196, 225, 25, 89, 50, 183]),\n ),\n 0,\n )\n ) {\n return AccordAccount.AccordState;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([84, 79, 238, 7, 49, 113, 35, 143]),\n ),\n 0,\n )\n ) {\n return AccordAccount.AppealBond;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([36, 49, 241, 67, 40, 36, 241, 74]),\n ),\n 0,\n )\n ) {\n return AccordAccount.Dispute;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([139, 114, 205, 73, 247, 175, 133, 122]),\n ),\n 0,\n )\n ) {\n return AccordAccount.JurorStake;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([24, 212, 61, 73, 130, 111, 15, 112]),\n ),\n 0,\n )\n ) {\n return AccordAccount.PendingUpdate;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([87, 127, 165, 51, 73, 78, 116, 174]),\n ),\n 0,\n )\n ) {\n return AccordAccount.Round;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([210, 63, 193, 190, 9, 166, 89, 170]),\n ),\n 0,\n )\n ) {\n return AccordAccount.Subaccord;\n }\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_ACCOUNT,\n { accountData: data, programName: \"accord\" },\n );\n}\n\nexport enum AccordInstruction {\n Appeal,\n CancelDispute,\n ClaimAppealRefund,\n ClaimFilingBounty,\n Commit,\n CommitVrfCallback,\n CreateDispute,\n CreateSubaccord,\n DrawSeat,\n ExecuteSubaccordUpdate,\n ExecuteUnpause,\n FinalizeDispute,\n FinalizeRound,\n GetRuling,\n Health,\n InitializePause,\n Pause,\n ProposeSubaccordUpdate,\n ProposeUnpause,\n PruneJuror,\n ReclaimSlot,\n ReconcileStake,\n Redraw,\n RequestVrf,\n RequestWithdraw,\n Reveal,\n SettleRound,\n Stake,\n Withdraw,\n WithdrawFees,\n}\n\nexport function identifyAccordInstruction(\n instruction: { data: ReadonlyUint8Array } | ReadonlyUint8Array,\n): AccordInstruction {\n const data = \"data\" in instruction ? instruction.data : instruction;\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([250, 91, 1, 244, 179, 52, 75, 236]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.Appeal;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([23, 155, 220, 94, 76, 141, 231, 124]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.CancelDispute;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([210, 169, 229, 146, 187, 30, 61, 176]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.ClaimAppealRefund;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([0, 179, 28, 122, 171, 246, 12, 132]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.ClaimFilingBounty;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([223, 140, 142, 165, 229, 208, 156, 74]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.Commit;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([51, 127, 131, 85, 83, 117, 121, 59]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.CommitVrfCallback;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([161, 99, 53, 116, 60, 79, 149, 105]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.CreateDispute;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([135, 240, 91, 50, 192, 161, 177, 22]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.CreateSubaccord;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([52, 26, 56, 16, 128, 4, 149, 236]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.DrawSeat;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([145, 99, 105, 27, 63, 159, 254, 203]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.ExecuteSubaccordUpdate;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([55, 43, 56, 5, 154, 156, 52, 232]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.ExecuteUnpause;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([190, 211, 17, 122, 247, 157, 27, 223]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.FinalizeDispute;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([239, 160, 254, 11, 254, 144, 53, 148]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.FinalizeRound;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([196, 52, 54, 1, 180, 75, 86, 16]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.GetRuling;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([235, 42, 47, 99, 10, 7, 249, 16]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.Health;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([70, 32, 55, 248, 231, 46, 123, 153]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.InitializePause;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([211, 22, 221, 251, 74, 121, 193, 47]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.Pause;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([8, 224, 186, 131, 130, 76, 165, 172]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.ProposeSubaccordUpdate;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([45, 136, 163, 143, 156, 57, 113, 132]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.ProposeUnpause;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([49, 219, 100, 132, 202, 120, 18, 167]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.PruneJuror;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([44, 216, 234, 229, 129, 82, 98, 5]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.ReclaimSlot;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([40, 103, 128, 85, 211, 11, 34, 80]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.ReconcileStake;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([86, 111, 66, 164, 105, 158, 114, 164]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.Redraw;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([5, 87, 79, 152, 164, 176, 190, 226]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.RequestVrf;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([137, 95, 187, 96, 250, 138, 31, 182]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.RequestWithdraw;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([9, 35, 59, 190, 167, 249, 76, 115]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.Reveal;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([40, 101, 18, 1, 31, 129, 52, 77]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.SettleRound;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([206, 176, 202, 18, 200, 209, 179, 108]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.Stake;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([183, 18, 70, 156, 148, 109, 161, 34]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.Withdraw;\n }\n if (\n containsBytes(\n data,\n fixEncoderSize(getBytesEncoder(), 8).encode(\n new Uint8Array([198, 212, 171, 109, 144, 215, 174, 89]),\n ),\n 0,\n )\n ) {\n return AccordInstruction.WithdrawFees;\n }\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION,\n { instructionData: data, programName: \"accord\" },\n );\n}\n\nexport type ParsedAccordInstruction<\n TProgram extends string = \"cordhVoshqRV6kzGBmM89A66wuusJGsDCvLMHPLyKed\",\n> =\n | ({\n instructionType: AccordInstruction.Appeal;\n } & ParsedAppealInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.CancelDispute;\n } & ParsedCancelDisputeInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.ClaimAppealRefund;\n } & ParsedClaimAppealRefundInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.ClaimFilingBounty;\n } & ParsedClaimFilingBountyInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.Commit;\n } & ParsedCommitInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.CommitVrfCallback;\n } & ParsedCommitVrfCallbackInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.CreateDispute;\n } & ParsedCreateDisputeInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.CreateSubaccord;\n } & ParsedCreateSubaccordInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.DrawSeat;\n } & ParsedDrawSeatInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.ExecuteSubaccordUpdate;\n } & ParsedExecuteSubaccordUpdateInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.ExecuteUnpause;\n } & ParsedExecuteUnpauseInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.FinalizeDispute;\n } & ParsedFinalizeDisputeInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.FinalizeRound;\n } & ParsedFinalizeRoundInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.GetRuling;\n } & ParsedGetRulingInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.Health;\n } & ParsedHealthInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.InitializePause;\n } & ParsedInitializePauseInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.Pause;\n } & ParsedPauseInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.ProposeSubaccordUpdate;\n } & ParsedProposeSubaccordUpdateInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.ProposeUnpause;\n } & ParsedProposeUnpauseInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.PruneJuror;\n } & ParsedPruneJurorInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.ReclaimSlot;\n } & ParsedReclaimSlotInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.ReconcileStake;\n } & ParsedReconcileStakeInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.Redraw;\n } & ParsedRedrawInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.RequestVrf;\n } & ParsedRequestVrfInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.RequestWithdraw;\n } & ParsedRequestWithdrawInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.Reveal;\n } & ParsedRevealInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.SettleRound;\n } & ParsedSettleRoundInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.Stake;\n } & ParsedStakeInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.Withdraw;\n } & ParsedWithdrawInstruction<TProgram>)\n | ({\n instructionType: AccordInstruction.WithdrawFees;\n } & ParsedWithdrawFeesInstruction<TProgram>);\n\nexport function parseAccordInstruction<TProgram extends string>(\n instruction: Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array>,\n): ParsedAccordInstruction<TProgram> {\n const instructionType = identifyAccordInstruction(instruction);\n switch (instructionType) {\n case AccordInstruction.Appeal: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.Appeal,\n ...parseAppealInstruction(instruction),\n };\n }\n case AccordInstruction.CancelDispute: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.CancelDispute,\n ...parseCancelDisputeInstruction(instruction),\n };\n }\n case AccordInstruction.ClaimAppealRefund: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.ClaimAppealRefund,\n ...parseClaimAppealRefundInstruction(instruction),\n };\n }\n case AccordInstruction.ClaimFilingBounty: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.ClaimFilingBounty,\n ...parseClaimFilingBountyInstruction(instruction),\n };\n }\n case AccordInstruction.Commit: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.Commit,\n ...parseCommitInstruction(instruction),\n };\n }\n case AccordInstruction.CommitVrfCallback: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.CommitVrfCallback,\n ...parseCommitVrfCallbackInstruction(instruction),\n };\n }\n case AccordInstruction.CreateDispute: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.CreateDispute,\n ...parseCreateDisputeInstruction(instruction),\n };\n }\n case AccordInstruction.CreateSubaccord: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.CreateSubaccord,\n ...parseCreateSubaccordInstruction(instruction),\n };\n }\n case AccordInstruction.DrawSeat: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.DrawSeat,\n ...parseDrawSeatInstruction(instruction),\n };\n }\n case AccordInstruction.ExecuteSubaccordUpdate: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.ExecuteSubaccordUpdate,\n ...parseExecuteSubaccordUpdateInstruction(instruction),\n };\n }\n case AccordInstruction.ExecuteUnpause: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.ExecuteUnpause,\n ...parseExecuteUnpauseInstruction(instruction),\n };\n }\n case AccordInstruction.FinalizeDispute: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.FinalizeDispute,\n ...parseFinalizeDisputeInstruction(instruction),\n };\n }\n case AccordInstruction.FinalizeRound: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.FinalizeRound,\n ...parseFinalizeRoundInstruction(instruction),\n };\n }\n case AccordInstruction.GetRuling: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.GetRuling,\n ...parseGetRulingInstruction(instruction),\n };\n }\n case AccordInstruction.Health: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.Health,\n ...parseHealthInstruction(instruction),\n };\n }\n case AccordInstruction.InitializePause: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.InitializePause,\n ...parseInitializePauseInstruction(instruction),\n };\n }\n case AccordInstruction.Pause: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.Pause,\n ...parsePauseInstruction(instruction),\n };\n }\n case AccordInstruction.ProposeSubaccordUpdate: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.ProposeSubaccordUpdate,\n ...parseProposeSubaccordUpdateInstruction(instruction),\n };\n }\n case AccordInstruction.ProposeUnpause: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.ProposeUnpause,\n ...parseProposeUnpauseInstruction(instruction),\n };\n }\n case AccordInstruction.PruneJuror: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.PruneJuror,\n ...parsePruneJurorInstruction(instruction),\n };\n }\n case AccordInstruction.ReclaimSlot: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.ReclaimSlot,\n ...parseReclaimSlotInstruction(instruction),\n };\n }\n case AccordInstruction.ReconcileStake: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.ReconcileStake,\n ...parseReconcileStakeInstruction(instruction),\n };\n }\n case AccordInstruction.Redraw: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.Redraw,\n ...parseRedrawInstruction(instruction),\n };\n }\n case AccordInstruction.RequestVrf: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.RequestVrf,\n ...parseRequestVrfInstruction(instruction),\n };\n }\n case AccordInstruction.RequestWithdraw: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.RequestWithdraw,\n ...parseRequestWithdrawInstruction(instruction),\n };\n }\n case AccordInstruction.Reveal: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.Reveal,\n ...parseRevealInstruction(instruction),\n };\n }\n case AccordInstruction.SettleRound: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.SettleRound,\n ...parseSettleRoundInstruction(instruction),\n };\n }\n case AccordInstruction.Stake: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.Stake,\n ...parseStakeInstruction(instruction),\n };\n }\n case AccordInstruction.Withdraw: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.Withdraw,\n ...parseWithdrawInstruction(instruction),\n };\n }\n case AccordInstruction.WithdrawFees: {\n assertIsInstructionWithAccounts(instruction);\n return {\n instructionType: AccordInstruction.WithdrawFees,\n ...parseWithdrawFeesInstruction(instruction),\n };\n }\n default:\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE,\n { instructionType: instructionType as string, programName: \"accord\" },\n );\n }\n}\n\nexport type AccordPlugin = {\n accounts: AccordPluginAccounts;\n instructions: AccordPluginInstructions;\n pdas: AccordPluginPdas;\n identifyAccount: typeof identifyAccordAccount;\n identifyInstruction: typeof identifyAccordInstruction;\n parseInstruction: typeof parseAccordInstruction;\n};\n\nexport type AccordPluginAccounts = {\n accordState: ReturnType<typeof getAccordStateCodec> &\n SelfFetchFunctions<AccordStateArgs, AccordState>;\n appealBond: ReturnType<typeof getAppealBondCodec> &\n SelfFetchFunctions<AppealBondArgs, AppealBond>;\n dispute: ReturnType<typeof getDisputeCodec> &\n SelfFetchFunctions<DisputeArgs, Dispute>;\n jurorStake: ReturnType<typeof getJurorStakeCodec> &\n SelfFetchFunctions<JurorStakeArgs, JurorStake>;\n pendingUpdate: ReturnType<typeof getPendingUpdateCodec> &\n SelfFetchFunctions<PendingUpdateArgs, PendingUpdate>;\n round: ReturnType<typeof getRoundCodec> &\n SelfFetchFunctions<RoundArgs, Round>;\n subaccord: ReturnType<typeof getSubaccordCodec> &\n SelfFetchFunctions<SubaccordArgs, Subaccord>;\n};\n\nexport type AccordPluginInstructions = {\n appeal: (\n input: AppealAsyncInput,\n ) => ReturnType<typeof getAppealInstructionAsync> & SelfPlanAndSendFunctions;\n cancelDispute: (\n input: CancelDisputeAsyncInput,\n ) => ReturnType<typeof getCancelDisputeInstructionAsync> &\n SelfPlanAndSendFunctions;\n claimAppealRefund: (\n input: ClaimAppealRefundAsyncInput,\n ) => ReturnType<typeof getClaimAppealRefundInstructionAsync> &\n SelfPlanAndSendFunctions;\n claimFilingBounty: (\n input: ClaimFilingBountyAsyncInput,\n ) => ReturnType<typeof getClaimFilingBountyInstructionAsync> &\n SelfPlanAndSendFunctions;\n commit: (\n input: CommitInput,\n ) => ReturnType<typeof getCommitInstruction> & SelfPlanAndSendFunctions;\n commitVrfCallback: (\n input: CommitVrfCallbackInput,\n ) => ReturnType<typeof getCommitVrfCallbackInstruction> &\n SelfPlanAndSendFunctions;\n createDispute: (\n input: CreateDisputeAsyncInput,\n ) => ReturnType<typeof getCreateDisputeInstructionAsync> &\n SelfPlanAndSendFunctions;\n createSubaccord: (\n input: CreateSubaccordAsyncInput,\n ) => ReturnType<typeof getCreateSubaccordInstructionAsync> &\n SelfPlanAndSendFunctions;\n drawSeat: (\n input: DrawSeatInput,\n ) => ReturnType<typeof getDrawSeatInstruction> & SelfPlanAndSendFunctions;\n executeSubaccordUpdate: (\n input: ExecuteSubaccordUpdateInput,\n ) => ReturnType<typeof getExecuteSubaccordUpdateInstruction> &\n SelfPlanAndSendFunctions;\n executeUnpause: (\n input: ExecuteUnpauseAsyncInput,\n ) => ReturnType<typeof getExecuteUnpauseInstructionAsync> &\n SelfPlanAndSendFunctions;\n finalizeDispute: (\n input: FinalizeDisputeInput,\n ) => ReturnType<typeof getFinalizeDisputeInstruction> &\n SelfPlanAndSendFunctions;\n finalizeRound: (\n input: FinalizeRoundInput,\n ) => ReturnType<typeof getFinalizeRoundInstruction> &\n SelfPlanAndSendFunctions;\n getRuling: (\n input: GetRulingInput,\n ) => ReturnType<typeof getGetRulingInstruction> & SelfPlanAndSendFunctions;\n health: (\n input: HealthInput,\n ) => ReturnType<typeof getHealthInstruction> & SelfPlanAndSendFunctions;\n initializePause: (\n input: InitializePauseAsyncInput,\n ) => ReturnType<typeof getInitializePauseInstructionAsync> &\n SelfPlanAndSendFunctions;\n pause: (\n input: PauseAsyncInput,\n ) => ReturnType<typeof getPauseInstructionAsync> & SelfPlanAndSendFunctions;\n proposeSubaccordUpdate: (\n input: ProposeSubaccordUpdateAsyncInput,\n ) => ReturnType<typeof getProposeSubaccordUpdateInstructionAsync> &\n SelfPlanAndSendFunctions;\n proposeUnpause: (\n input: ProposeUnpauseAsyncInput,\n ) => ReturnType<typeof getProposeUnpauseInstructionAsync> &\n SelfPlanAndSendFunctions;\n pruneJuror: (\n input: PruneJurorAsyncInput,\n ) => ReturnType<typeof getPruneJurorInstructionAsync> &\n SelfPlanAndSendFunctions;\n reclaimSlot: (\n input: ReclaimSlotInput,\n ) => ReturnType<typeof getReclaimSlotInstruction> & SelfPlanAndSendFunctions;\n reconcileStake: (\n input: ReconcileStakeInput,\n ) => ReturnType<typeof getReconcileStakeInstruction> &\n SelfPlanAndSendFunctions;\n redraw: (\n input: RedrawAsyncInput,\n ) => ReturnType<typeof getRedrawInstructionAsync> & SelfPlanAndSendFunctions;\n requestVrf: (\n input: RequestVrfAsyncInput,\n ) => ReturnType<typeof getRequestVrfInstructionAsync> &\n SelfPlanAndSendFunctions;\n requestWithdraw: (\n input: RequestWithdrawAsyncInput,\n ) => ReturnType<typeof getRequestWithdrawInstructionAsync> &\n SelfPlanAndSendFunctions;\n reveal: (\n input: RevealInput,\n ) => ReturnType<typeof getRevealInstruction> & SelfPlanAndSendFunctions;\n settleRound: (\n input: SettleRoundAsyncInput,\n ) => ReturnType<typeof getSettleRoundInstructionAsync> &\n SelfPlanAndSendFunctions;\n stake: (\n input: StakeAsyncInput,\n ) => ReturnType<typeof getStakeInstructionAsync> & SelfPlanAndSendFunctions;\n withdraw: (\n input: WithdrawAsyncInput,\n ) => ReturnType<typeof getWithdrawInstructionAsync> &\n SelfPlanAndSendFunctions;\n withdrawFees: (\n input: WithdrawFeesAsyncInput,\n ) => ReturnType<typeof getWithdrawFeesInstructionAsync> &\n SelfPlanAndSendFunctions;\n};\n\nexport type AccordPluginPdas = {\n accordState: typeof findAccordStatePda;\n appealBond: typeof findAppealBondPda;\n dispute: typeof findDisputePda;\n subaccord: typeof findSubaccordPda;\n pendingUpdate: typeof findPendingUpdatePda;\n jurorStake: typeof findJurorStakePda;\n programIdentity: typeof findProgramIdentityPda;\n round: typeof findRoundPda;\n};\n\nexport type AccordPluginRequirements = ClientWithRpc<\n GetAccountInfoApi & GetMultipleAccountsApi\n> &\n ClientWithTransactionPlanning &\n ClientWithTransactionSending;\n\nexport function accordProgram() {\n return <T extends AccordPluginRequirements>(\n client: T,\n ): ExtendedClient<T, { accord: AccordPlugin }> => {\n return extendClient(client, {\n accord: <AccordPlugin>{\n accounts: {\n accordState: addSelfFetchFunctions(client, getAccordStateCodec()),\n appealBond: addSelfFetchFunctions(client, getAppealBondCodec()),\n dispute: addSelfFetchFunctions(client, getDisputeCodec()),\n jurorStake: addSelfFetchFunctions(client, getJurorStakeCodec()),\n pendingUpdate: addSelfFetchFunctions(client, getPendingUpdateCodec()),\n round: addSelfFetchFunctions(client, getRoundCodec()),\n subaccord: addSelfFetchFunctions(client, getSubaccordCodec()),\n },\n instructions: {\n appeal: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getAppealInstructionAsync(input),\n ),\n cancelDispute: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getCancelDisputeInstructionAsync(input),\n ),\n claimAppealRefund: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getClaimAppealRefundInstructionAsync(input),\n ),\n claimFilingBounty: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getClaimFilingBountyInstructionAsync(input),\n ),\n commit: (input) =>\n addSelfPlanAndSendFunctions(client, getCommitInstruction(input)),\n commitVrfCallback: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getCommitVrfCallbackInstruction(input),\n ),\n createDispute: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getCreateDisputeInstructionAsync(input),\n ),\n createSubaccord: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getCreateSubaccordInstructionAsync(input),\n ),\n drawSeat: (input) =>\n addSelfPlanAndSendFunctions(client, getDrawSeatInstruction(input)),\n executeSubaccordUpdate: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getExecuteSubaccordUpdateInstruction(input),\n ),\n executeUnpause: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getExecuteUnpauseInstructionAsync(input),\n ),\n finalizeDispute: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getFinalizeDisputeInstruction(input),\n ),\n finalizeRound: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getFinalizeRoundInstruction(input),\n ),\n getRuling: (input) =>\n addSelfPlanAndSendFunctions(client, getGetRulingInstruction(input)),\n health: (input) =>\n addSelfPlanAndSendFunctions(client, getHealthInstruction(input)),\n initializePause: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getInitializePauseInstructionAsync(input),\n ),\n pause: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getPauseInstructionAsync(input),\n ),\n proposeSubaccordUpdate: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getProposeSubaccordUpdateInstructionAsync(input),\n ),\n proposeUnpause: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getProposeUnpauseInstructionAsync(input),\n ),\n pruneJuror: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getPruneJurorInstructionAsync(input),\n ),\n reclaimSlot: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getReclaimSlotInstruction(input),\n ),\n reconcileStake: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getReconcileStakeInstruction(input),\n ),\n redraw: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getRedrawInstructionAsync(input),\n ),\n requestVrf: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getRequestVrfInstructionAsync(input),\n ),\n requestWithdraw: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getRequestWithdrawInstructionAsync(input),\n ),\n reveal: (input) =>\n addSelfPlanAndSendFunctions(client, getRevealInstruction(input)),\n settleRound: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getSettleRoundInstructionAsync(input),\n ),\n stake: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getStakeInstructionAsync(input),\n ),\n withdraw: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getWithdrawInstructionAsync(input),\n ),\n withdrawFees: (input) =>\n addSelfPlanAndSendFunctions(\n client,\n getWithdrawFeesInstructionAsync(input),\n ),\n },\n pdas: {\n accordState: findAccordStatePda,\n appealBond: findAppealBondPda,\n dispute: findDisputePda,\n subaccord: findSubaccordPda,\n pendingUpdate: findPendingUpdatePda,\n jurorStake: findJurorStakePda,\n programIdentity: findProgramIdentityPda,\n round: findRoundPda,\n },\n identifyAccount: identifyAccordAccount,\n identifyInstruction: identifyAccordInstruction,\n parseInstruction: parseAccordInstruction,\n },\n });\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n assertAccountExists,\n assertAccountsExist,\n combineCodec,\n decodeAccount,\n fetchEncodedAccount,\n fetchEncodedAccounts,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getBooleanDecoder,\n getBooleanEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getOptionDecoder,\n getOptionEncoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n transformEncoder,\n type Account,\n type Address,\n type Codec,\n type Decoder,\n type EncodedAccount,\n type Encoder,\n type FetchAccountConfig,\n type FetchAccountsConfig,\n type MaybeAccount,\n type MaybeEncodedAccount,\n type Option,\n type OptionOrNullable,\n type ReadonlyUint8Array,\n} from \"@solana/kit\";\n\nexport const ACCORD_STATE_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 218, 6, 196, 225, 25, 89, 50, 183,\n]);\n\nexport function getAccordStateDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n ACCORD_STATE_DISCRIMINATOR,\n );\n}\n\nexport type AccordState = {\n discriminator: ReadonlyUint8Array;\n /** The multisig/upgrade-authority permitted to pause and propose unpause. */\n authority: Address;\n paused: boolean;\n /**\n * `Some(slot)` once `propose_unpause` has armed an unpause; cleared on\n * `execute_unpause` (or on a fresh `pause`).\n */\n pendingUnpauseAfter: Option<bigint>;\n bump: number;\n /**\n * Reserved tail space for future field extensions. Zeroed at `init`;\n * must stay the last field — new fields are carved out of it without\n * moving existing offsets or resizing the account.\n */\n padding: ReadonlyUint8Array;\n};\n\nexport type AccordStateArgs = {\n /** The multisig/upgrade-authority permitted to pause and propose unpause. */\n authority: Address;\n paused: boolean;\n /**\n * `Some(slot)` once `propose_unpause` has armed an unpause; cleared on\n * `execute_unpause` (or on a fresh `pause`).\n */\n pendingUnpauseAfter: OptionOrNullable<number | bigint>;\n bump: number;\n /**\n * Reserved tail space for future field extensions. Zeroed at `init`;\n * must stay the last field — new fields are carved out of it without\n * moving existing offsets or resizing the account.\n */\n padding: ReadonlyUint8Array;\n};\n\n/** Gets the encoder for {@link AccordStateArgs} account data. */\nexport function getAccordStateEncoder(): Encoder<AccordStateArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"authority\", getAddressEncoder()],\n [\"paused\", getBooleanEncoder()],\n [\"pendingUnpauseAfter\", getOptionEncoder(getU64Encoder())],\n [\"bump\", getU8Encoder()],\n [\"padding\", fixEncoderSize(getBytesEncoder(), 64)],\n ]),\n (value) => ({ ...value, discriminator: ACCORD_STATE_DISCRIMINATOR }),\n );\n}\n\n/** Gets the decoder for {@link AccordState} account data. */\nexport function getAccordStateDecoder(): Decoder<AccordState> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"authority\", getAddressDecoder()],\n [\"paused\", getBooleanDecoder()],\n [\"pendingUnpauseAfter\", getOptionDecoder(getU64Decoder())],\n [\"bump\", getU8Decoder()],\n [\"padding\", fixDecoderSize(getBytesDecoder(), 64)],\n ]);\n}\n\n/** Gets the codec for {@link AccordState} account data. */\nexport function getAccordStateCodec(): Codec<AccordStateArgs, AccordState> {\n return combineCodec(getAccordStateEncoder(), getAccordStateDecoder());\n}\n\nexport function decodeAccordState<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress>,\n): Account<AccordState, TAddress>;\nexport function decodeAccordState<TAddress extends string = string>(\n encodedAccount: MaybeEncodedAccount<TAddress>,\n): MaybeAccount<AccordState, TAddress>;\nexport function decodeAccordState<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress> | MaybeEncodedAccount<TAddress>,\n): Account<AccordState, TAddress> | MaybeAccount<AccordState, TAddress> {\n return decodeAccount(\n encodedAccount as MaybeEncodedAccount<TAddress>,\n getAccordStateDecoder(),\n );\n}\n\nexport async function fetchAccordState<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<Account<AccordState, TAddress>> {\n const maybeAccount = await fetchMaybeAccordState(rpc, address, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeAccordState<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<MaybeAccount<AccordState, TAddress>> {\n const maybeAccount = await fetchEncodedAccount(rpc, address, config);\n return decodeAccordState(maybeAccount);\n}\n\nexport async function fetchAllAccordState(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<Account<AccordState>[]> {\n const maybeAccounts = await fetchAllMaybeAccordState(rpc, addresses, config);\n assertAccountsExist(maybeAccounts);\n return maybeAccounts;\n}\n\nexport async function fetchAllMaybeAccordState(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<MaybeAccount<AccordState>[]> {\n const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n return maybeAccounts.map((maybeAccount) => decodeAccordState(maybeAccount));\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n assertAccountExists,\n assertAccountsExist,\n combineCodec,\n decodeAccount,\n fetchEncodedAccount,\n fetchEncodedAccounts,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n getU32Decoder,\n getU32Encoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n transformEncoder,\n type Account,\n type Address,\n type EncodedAccount,\n type FetchAccountConfig,\n type FetchAccountsConfig,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type MaybeAccount,\n type MaybeEncodedAccount,\n type ReadonlyUint8Array,\n} from \"@solana/kit\";\n\nexport const APPEAL_BOND_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 84, 79, 238, 7, 49, 113, 35, 143,\n]);\n\nexport function getAppealBondDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(APPEAL_BOND_DISCRIMINATOR);\n}\n\nexport type AppealBond = {\n discriminator: ReadonlyUint8Array;\n dispute: Address;\n roundIdx: number;\n appellant: Address;\n amount: bigint;\n /**\n * Winning value of the round being appealed (set at `appeal` time).\n * Option index for `Plurality`, median for `Median` (u64 since ADR-0025).\n */\n priorResult: bigint;\n /**\n * Flip-bounty share credited by `finalize_dispute` when this appeal is\n * an aligned flipper (ADR-0030: `prior_result ≠ final_ruling` ∧ its own\n * round's result == final ruling), or one `fee_per_juror` unit on the\n * Failed path. Claimed as a top-up in `claim_appeal_refund`\n * (zero-on-claim, same idempotency as `amount`).\n */\n reward: bigint;\n bump: number;\n /**\n * Reserved tail space for future field extensions. Zeroed at `init`;\n * must stay the last field — new fields are carved out of it without\n * moving existing offsets or resizing the account.\n */\n padding: ReadonlyUint8Array;\n};\n\nexport type AppealBondArgs = {\n dispute: Address;\n roundIdx: number;\n appellant: Address;\n amount: number | bigint;\n /**\n * Winning value of the round being appealed (set at `appeal` time).\n * Option index for `Plurality`, median for `Median` (u64 since ADR-0025).\n */\n priorResult: number | bigint;\n /**\n * Flip-bounty share credited by `finalize_dispute` when this appeal is\n * an aligned flipper (ADR-0030: `prior_result ≠ final_ruling` ∧ its own\n * round's result == final ruling), or one `fee_per_juror` unit on the\n * Failed path. Claimed as a top-up in `claim_appeal_refund`\n * (zero-on-claim, same idempotency as `amount`).\n */\n reward: number | bigint;\n bump: number;\n /**\n * Reserved tail space for future field extensions. Zeroed at `init`;\n * must stay the last field — new fields are carved out of it without\n * moving existing offsets or resizing the account.\n */\n padding: ReadonlyUint8Array;\n};\n\n/** Gets the encoder for {@link AppealBondArgs} account data. */\nexport function getAppealBondEncoder(): FixedSizeEncoder<AppealBondArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"dispute\", getAddressEncoder()],\n [\"roundIdx\", getU32Encoder()],\n [\"appellant\", getAddressEncoder()],\n [\"amount\", getU64Encoder()],\n [\"priorResult\", getU64Encoder()],\n [\"reward\", getU64Encoder()],\n [\"bump\", getU8Encoder()],\n [\"padding\", fixEncoderSize(getBytesEncoder(), 56)],\n ]),\n (value) => ({ ...value, discriminator: APPEAL_BOND_DISCRIMINATOR }),\n );\n}\n\n/** Gets the decoder for {@link AppealBond} account data. */\nexport function getAppealBondDecoder(): FixedSizeDecoder<AppealBond> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"dispute\", getAddressDecoder()],\n [\"roundIdx\", getU32Decoder()],\n [\"appellant\", getAddressDecoder()],\n [\"amount\", getU64Decoder()],\n [\"priorResult\", getU64Decoder()],\n [\"reward\", getU64Decoder()],\n [\"bump\", getU8Decoder()],\n [\"padding\", fixDecoderSize(getBytesDecoder(), 56)],\n ]);\n}\n\n/** Gets the codec for {@link AppealBond} account data. */\nexport function getAppealBondCodec(): FixedSizeCodec<\n AppealBondArgs,\n AppealBond\n> {\n return combineCodec(getAppealBondEncoder(), getAppealBondDecoder());\n}\n\nexport function decodeAppealBond<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress>,\n): Account<AppealBond, TAddress>;\nexport function decodeAppealBond<TAddress extends string = string>(\n encodedAccount: MaybeEncodedAccount<TAddress>,\n): MaybeAccount<AppealBond, TAddress>;\nexport function decodeAppealBond<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress> | MaybeEncodedAccount<TAddress>,\n): Account<AppealBond, TAddress> | MaybeAccount<AppealBond, TAddress> {\n return decodeAccount(\n encodedAccount as MaybeEncodedAccount<TAddress>,\n getAppealBondDecoder(),\n );\n}\n\nexport async function fetchAppealBond<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<Account<AppealBond, TAddress>> {\n const maybeAccount = await fetchMaybeAppealBond(rpc, address, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeAppealBond<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<MaybeAccount<AppealBond, TAddress>> {\n const maybeAccount = await fetchEncodedAccount(rpc, address, config);\n return decodeAppealBond(maybeAccount);\n}\n\nexport async function fetchAllAppealBond(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<Account<AppealBond>[]> {\n const maybeAccounts = await fetchAllMaybeAppealBond(rpc, addresses, config);\n assertAccountsExist(maybeAccounts);\n return maybeAccounts;\n}\n\nexport async function fetchAllMaybeAppealBond(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<MaybeAccount<AppealBond>[]> {\n const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n return maybeAccounts.map((maybeAccount) => decodeAppealBond(maybeAccount));\n}\n\nexport function getAppealBondSize(): number {\n return 157;\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n assertAccountExists,\n assertAccountsExist,\n combineCodec,\n decodeAccount,\n fetchEncodedAccount,\n fetchEncodedAccounts,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getArrayDecoder,\n getArrayEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getI64Decoder,\n getI64Encoder,\n getOptionDecoder,\n getOptionEncoder,\n getStructDecoder,\n getStructEncoder,\n getU32Decoder,\n getU32Encoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n transformEncoder,\n type Account,\n type Address,\n type Codec,\n type Decoder,\n type EncodedAccount,\n type Encoder,\n type FetchAccountConfig,\n type FetchAccountsConfig,\n type MaybeAccount,\n type MaybeEncodedAccount,\n type Option,\n type OptionOrNullable,\n type ReadonlyUint8Array,\n} from \"@solana/kit\";\nimport {\n getCaseTermsDecoder,\n getCaseTermsEncoder,\n getDisputeStateDecoder,\n getDisputeStateEncoder,\n type CaseTerms,\n type CaseTermsArgs,\n type DisputeState,\n type DisputeStateArgs,\n} from \"../types\";\n\nexport const DISPUTE_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 36, 49, 241, 67, 40, 36, 241, 74,\n]);\n\nexport function getDisputeDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(DISPUTE_DISCRIMINATOR);\n}\n\nexport type Dispute = {\n discriminator: ReadonlyUint8Array;\n subaccord: Address;\n filer: Address;\n nonce: bigint;\n numOptions: number;\n options: Array<ReadonlyUint8Array>;\n /**\n * Per-round evidence commitments (ADR-0006 / milestone accord-qp7c).\n * Index 0 = round-0 (filing); each appeal round may optionally bring new\n * evidence at `[current_round + 1]`. `[0u8; 32]` sentinel = no new\n * evidence that round (jurors reuse prior rounds').\n */\n evidenceHashes: Array<ReadonlyUint8Array>;\n state: DisputeState;\n currentRound: number;\n /**\n * Filing-time snapshot of the Subaccord's economics (Ugly 6). Immutable\n * for the dispute's life; governance changes via ADR-0005 affect only\n * disputes filed after the change lands.\n */\n terms: CaseTerms;\n /**\n * The round's winning value once `state == Final`; `u64::MAX` until\n * then. For `Plurality` disputes this is the winning option index; for\n * `Median` disputes (ADR-0025) it is the final median — a u64\n * fixed-point value the Arbitrable interprets (e.g. base units of the\n * settlement mint, 6 decimals for USDC). Sentinel (not `Option<u64>`):\n * keeps the account fixed-size — the SBF `InitSpace` for `Option<T>`\n * undercounts its `Some` variant by the option tag, which made\n * `finalize_dispute`'s `Some` write overflow the account (Anchor\n * `AccountDidNotSerialize` #3004). Mirrors `Round`'s u64::MAX sentinels\n * for `reveals`/`result`.\n */\n finalRuling: bigint;\n /**\n * Unix timestamp stamped at the single `Final` transition\n * (`finalize_dispute`); `0` until then. Canonical \"verdict time\" anchor\n * for downstream consumers (e.g. the Betline primitive's bettor reveal\n * window, which must open exactly when the dispute finalizes). `0` is a\n * safe sentinel: real Unix time is never 0 for on-chain disputes.\n */\n finalizedAt: bigint;\n /**\n * Round-0 juror fee pot deposited by the filer at creation\n * (`min_jury_size · fee_per_juror` — the juror-compensation pot only;\n * ADR-0029 settlement consumes it, the Failed path refunds it).\n * ADR-0030: the filer tenders one EXTRA `fee_per_juror` unit at filing;\n * that unit lives in `bounty_pool`, never here, so settlement and refund\n * math are untouched by the bounty. Appeal-round fees live in their\n * `AppealBond`, NOT here (bean accord-xftx).\n */\n feePaid: bigint;\n /**\n * VRF result committed once via `commit_vrf` (ADR-0009). `None` until\n * committed; `Some(vrf_result)` after. The draw reads this; the caller\n * cannot swap it between retries.\n */\n committedVrf: Option<ReadonlyUint8Array>;\n /**\n * Accumulator root frozen atomically when the VRF lands in\n * `commit_vrf_callback` (ADR-0012). All `draw_seat` calls for every round\n * of this dispute select against this one root (per-seat coherence +\n * manipulation resistance). `[0;32]` until frozen; readable once\n * `committed_vrf.is_some()`.\n */\n frozenRoot: ReadonlyUint8Array;\n /**\n * Total stake captured with `frozen_root` at freeze time. Drives\n * sortition (`r_i % frozen_total_stake`).\n */\n frozenTotalStake: bigint;\n /**\n * Unix timestamp at `create_dispute` (Ugly 4). Drives the pre-draw\n * `cancel_dispute` timeout: if the dispute has not been drawn within\n * `PRE_DRAW_CANCEL_TIMEOUT_SECS`, any cranker may cancel + refund the filer.\n */\n filedAt: bigint;\n bump: number;\n /**\n * Seats landed for the CURRENT round so far (H-2, security review\n * 2026-08-19). Maintained by `draw_seat` (mirrors `round.juror_count`\n * after each seat) and reset to 0 by `appeal` (fresh round) and the\n * `redraw` clear. It is the on-chain PROOF that a partially drawn Round\n * account exists while the dispute still sits in `Created` — without it,\n * `cancel_dispute`'s pre-draw branch cannot tell \"no seats drawn\" (no\n * Round PDA exists, nothing to pass) from \"cranker omitted the accounts\"\n * (jurors strand), so it cannot safely require them. Carved out of the\n * former padding: account size and all prior field offsets unchanged.\n */\n drawnSeats: number;\n /**\n * Flip-bounty pool (ADR-0030): one `fee_per_juror` unit banked at\n * creation (the filer's +1) plus one per appeal (each appellant's +1).\n * Tokens custodyed in the shared `fee_vault`; disposition at\n * `finalize_dispute` (Final) or the Failed transitions (per-source\n * refund) — never before terminal state. Carved out of the former\n * padding like `drawn_seats`: account size and all prior field offsets\n * unchanged.\n */\n bountyPool: bigint;\n /**\n * Reserved tail space for future field extensions. Zeroed at `init`;\n * must stay the last field — new fields are carved out of it without\n * moving existing offsets or resizing the account.\n */\n padding: ReadonlyUint8Array;\n};\n\nexport type DisputeArgs = {\n subaccord: Address;\n filer: Address;\n nonce: number | bigint;\n numOptions: number;\n options: Array<ReadonlyUint8Array>;\n /**\n * Per-round evidence commitments (ADR-0006 / milestone accord-qp7c).\n * Index 0 = round-0 (filing); each appeal round may optionally bring new\n * evidence at `[current_round + 1]`. `[0u8; 32]` sentinel = no new\n * evidence that round (jurors reuse prior rounds').\n */\n evidenceHashes: Array<ReadonlyUint8Array>;\n state: DisputeStateArgs;\n currentRound: number;\n /**\n * Filing-time snapshot of the Subaccord's economics (Ugly 6). Immutable\n * for the dispute's life; governance changes via ADR-0005 affect only\n * disputes filed after the change lands.\n */\n terms: CaseTermsArgs;\n /**\n * The round's winning value once `state == Final`; `u64::MAX` until\n * then. For `Plurality` disputes this is the winning option index; for\n * `Median` disputes (ADR-0025) it is the final median — a u64\n * fixed-point value the Arbitrable interprets (e.g. base units of the\n * settlement mint, 6 decimals for USDC). Sentinel (not `Option<u64>`):\n * keeps the account fixed-size — the SBF `InitSpace` for `Option<T>`\n * undercounts its `Some` variant by the option tag, which made\n * `finalize_dispute`'s `Some` write overflow the account (Anchor\n * `AccountDidNotSerialize` #3004). Mirrors `Round`'s u64::MAX sentinels\n * for `reveals`/`result`.\n */\n finalRuling: number | bigint;\n /**\n * Unix timestamp stamped at the single `Final` transition\n * (`finalize_dispute`); `0` until then. Canonical \"verdict time\" anchor\n * for downstream consumers (e.g. the Betline primitive's bettor reveal\n * window, which must open exactly when the dispute finalizes). `0` is a\n * safe sentinel: real Unix time is never 0 for on-chain disputes.\n */\n finalizedAt: number | bigint;\n /**\n * Round-0 juror fee pot deposited by the filer at creation\n * (`min_jury_size · fee_per_juror` — the juror-compensation pot only;\n * ADR-0029 settlement consumes it, the Failed path refunds it).\n * ADR-0030: the filer tenders one EXTRA `fee_per_juror` unit at filing;\n * that unit lives in `bounty_pool`, never here, so settlement and refund\n * math are untouched by the bounty. Appeal-round fees live in their\n * `AppealBond`, NOT here (bean accord-xftx).\n */\n feePaid: number | bigint;\n /**\n * VRF result committed once via `commit_vrf` (ADR-0009). `None` until\n * committed; `Some(vrf_result)` after. The draw reads this; the caller\n * cannot swap it between retries.\n */\n committedVrf: OptionOrNullable<ReadonlyUint8Array>;\n /**\n * Accumulator root frozen atomically when the VRF lands in\n * `commit_vrf_callback` (ADR-0012). All `draw_seat` calls for every round\n * of this dispute select against this one root (per-seat coherence +\n * manipulation resistance). `[0;32]` until frozen; readable once\n * `committed_vrf.is_some()`.\n */\n frozenRoot: ReadonlyUint8Array;\n /**\n * Total stake captured with `frozen_root` at freeze time. Drives\n * sortition (`r_i % frozen_total_stake`).\n */\n frozenTotalStake: number | bigint;\n /**\n * Unix timestamp at `create_dispute` (Ugly 4). Drives the pre-draw\n * `cancel_dispute` timeout: if the dispute has not been drawn within\n * `PRE_DRAW_CANCEL_TIMEOUT_SECS`, any cranker may cancel + refund the filer.\n */\n filedAt: number | bigint;\n bump: number;\n /**\n * Seats landed for the CURRENT round so far (H-2, security review\n * 2026-08-19). Maintained by `draw_seat` (mirrors `round.juror_count`\n * after each seat) and reset to 0 by `appeal` (fresh round) and the\n * `redraw` clear. It is the on-chain PROOF that a partially drawn Round\n * account exists while the dispute still sits in `Created` — without it,\n * `cancel_dispute`'s pre-draw branch cannot tell \"no seats drawn\" (no\n * Round PDA exists, nothing to pass) from \"cranker omitted the accounts\"\n * (jurors strand), so it cannot safely require them. Carved out of the\n * former padding: account size and all prior field offsets unchanged.\n */\n drawnSeats: number;\n /**\n * Flip-bounty pool (ADR-0030): one `fee_per_juror` unit banked at\n * creation (the filer's +1) plus one per appeal (each appellant's +1).\n * Tokens custodyed in the shared `fee_vault`; disposition at\n * `finalize_dispute` (Final) or the Failed transitions (per-source\n * refund) — never before terminal state. Carved out of the former\n * padding like `drawn_seats`: account size and all prior field offsets\n * unchanged.\n */\n bountyPool: number | bigint;\n /**\n * Reserved tail space for future field extensions. Zeroed at `init`;\n * must stay the last field — new fields are carved out of it without\n * moving existing offsets or resizing the account.\n */\n padding: ReadonlyUint8Array;\n};\n\n/** Gets the encoder for {@link DisputeArgs} account data. */\nexport function getDisputeEncoder(): Encoder<DisputeArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"subaccord\", getAddressEncoder()],\n [\"filer\", getAddressEncoder()],\n [\"nonce\", getU64Encoder()],\n [\"numOptions\", getU8Encoder()],\n [\n \"options\",\n getArrayEncoder(fixEncoderSize(getBytesEncoder(), 32), { size: 8 }),\n ],\n [\n \"evidenceHashes\",\n getArrayEncoder(fixEncoderSize(getBytesEncoder(), 32), { size: 4 }),\n ],\n [\"state\", getDisputeStateEncoder()],\n [\"currentRound\", getU32Encoder()],\n [\"terms\", getCaseTermsEncoder()],\n [\"finalRuling\", getU64Encoder()],\n [\"finalizedAt\", getI64Encoder()],\n [\"feePaid\", getU64Encoder()],\n [\"committedVrf\", getOptionEncoder(fixEncoderSize(getBytesEncoder(), 32))],\n [\"frozenRoot\", fixEncoderSize(getBytesEncoder(), 32)],\n [\"frozenTotalStake\", getU64Encoder()],\n [\"filedAt\", getI64Encoder()],\n [\"bump\", getU8Encoder()],\n [\"drawnSeats\", getU32Encoder()],\n [\"bountyPool\", getU64Encoder()],\n [\"padding\", fixEncoderSize(getBytesEncoder(), 52)],\n ]),\n (value) => ({ ...value, discriminator: DISPUTE_DISCRIMINATOR }),\n );\n}\n\n/** Gets the decoder for {@link Dispute} account data. */\nexport function getDisputeDecoder(): Decoder<Dispute> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"subaccord\", getAddressDecoder()],\n [\"filer\", getAddressDecoder()],\n [\"nonce\", getU64Decoder()],\n [\"numOptions\", getU8Decoder()],\n [\n \"options\",\n getArrayDecoder(fixDecoderSize(getBytesDecoder(), 32), { size: 8 }),\n ],\n [\n \"evidenceHashes\",\n getArrayDecoder(fixDecoderSize(getBytesDecoder(), 32), { size: 4 }),\n ],\n [\"state\", getDisputeStateDecoder()],\n [\"currentRound\", getU32Decoder()],\n [\"terms\", getCaseTermsDecoder()],\n [\"finalRuling\", getU64Decoder()],\n [\"finalizedAt\", getI64Decoder()],\n [\"feePaid\", getU64Decoder()],\n [\"committedVrf\", getOptionDecoder(fixDecoderSize(getBytesDecoder(), 32))],\n [\"frozenRoot\", fixDecoderSize(getBytesDecoder(), 32)],\n [\"frozenTotalStake\", getU64Decoder()],\n [\"filedAt\", getI64Decoder()],\n [\"bump\", getU8Decoder()],\n [\"drawnSeats\", getU32Decoder()],\n [\"bountyPool\", getU64Decoder()],\n [\"padding\", fixDecoderSize(getBytesDecoder(), 52)],\n ]);\n}\n\n/** Gets the codec for {@link Dispute} account data. */\nexport function getDisputeCodec(): Codec<DisputeArgs, Dispute> {\n return combineCodec(getDisputeEncoder(), getDisputeDecoder());\n}\n\nexport function decodeDispute<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress>,\n): Account<Dispute, TAddress>;\nexport function decodeDispute<TAddress extends string = string>(\n encodedAccount: MaybeEncodedAccount<TAddress>,\n): MaybeAccount<Dispute, TAddress>;\nexport function decodeDispute<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress> | MaybeEncodedAccount<TAddress>,\n): Account<Dispute, TAddress> | MaybeAccount<Dispute, TAddress> {\n return decodeAccount(\n encodedAccount as MaybeEncodedAccount<TAddress>,\n getDisputeDecoder(),\n );\n}\n\nexport async function fetchDispute<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<Account<Dispute, TAddress>> {\n const maybeAccount = await fetchMaybeDispute(rpc, address, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeDispute<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<MaybeAccount<Dispute, TAddress>> {\n const maybeAccount = await fetchEncodedAccount(rpc, address, config);\n return decodeDispute(maybeAccount);\n}\n\nexport async function fetchAllDispute(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<Account<Dispute>[]> {\n const maybeAccounts = await fetchAllMaybeDispute(rpc, addresses, config);\n assertAccountsExist(maybeAccounts);\n return maybeAccounts;\n}\n\nexport async function fetchAllMaybeDispute(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<MaybeAccount<Dispute>[]> {\n const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n return maybeAccounts.map((maybeAccount) => decodeDispute(maybeAccount));\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n getEnumDecoder,\n getEnumEncoder,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n} from \"@solana/kit\";\n\n/**\n * Dispute-kit aggregation rule (ADR-0019). `Plurality` counts option-index\n * votes; `Median` (ADR-0025) tallies scalar u64 votes by median. The rule\n * is frozen onto `CaseTerms` at filing time and `finalize_round` tallies off\n * it (`match dispute.terms.aggregation`). The match carries no wildcard arm,\n * so adding a variant is a compile error until its tally arm lands — the\n * extension seam is real and machine-checked, not aspirational.\n */\nexport enum Aggregation {\n Plurality,\n Median,\n}\n\nexport type AggregationArgs = Aggregation;\n\nexport function getAggregationEncoder(): FixedSizeEncoder<AggregationArgs> {\n return getEnumEncoder(Aggregation);\n}\n\nexport function getAggregationDecoder(): FixedSizeDecoder<Aggregation> {\n return getEnumDecoder(Aggregation);\n}\n\nexport function getAggregationCodec(): FixedSizeCodec<\n AggregationArgs,\n Aggregation\n> {\n return combineCodec(getAggregationEncoder(), getAggregationDecoder());\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n getStructDecoder,\n getStructEncoder,\n getU16Decoder,\n getU16Encoder,\n getU32Decoder,\n getU32Encoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n} from \"@solana/kit\";\nimport {\n getAggregationDecoder,\n getAggregationEncoder,\n getShortfallPolicyDecoder,\n getShortfallPolicyEncoder,\n type Aggregation,\n type AggregationArgs,\n type ShortfallPolicy,\n type ShortfallPolicyArgs,\n} from \".\";\n\n/**\n * Economics-relevant Subaccord params **frozen at `create_dispute` time**\n * (CONCEPT-REVIEW Ugly 6 / bean accord-4e7p). Every post-filing instruction\n * (`post_snapshot`, `draw`, `finalize_dispute`, `appeal`) reads this frozen\n * copy, never the live `Subaccord`. The 48h timelock (ADR-0005) then governs\n * only FUTURE disputes; an active case is immune to governance changes for\n * its entire life. This is the arbitration-contract principle: parties cannot\n * consent to a process whose economically load-bearing rules may shift\n * ex-post.\n */\nexport type CaseTerms = {\n alphaBps: number;\n minStake: bigint;\n feePerJuror: bigint;\n reviewWindow: bigint;\n commitWindow: bigint;\n revealWindow: bigint;\n /** Appeal window (ADR-0022). Per-Subaccord, frozen at filing. */\n appealWindow: bigint;\n maxAppeals: number;\n /**\n * Frozen round-1 panel size (accord-9q3e). Mirrors `Subaccord.min_jury_size`\n * at filing time; drives `panel_size_for_round` for every round of this dispute.\n */\n minJurySize: number;\n aggregation: Aggregation;\n /**\n * Frozen reveal-quorum fraction (ADR-0021). Mirrors\n * `Subaccord.reveal_threshold_bps` at filing time.\n */\n revealThresholdBps: number;\n /** Frozen shortfall policy (ADR-0021). */\n shortfallPolicy: ShortfallPolicy;\n /** Frozen redraw cap (ADR-0021). */\n maxDrawAttempts: number;\n /**\n * Frozen coherence tolerance (ADR-0025). Mirrors\n * `Subaccord.coherence_tol_bps` at filing time; read only on the\n * `Median` path by `settle_round_accounts`.\n */\n coherenceTolBps: number;\n};\n\nexport type CaseTermsArgs = {\n alphaBps: number;\n minStake: number | bigint;\n feePerJuror: number | bigint;\n reviewWindow: number | bigint;\n commitWindow: number | bigint;\n revealWindow: number | bigint;\n /** Appeal window (ADR-0022). Per-Subaccord, frozen at filing. */\n appealWindow: number | bigint;\n maxAppeals: number;\n /**\n * Frozen round-1 panel size (accord-9q3e). Mirrors `Subaccord.min_jury_size`\n * at filing time; drives `panel_size_for_round` for every round of this dispute.\n */\n minJurySize: number;\n aggregation: AggregationArgs;\n /**\n * Frozen reveal-quorum fraction (ADR-0021). Mirrors\n * `Subaccord.reveal_threshold_bps` at filing time.\n */\n revealThresholdBps: number;\n /** Frozen shortfall policy (ADR-0021). */\n shortfallPolicy: ShortfallPolicyArgs;\n /** Frozen redraw cap (ADR-0021). */\n maxDrawAttempts: number;\n /**\n * Frozen coherence tolerance (ADR-0025). Mirrors\n * `Subaccord.coherence_tol_bps` at filing time; read only on the\n * `Median` path by `settle_round_accounts`.\n */\n coherenceTolBps: number;\n};\n\nexport function getCaseTermsEncoder(): FixedSizeEncoder<CaseTermsArgs> {\n return getStructEncoder([\n [\"alphaBps\", getU16Encoder()],\n [\"minStake\", getU64Encoder()],\n [\"feePerJuror\", getU64Encoder()],\n [\"reviewWindow\", getU64Encoder()],\n [\"commitWindow\", getU64Encoder()],\n [\"revealWindow\", getU64Encoder()],\n [\"appealWindow\", getU64Encoder()],\n [\"maxAppeals\", getU8Encoder()],\n [\"minJurySize\", getU32Encoder()],\n [\"aggregation\", getAggregationEncoder()],\n [\"revealThresholdBps\", getU16Encoder()],\n [\"shortfallPolicy\", getShortfallPolicyEncoder()],\n [\"maxDrawAttempts\", getU8Encoder()],\n [\"coherenceTolBps\", getU16Encoder()],\n ]);\n}\n\nexport function getCaseTermsDecoder(): FixedSizeDecoder<CaseTerms> {\n return getStructDecoder([\n [\"alphaBps\", getU16Decoder()],\n [\"minStake\", getU64Decoder()],\n [\"feePerJuror\", getU64Decoder()],\n [\"reviewWindow\", getU64Decoder()],\n [\"commitWindow\", getU64Decoder()],\n [\"revealWindow\", getU64Decoder()],\n [\"appealWindow\", getU64Decoder()],\n [\"maxAppeals\", getU8Decoder()],\n [\"minJurySize\", getU32Decoder()],\n [\"aggregation\", getAggregationDecoder()],\n [\"revealThresholdBps\", getU16Decoder()],\n [\"shortfallPolicy\", getShortfallPolicyDecoder()],\n [\"maxDrawAttempts\", getU8Decoder()],\n [\"coherenceTolBps\", getU16Decoder()],\n ]);\n}\n\nexport function getCaseTermsCodec(): FixedSizeCodec<CaseTermsArgs, CaseTerms> {\n return combineCodec(getCaseTermsEncoder(), getCaseTermsDecoder());\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n getEnumDecoder,\n getEnumEncoder,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n} from \"@solana/kit\";\n\n/**\n * Dispute lifecycle (SPEC state machine). A permissionless crank advances\n * states when their windows elapse.\n *\n * `Failed` is the liveness-escape terminal state (CONCEPT-REVIEW Ugly 4 /\n * bean accord-18fb): `cancel_dispute` transitions a stalled dispute here,\n * refunds the filer's round-1 fee, and releases the current round's\n * `active_draws`. It is terminal — no lifecycle instruction accepts it.\n */\nexport enum DisputeState {\n Created,\n Drawn,\n Review,\n Commit,\n Reveal,\n RoundResolved,\n Final,\n Closed,\n Failed,\n RedrawEligible,\n}\n\nexport type DisputeStateArgs = DisputeState;\n\nexport function getDisputeStateEncoder(): FixedSizeEncoder<DisputeStateArgs> {\n return getEnumEncoder(DisputeState);\n}\n\nexport function getDisputeStateDecoder(): FixedSizeDecoder<DisputeState> {\n return getEnumDecoder(DisputeState);\n}\n\nexport function getDisputeStateCodec(): FixedSizeCodec<\n DisputeStateArgs,\n DisputeState\n> {\n return combineCodec(getDisputeStateEncoder(), getDisputeStateDecoder());\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n getAddressDecoder,\n getAddressEncoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n} from \"@solana/kit\";\n\n/**\n * A single leaf of the subtree-sum accumulator (ADR-0012). The leaf is hashed\n * as `H(juror || stake_le)`. The cumulative-from-left prefix used for\n * sortition is reconstructed on-chain from the authenticated sibling sums\n * along the proof path (no `cum_after` carried on the leaf — the subtree-sum\n * form makes it derivable, unlike ADR-0009's O(N) cumulative form).\n */\nexport type LeafClaim = { juror: Address; stake: bigint };\n\nexport type LeafClaimArgs = { juror: Address; stake: number | bigint };\n\nexport function getLeafClaimEncoder(): FixedSizeEncoder<LeafClaimArgs> {\n return getStructEncoder([\n [\"juror\", getAddressEncoder()],\n [\"stake\", getU64Encoder()],\n ]);\n}\n\nexport function getLeafClaimDecoder(): FixedSizeDecoder<LeafClaim> {\n return getStructDecoder([\n [\"juror\", getAddressDecoder()],\n [\"stake\", getU64Decoder()],\n ]);\n}\n\nexport function getLeafClaimCodec(): FixedSizeCodec<LeafClaimArgs, LeafClaim> {\n return combineCodec(getLeafClaimEncoder(), getLeafClaimDecoder());\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type ReadonlyUint8Array,\n} from \"@solana/kit\";\n\n/**\n * Merkle-Sum Tree proof element (ADR-0012 subtree-sum form). Each level of the\n * proof carries the sibling subtree's hash AND its stake sum. Sums are bound\n * into every node hash, so stake-weighted ranges are cryptographically\n * authenticated (CONCEPT-REVIEW Bad 5 fixed by construction).\n */\nexport type MSTNode = { siblingHash: ReadonlyUint8Array; siblingSum: bigint };\n\nexport type MSTNodeArgs = {\n siblingHash: ReadonlyUint8Array;\n siblingSum: number | bigint;\n};\n\nexport function getMSTNodeEncoder(): FixedSizeEncoder<MSTNodeArgs> {\n return getStructEncoder([\n [\"siblingHash\", fixEncoderSize(getBytesEncoder(), 32)],\n [\"siblingSum\", getU64Encoder()],\n ]);\n}\n\nexport function getMSTNodeDecoder(): FixedSizeDecoder<MSTNode> {\n return getStructDecoder([\n [\"siblingHash\", fixDecoderSize(getBytesDecoder(), 32)],\n [\"siblingSum\", getU64Decoder()],\n ]);\n}\n\nexport function getMSTNodeCodec(): FixedSizeCodec<MSTNodeArgs, MSTNode> {\n return combineCodec(getMSTNodeEncoder(), getMSTNodeDecoder());\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n getEnumDecoder,\n getEnumEncoder,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n} from \"@solana/kit\";\n\n/**\n * What happens when a round falls short of its reveal quorum (ADR-0021). v1\n * ships a single variant — `Redraw` reconvenes the same-size panel with fresh\n * seats (via an orthogonal `draw_attempt`), slashing the no-shows; after\n * `max_draw_attempts` the dispute transitions to `Failed`. Future variants\n * (e.g. `Fail`) ship as new enum entries.\n */\nexport enum ShortfallPolicy {\n Redraw,\n}\n\nexport type ShortfallPolicyArgs = ShortfallPolicy;\n\nexport function getShortfallPolicyEncoder(): FixedSizeEncoder<ShortfallPolicyArgs> {\n return getEnumEncoder(ShortfallPolicy);\n}\n\nexport function getShortfallPolicyDecoder(): FixedSizeDecoder<ShortfallPolicy> {\n return getEnumDecoder(ShortfallPolicy);\n}\n\nexport function getShortfallPolicyCodec(): FixedSizeCodec<\n ShortfallPolicyArgs,\n ShortfallPolicy\n> {\n return combineCodec(getShortfallPolicyEncoder(), getShortfallPolicyDecoder());\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n getAddressDecoder,\n getAddressEncoder,\n getDiscriminatedUnionDecoder,\n getDiscriminatedUnionEncoder,\n getStructDecoder,\n getStructEncoder,\n getTupleDecoder,\n getTupleEncoder,\n getU16Decoder,\n getU16Encoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n type GetDiscriminatedUnionVariant,\n type GetDiscriminatedUnionVariantContent,\n} from \"@solana/kit\";\n\n/**\n * Tagged Subaccord parameter update. `domain_ref` and `evidence_spec` are\n * immutable and intentionally absent (ADR-0005). Variants are append-only:\n * borsh encodes the variant index, so a new variant MUST be added at the END\n * (ADR-0028) — in-flight `PendingUpdate` accounts deserialize by index.\n */\nexport type UpdatePayload =\n | { __kind: \"MinStake\"; fields: readonly [bigint] }\n | { __kind: \"AlphaBps\"; fields: readonly [number] }\n | { __kind: \"ReviewWindow\"; fields: readonly [bigint] }\n | { __kind: \"CommitWindow\"; fields: readonly [bigint] }\n | { __kind: \"RevealWindow\"; fields: readonly [bigint] }\n | { __kind: \"AppealWindow\"; fields: readonly [bigint] }\n | { __kind: \"MaxAppeals\"; fields: readonly [number] }\n | { __kind: \"FeePerJuror\"; fields: readonly [bigint] }\n | { __kind: \"Authority\"; fields: readonly [Address] }\n | { __kind: \"EvidenceOperator\"; fields: readonly [Address] }\n | { __kind: \"RevealThresholdBps\"; fields: readonly [number] }\n | { __kind: \"MaxDrawAttempts\"; fields: readonly [number] };\n\nexport type UpdatePayloadArgs =\n | { __kind: \"MinStake\"; fields: readonly [number | bigint] }\n | { __kind: \"AlphaBps\"; fields: readonly [number] }\n | { __kind: \"ReviewWindow\"; fields: readonly [number | bigint] }\n | { __kind: \"CommitWindow\"; fields: readonly [number | bigint] }\n | { __kind: \"RevealWindow\"; fields: readonly [number | bigint] }\n | { __kind: \"AppealWindow\"; fields: readonly [number | bigint] }\n | { __kind: \"MaxAppeals\"; fields: readonly [number] }\n | { __kind: \"FeePerJuror\"; fields: readonly [number | bigint] }\n | { __kind: \"Authority\"; fields: readonly [Address] }\n | { __kind: \"EvidenceOperator\"; fields: readonly [Address] }\n | { __kind: \"RevealThresholdBps\"; fields: readonly [number] }\n | { __kind: \"MaxDrawAttempts\"; fields: readonly [number] };\n\nexport function getUpdatePayloadEncoder(): Encoder<UpdatePayloadArgs> {\n return getDiscriminatedUnionEncoder([\n [\n \"MinStake\",\n getStructEncoder([[\"fields\", getTupleEncoder([getU64Encoder()])]]),\n ],\n [\n \"AlphaBps\",\n getStructEncoder([[\"fields\", getTupleEncoder([getU16Encoder()])]]),\n ],\n [\n \"ReviewWindow\",\n getStructEncoder([[\"fields\", getTupleEncoder([getU64Encoder()])]]),\n ],\n [\n \"CommitWindow\",\n getStructEncoder([[\"fields\", getTupleEncoder([getU64Encoder()])]]),\n ],\n [\n \"RevealWindow\",\n getStructEncoder([[\"fields\", getTupleEncoder([getU64Encoder()])]]),\n ],\n [\n \"AppealWindow\",\n getStructEncoder([[\"fields\", getTupleEncoder([getU64Encoder()])]]),\n ],\n [\n \"MaxAppeals\",\n getStructEncoder([[\"fields\", getTupleEncoder([getU8Encoder()])]]),\n ],\n [\n \"FeePerJuror\",\n getStructEncoder([[\"fields\", getTupleEncoder([getU64Encoder()])]]),\n ],\n [\n \"Authority\",\n getStructEncoder([[\"fields\", getTupleEncoder([getAddressEncoder()])]]),\n ],\n [\n \"EvidenceOperator\",\n getStructEncoder([[\"fields\", getTupleEncoder([getAddressEncoder()])]]),\n ],\n [\n \"RevealThresholdBps\",\n getStructEncoder([[\"fields\", getTupleEncoder([getU16Encoder()])]]),\n ],\n [\n \"MaxDrawAttempts\",\n getStructEncoder([[\"fields\", getTupleEncoder([getU8Encoder()])]]),\n ],\n ]);\n}\n\nexport function getUpdatePayloadDecoder(): Decoder<UpdatePayload> {\n return getDiscriminatedUnionDecoder([\n [\n \"MinStake\",\n getStructDecoder([[\"fields\", getTupleDecoder([getU64Decoder()])]]),\n ],\n [\n \"AlphaBps\",\n getStructDecoder([[\"fields\", getTupleDecoder([getU16Decoder()])]]),\n ],\n [\n \"ReviewWindow\",\n getStructDecoder([[\"fields\", getTupleDecoder([getU64Decoder()])]]),\n ],\n [\n \"CommitWindow\",\n getStructDecoder([[\"fields\", getTupleDecoder([getU64Decoder()])]]),\n ],\n [\n \"RevealWindow\",\n getStructDecoder([[\"fields\", getTupleDecoder([getU64Decoder()])]]),\n ],\n [\n \"AppealWindow\",\n getStructDecoder([[\"fields\", getTupleDecoder([getU64Decoder()])]]),\n ],\n [\n \"MaxAppeals\",\n getStructDecoder([[\"fields\", getTupleDecoder([getU8Decoder()])]]),\n ],\n [\n \"FeePerJuror\",\n getStructDecoder([[\"fields\", getTupleDecoder([getU64Decoder()])]]),\n ],\n [\n \"Authority\",\n getStructDecoder([[\"fields\", getTupleDecoder([getAddressDecoder()])]]),\n ],\n [\n \"EvidenceOperator\",\n getStructDecoder([[\"fields\", getTupleDecoder([getAddressDecoder()])]]),\n ],\n [\n \"RevealThresholdBps\",\n getStructDecoder([[\"fields\", getTupleDecoder([getU16Decoder()])]]),\n ],\n [\n \"MaxDrawAttempts\",\n getStructDecoder([[\"fields\", getTupleDecoder([getU8Decoder()])]]),\n ],\n ]);\n}\n\nexport function getUpdatePayloadCodec(): Codec<\n UpdatePayloadArgs,\n UpdatePayload\n> {\n return combineCodec(getUpdatePayloadEncoder(), getUpdatePayloadDecoder());\n}\n\n// Data Enum Helpers.\nexport function updatePayload(\n kind: \"MinStake\",\n data: GetDiscriminatedUnionVariantContent<\n UpdatePayloadArgs,\n \"__kind\",\n \"MinStake\"\n >[\"fields\"],\n): GetDiscriminatedUnionVariant<UpdatePayloadArgs, \"__kind\", \"MinStake\">;\nexport function updatePayload(\n kind: \"AlphaBps\",\n data: GetDiscriminatedUnionVariantContent<\n UpdatePayloadArgs,\n \"__kind\",\n \"AlphaBps\"\n >[\"fields\"],\n): GetDiscriminatedUnionVariant<UpdatePayloadArgs, \"__kind\", \"AlphaBps\">;\nexport function updatePayload(\n kind: \"ReviewWindow\",\n data: GetDiscriminatedUnionVariantContent<\n UpdatePayloadArgs,\n \"__kind\",\n \"ReviewWindow\"\n >[\"fields\"],\n): GetDiscriminatedUnionVariant<UpdatePayloadArgs, \"__kind\", \"ReviewWindow\">;\nexport function updatePayload(\n kind: \"CommitWindow\",\n data: GetDiscriminatedUnionVariantContent<\n UpdatePayloadArgs,\n \"__kind\",\n \"CommitWindow\"\n >[\"fields\"],\n): GetDiscriminatedUnionVariant<UpdatePayloadArgs, \"__kind\", \"CommitWindow\">;\nexport function updatePayload(\n kind: \"RevealWindow\",\n data: GetDiscriminatedUnionVariantContent<\n UpdatePayloadArgs,\n \"__kind\",\n \"RevealWindow\"\n >[\"fields\"],\n): GetDiscriminatedUnionVariant<UpdatePayloadArgs, \"__kind\", \"RevealWindow\">;\nexport function updatePayload(\n kind: \"AppealWindow\",\n data: GetDiscriminatedUnionVariantContent<\n UpdatePayloadArgs,\n \"__kind\",\n \"AppealWindow\"\n >[\"fields\"],\n): GetDiscriminatedUnionVariant<UpdatePayloadArgs, \"__kind\", \"AppealWindow\">;\nexport function updatePayload(\n kind: \"MaxAppeals\",\n data: GetDiscriminatedUnionVariantContent<\n UpdatePayloadArgs,\n \"__kind\",\n \"MaxAppeals\"\n >[\"fields\"],\n): GetDiscriminatedUnionVariant<UpdatePayloadArgs, \"__kind\", \"MaxAppeals\">;\nexport function updatePayload(\n kind: \"FeePerJuror\",\n data: GetDiscriminatedUnionVariantContent<\n UpdatePayloadArgs,\n \"__kind\",\n \"FeePerJuror\"\n >[\"fields\"],\n): GetDiscriminatedUnionVariant<UpdatePayloadArgs, \"__kind\", \"FeePerJuror\">;\nexport function updatePayload(\n kind: \"Authority\",\n data: GetDiscriminatedUnionVariantContent<\n UpdatePayloadArgs,\n \"__kind\",\n \"Authority\"\n >[\"fields\"],\n): GetDiscriminatedUnionVariant<UpdatePayloadArgs, \"__kind\", \"Authority\">;\nexport function updatePayload(\n kind: \"EvidenceOperator\",\n data: GetDiscriminatedUnionVariantContent<\n UpdatePayloadArgs,\n \"__kind\",\n \"EvidenceOperator\"\n >[\"fields\"],\n): GetDiscriminatedUnionVariant<\n UpdatePayloadArgs,\n \"__kind\",\n \"EvidenceOperator\"\n>;\nexport function updatePayload(\n kind: \"RevealThresholdBps\",\n data: GetDiscriminatedUnionVariantContent<\n UpdatePayloadArgs,\n \"__kind\",\n \"RevealThresholdBps\"\n >[\"fields\"],\n): GetDiscriminatedUnionVariant<\n UpdatePayloadArgs,\n \"__kind\",\n \"RevealThresholdBps\"\n>;\nexport function updatePayload(\n kind: \"MaxDrawAttempts\",\n data: GetDiscriminatedUnionVariantContent<\n UpdatePayloadArgs,\n \"__kind\",\n \"MaxDrawAttempts\"\n >[\"fields\"],\n): GetDiscriminatedUnionVariant<UpdatePayloadArgs, \"__kind\", \"MaxDrawAttempts\">;\nexport function updatePayload<K extends UpdatePayloadArgs[\"__kind\"], Data>(\n kind: K,\n data?: Data,\n) {\n return Array.isArray(data)\n ? { __kind: kind, fields: data }\n : { __kind: kind, ...(data ?? {}) };\n}\n\nexport function isUpdatePayload<K extends UpdatePayload[\"__kind\"]>(\n kind: K,\n value: UpdatePayload,\n): value is UpdatePayload & { __kind: K } {\n return value.__kind === kind;\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n assertAccountExists,\n assertAccountsExist,\n combineCodec,\n decodeAccount,\n fetchEncodedAccount,\n fetchEncodedAccounts,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getI64Decoder,\n getI64Encoder,\n getStructDecoder,\n getStructEncoder,\n getU32Decoder,\n getU32Encoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n transformEncoder,\n type Account,\n type Address,\n type EncodedAccount,\n type FetchAccountConfig,\n type FetchAccountsConfig,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type MaybeAccount,\n type MaybeEncodedAccount,\n type ReadonlyUint8Array,\n} from \"@solana/kit\";\n\nexport const JUROR_STAKE_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 139, 114, 205, 73, 247, 175, 133, 122,\n]);\n\nexport function getJurorStakeDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(JUROR_STAKE_DISCRIMINATOR);\n}\n\nexport type JurorStake = {\n discriminator: ReadonlyUint8Array;\n subaccord: Address;\n juror: Address;\n /** Collateral (stake_token). Sortition weight + slash exposure. */\n staked: bigint;\n activeDraws: number;\n bump: number;\n /** Leaf position in the Subaccord accumulator (assigned at first stake). */\n treeIndex: number;\n /**\n * Net slash(-)/reward(+) accumulated from settlements, in `stake_token`.\n * Written by settlement instead of mutating `staked` — keeps the\n * accumulator root canonical. Folded into `staked` by the permissionless\n * `reconcile_stake` crank (which updates the root via a Merkle proof).\n */\n stakeDelta: bigint;\n /**\n * Pending slash exposure from all active draws. Incremented by\n * `draw_seat` (by `α·min_stake` from the dispute's terms), decremented\n * by settlement or cancel. Ensures the juror can always cover every\n * concurrent slash. `staked - slash_reserve` is the truly free stake.\n */\n slashReserve: bigint;\n /**\n * Timestamp of `request_withdraw` (0 = no pending request). The\n * accumulator root is already updated at request time; `withdraw` just\n * transfers tokens after `WITHDRAWAL_DELAY` + `active_draws == 0`.\n */\n withdrawRequestedAt: bigint;\n /**\n * Tokens locked in the vault pending `withdraw`. Set at `request_withdraw`,\n * consumed at `withdraw`.\n */\n pendingWithdrawal: bigint;\n /**\n * Aggregate earned fees (`fee_token`, ADR-0020). Credited at\n * `finalize_round` + settlement; withdrawn via the ungated\n * `withdraw_fees` instruction. No `active_draws` gate (fees are earned,\n * not at-risk capital).\n */\n feesEarned: bigint;\n /**\n * Next free index in the free-slot linked list (RECLAIM-LEAF).\n * `u32::MAX` = this account is NOT a free-list node (active juror, or never\n * reclaimed). Any other value = this slot is reclaimed and `next_free` is\n * the next free index after this one. Set by `reclaim_slot`, consumed by\n * `stake`.\n */\n nextFree: number;\n /**\n * Previous free index in the free-slot linked list — the list is DOUBLY\n * linked (accord-b5v5): `u32::MAX` = no predecessor (head of the list, or\n * not a free-list node). Lets `stake` splice the juror's own reclaimed\n * slot out of the list from ANY position in O(1) accounts — the\n * singly-linked design forced a mid-list juror to wait behind every slot\n * pushed after theirs (soft grief, SR2-M-2 residual). Maintained by\n * `reclaim_slot` (push) and `stake` (pop + own-slot splice). Carved out of\n * the former padding like `Dispute.drawn_seats`: account size and all\n * prior field offsets unchanged.\n */\n prevFree: number;\n /**\n * Reserved tail space for future field extensions. Zeroed at `init`;\n * must stay the last field — new fields are carved out of it without\n * moving existing offsets or resizing the account.\n */\n padding: ReadonlyUint8Array;\n};\n\nexport type JurorStakeArgs = {\n subaccord: Address;\n juror: Address;\n /** Collateral (stake_token). Sortition weight + slash exposure. */\n staked: number | bigint;\n activeDraws: number;\n bump: number;\n /** Leaf position in the Subaccord accumulator (assigned at first stake). */\n treeIndex: number;\n /**\n * Net slash(-)/reward(+) accumulated from settlements, in `stake_token`.\n * Written by settlement instead of mutating `staked` — keeps the\n * accumulator root canonical. Folded into `staked` by the permissionless\n * `reconcile_stake` crank (which updates the root via a Merkle proof).\n */\n stakeDelta: number | bigint;\n /**\n * Pending slash exposure from all active draws. Incremented by\n * `draw_seat` (by `α·min_stake` from the dispute's terms), decremented\n * by settlement or cancel. Ensures the juror can always cover every\n * concurrent slash. `staked - slash_reserve` is the truly free stake.\n */\n slashReserve: number | bigint;\n /**\n * Timestamp of `request_withdraw` (0 = no pending request). The\n * accumulator root is already updated at request time; `withdraw` just\n * transfers tokens after `WITHDRAWAL_DELAY` + `active_draws == 0`.\n */\n withdrawRequestedAt: number | bigint;\n /**\n * Tokens locked in the vault pending `withdraw`. Set at `request_withdraw`,\n * consumed at `withdraw`.\n */\n pendingWithdrawal: number | bigint;\n /**\n * Aggregate earned fees (`fee_token`, ADR-0020). Credited at\n * `finalize_round` + settlement; withdrawn via the ungated\n * `withdraw_fees` instruction. No `active_draws` gate (fees are earned,\n * not at-risk capital).\n */\n feesEarned: number | bigint;\n /**\n * Next free index in the free-slot linked list (RECLAIM-LEAF).\n * `u32::MAX` = this account is NOT a free-list node (active juror, or never\n * reclaimed). Any other value = this slot is reclaimed and `next_free` is\n * the next free index after this one. Set by `reclaim_slot`, consumed by\n * `stake`.\n */\n nextFree: number;\n /**\n * Previous free index in the free-slot linked list — the list is DOUBLY\n * linked (accord-b5v5): `u32::MAX` = no predecessor (head of the list, or\n * not a free-list node). Lets `stake` splice the juror's own reclaimed\n * slot out of the list from ANY position in O(1) accounts — the\n * singly-linked design forced a mid-list juror to wait behind every slot\n * pushed after theirs (soft grief, SR2-M-2 residual). Maintained by\n * `reclaim_slot` (push) and `stake` (pop + own-slot splice). Carved out of\n * the former padding like `Dispute.drawn_seats`: account size and all\n * prior field offsets unchanged.\n */\n prevFree: number;\n /**\n * Reserved tail space for future field extensions. Zeroed at `init`;\n * must stay the last field — new fields are carved out of it without\n * moving existing offsets or resizing the account.\n */\n padding: ReadonlyUint8Array;\n};\n\n/** Gets the encoder for {@link JurorStakeArgs} account data. */\nexport function getJurorStakeEncoder(): FixedSizeEncoder<JurorStakeArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"subaccord\", getAddressEncoder()],\n [\"juror\", getAddressEncoder()],\n [\"staked\", getU64Encoder()],\n [\"activeDraws\", getU32Encoder()],\n [\"bump\", getU8Encoder()],\n [\"treeIndex\", getU32Encoder()],\n [\"stakeDelta\", getI64Encoder()],\n [\"slashReserve\", getU64Encoder()],\n [\"withdrawRequestedAt\", getI64Encoder()],\n [\"pendingWithdrawal\", getU64Encoder()],\n [\"feesEarned\", getU64Encoder()],\n [\"nextFree\", getU32Encoder()],\n [\"prevFree\", getU32Encoder()],\n [\"padding\", fixEncoderSize(getBytesEncoder(), 60)],\n ]),\n (value) => ({ ...value, discriminator: JUROR_STAKE_DISCRIMINATOR }),\n );\n}\n\n/** Gets the decoder for {@link JurorStake} account data. */\nexport function getJurorStakeDecoder(): FixedSizeDecoder<JurorStake> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"subaccord\", getAddressDecoder()],\n [\"juror\", getAddressDecoder()],\n [\"staked\", getU64Decoder()],\n [\"activeDraws\", getU32Decoder()],\n [\"bump\", getU8Decoder()],\n [\"treeIndex\", getU32Decoder()],\n [\"stakeDelta\", getI64Decoder()],\n [\"slashReserve\", getU64Decoder()],\n [\"withdrawRequestedAt\", getI64Decoder()],\n [\"pendingWithdrawal\", getU64Decoder()],\n [\"feesEarned\", getU64Decoder()],\n [\"nextFree\", getU32Decoder()],\n [\"prevFree\", getU32Decoder()],\n [\"padding\", fixDecoderSize(getBytesDecoder(), 60)],\n ]);\n}\n\n/** Gets the codec for {@link JurorStake} account data. */\nexport function getJurorStakeCodec(): FixedSizeCodec<\n JurorStakeArgs,\n JurorStake\n> {\n return combineCodec(getJurorStakeEncoder(), getJurorStakeDecoder());\n}\n\nexport function decodeJurorStake<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress>,\n): Account<JurorStake, TAddress>;\nexport function decodeJurorStake<TAddress extends string = string>(\n encodedAccount: MaybeEncodedAccount<TAddress>,\n): MaybeAccount<JurorStake, TAddress>;\nexport function decodeJurorStake<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress> | MaybeEncodedAccount<TAddress>,\n): Account<JurorStake, TAddress> | MaybeAccount<JurorStake, TAddress> {\n return decodeAccount(\n encodedAccount as MaybeEncodedAccount<TAddress>,\n getJurorStakeDecoder(),\n );\n}\n\nexport async function fetchJurorStake<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<Account<JurorStake, TAddress>> {\n const maybeAccount = await fetchMaybeJurorStake(rpc, address, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeJurorStake<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<MaybeAccount<JurorStake, TAddress>> {\n const maybeAccount = await fetchEncodedAccount(rpc, address, config);\n return decodeJurorStake(maybeAccount);\n}\n\nexport async function fetchAllJurorStake(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<Account<JurorStake>[]> {\n const maybeAccounts = await fetchAllMaybeJurorStake(rpc, addresses, config);\n assertAccountsExist(maybeAccounts);\n return maybeAccounts;\n}\n\nexport async function fetchAllMaybeJurorStake(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<MaybeAccount<JurorStake>[]> {\n const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n return maybeAccounts.map((maybeAccount) => decodeJurorStake(maybeAccount));\n}\n\nexport function getJurorStakeSize(): number {\n return 197;\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n assertAccountExists,\n assertAccountsExist,\n combineCodec,\n decodeAccount,\n fetchEncodedAccount,\n fetchEncodedAccounts,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n transformEncoder,\n type Account,\n type Address,\n type Codec,\n type Decoder,\n type EncodedAccount,\n type Encoder,\n type FetchAccountConfig,\n type FetchAccountsConfig,\n type MaybeAccount,\n type MaybeEncodedAccount,\n type ReadonlyUint8Array,\n} from \"@solana/kit\";\nimport {\n getUpdatePayloadDecoder,\n getUpdatePayloadEncoder,\n type UpdatePayload,\n type UpdatePayloadArgs,\n} from \"../types\";\n\nexport const PENDING_UPDATE_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 24, 212, 61, 73, 130, 111, 15, 112,\n]);\n\nexport function getPendingUpdateDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n PENDING_UPDATE_DISCRIMINATOR,\n );\n}\n\nexport type PendingUpdate = {\n discriminator: ReadonlyUint8Array;\n subaccord: Address;\n nonce: bigint;\n proposed: UpdatePayload;\n proposedBy: Address;\n /** Earliest slot at which `execute_subaccord_update` may land. */\n executeAfterSlot: bigint;\n bump: number;\n};\n\nexport type PendingUpdateArgs = {\n subaccord: Address;\n nonce: number | bigint;\n proposed: UpdatePayloadArgs;\n proposedBy: Address;\n /** Earliest slot at which `execute_subaccord_update` may land. */\n executeAfterSlot: number | bigint;\n bump: number;\n};\n\n/** Gets the encoder for {@link PendingUpdateArgs} account data. */\nexport function getPendingUpdateEncoder(): Encoder<PendingUpdateArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"subaccord\", getAddressEncoder()],\n [\"nonce\", getU64Encoder()],\n [\"proposed\", getUpdatePayloadEncoder()],\n [\"proposedBy\", getAddressEncoder()],\n [\"executeAfterSlot\", getU64Encoder()],\n [\"bump\", getU8Encoder()],\n ]),\n (value) => ({ ...value, discriminator: PENDING_UPDATE_DISCRIMINATOR }),\n );\n}\n\n/** Gets the decoder for {@link PendingUpdate} account data. */\nexport function getPendingUpdateDecoder(): Decoder<PendingUpdate> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"subaccord\", getAddressDecoder()],\n [\"nonce\", getU64Decoder()],\n [\"proposed\", getUpdatePayloadDecoder()],\n [\"proposedBy\", getAddressDecoder()],\n [\"executeAfterSlot\", getU64Decoder()],\n [\"bump\", getU8Decoder()],\n ]);\n}\n\n/** Gets the codec for {@link PendingUpdate} account data. */\nexport function getPendingUpdateCodec(): Codec<\n PendingUpdateArgs,\n PendingUpdate\n> {\n return combineCodec(getPendingUpdateEncoder(), getPendingUpdateDecoder());\n}\n\nexport function decodePendingUpdate<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress>,\n): Account<PendingUpdate, TAddress>;\nexport function decodePendingUpdate<TAddress extends string = string>(\n encodedAccount: MaybeEncodedAccount<TAddress>,\n): MaybeAccount<PendingUpdate, TAddress>;\nexport function decodePendingUpdate<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress> | MaybeEncodedAccount<TAddress>,\n): Account<PendingUpdate, TAddress> | MaybeAccount<PendingUpdate, TAddress> {\n return decodeAccount(\n encodedAccount as MaybeEncodedAccount<TAddress>,\n getPendingUpdateDecoder(),\n );\n}\n\nexport async function fetchPendingUpdate<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<Account<PendingUpdate, TAddress>> {\n const maybeAccount = await fetchMaybePendingUpdate(rpc, address, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybePendingUpdate<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<MaybeAccount<PendingUpdate, TAddress>> {\n const maybeAccount = await fetchEncodedAccount(rpc, address, config);\n return decodePendingUpdate(maybeAccount);\n}\n\nexport async function fetchAllPendingUpdate(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<Account<PendingUpdate>[]> {\n const maybeAccounts = await fetchAllMaybePendingUpdate(\n rpc,\n addresses,\n config,\n );\n assertAccountsExist(maybeAccounts);\n return maybeAccounts;\n}\n\nexport async function fetchAllMaybePendingUpdate(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<MaybeAccount<PendingUpdate>[]> {\n const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n return maybeAccounts.map((maybeAccount) => decodePendingUpdate(maybeAccount));\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n assertAccountExists,\n assertAccountsExist,\n combineCodec,\n decodeAccount,\n fetchEncodedAccount,\n fetchEncodedAccounts,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getArrayDecoder,\n getArrayEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getI64Decoder,\n getI64Encoder,\n getStructDecoder,\n getStructEncoder,\n getU32Decoder,\n getU32Encoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n transformEncoder,\n type Account,\n type Address,\n type EncodedAccount,\n type FetchAccountConfig,\n type FetchAccountsConfig,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type MaybeAccount,\n type MaybeEncodedAccount,\n type ReadonlyUint8Array,\n} from \"@solana/kit\";\n\nexport const ROUND_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 87, 127, 165, 51, 73, 78, 116, 174,\n]);\n\nexport function getRoundDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(ROUND_DISCRIMINATOR);\n}\n\nexport type Round = {\n discriminator: ReadonlyUint8Array;\n roundIdx: number;\n jurorCount: number;\n commitCount: number;\n revealCount: number;\n /**\n * Same-size redraw counter within this round (ADR-0021). Orthogonal to\n * `round_idx`: bumping it changes only the sortition seed, never the panel\n * size or the appeal budget. `(0,0)` = initial draw; resets implicitly on a\n * new appeal round (fresh `Round` PDA keyed by the new `round_idx`).\n */\n drawAttempt: number;\n /**\n * Whether this round's coherence settlement has been applied\n * (CONCEPT-REVIEW Ugly 5 / bean accord-r6ti). 0 until\n * `finalize_dispute` (final round) or `settle_round` (prior rounds)\n * processes it; 1 after. Idempotency guard against double-settlement.\n * (`u8` not `bool` — `bool` is not `Pod`.)\n */\n settled: number;\n bump: number;\n pad0: ReadonlyUint8Array;\n /** Commit opens at this timestamp (= draw_time + review_window). */\n reviewEnd: bigint;\n /** Reveal opens at this timestamp (= review_end + commit_window). */\n commitEnd: bigint;\n /** Round can be finalized after this timestamp (= commit_end + reveal_window). */\n revealEnd: bigint;\n /**\n * The tallied round result; `u64::MAX` = not set. `Plurality`: winning\n * option index. `Median` (ADR-0025): the median of revealed scalar votes.\n */\n result: bigint;\n dispute: Address;\n jurors: Array<Address>;\n /**\n * `hash(vote_le, salt, juror_pubkey)` per drawn Juror; `[0;32]` until\n * committed. `vote_le` = the 8-byte little-endian vote (ADR-0025).\n */\n commits: Array<ReadonlyUint8Array>;\n /**\n * Cumulative-from-left prefix per drawn seat (bean accord-tzo0). Filled\n * when the seat lands; later seats read these to verify that every prior\n * sortition retry genuinely collided with an already-drawn juror —\n * eliminating caller choice (no draw_attempt grind).\n */\n seatPrefix: Array<bigint>;\n /**\n * Leaf stake per drawn seat. With `seat_prefix`, defines the sortition\n * range `[prefix, prefix+stake)` used for deterministic collision checks.\n */\n seatStake: Array<bigint>;\n /**\n * Revealed vote per drawn Juror; `u64::MAX` until revealed. Option index\n * for `Plurality`, fixed-point scalar (settlement-mint base units) for\n * `Median` (ADR-0025). Tail field — struct size stays a multiple of 8.\n */\n reveals: Array<bigint>;\n};\n\nexport type RoundArgs = {\n roundIdx: number;\n jurorCount: number;\n commitCount: number;\n revealCount: number;\n /**\n * Same-size redraw counter within this round (ADR-0021). Orthogonal to\n * `round_idx`: bumping it changes only the sortition seed, never the panel\n * size or the appeal budget. `(0,0)` = initial draw; resets implicitly on a\n * new appeal round (fresh `Round` PDA keyed by the new `round_idx`).\n */\n drawAttempt: number;\n /**\n * Whether this round's coherence settlement has been applied\n * (CONCEPT-REVIEW Ugly 5 / bean accord-r6ti). 0 until\n * `finalize_dispute` (final round) or `settle_round` (prior rounds)\n * processes it; 1 after. Idempotency guard against double-settlement.\n * (`u8` not `bool` — `bool` is not `Pod`.)\n */\n settled: number;\n bump: number;\n pad0: ReadonlyUint8Array;\n /** Commit opens at this timestamp (= draw_time + review_window). */\n reviewEnd: number | bigint;\n /** Reveal opens at this timestamp (= review_end + commit_window). */\n commitEnd: number | bigint;\n /** Round can be finalized after this timestamp (= commit_end + reveal_window). */\n revealEnd: number | bigint;\n /**\n * The tallied round result; `u64::MAX` = not set. `Plurality`: winning\n * option index. `Median` (ADR-0025): the median of revealed scalar votes.\n */\n result: number | bigint;\n dispute: Address;\n jurors: Array<Address>;\n /**\n * `hash(vote_le, salt, juror_pubkey)` per drawn Juror; `[0;32]` until\n * committed. `vote_le` = the 8-byte little-endian vote (ADR-0025).\n */\n commits: Array<ReadonlyUint8Array>;\n /**\n * Cumulative-from-left prefix per drawn seat (bean accord-tzo0). Filled\n * when the seat lands; later seats read these to verify that every prior\n * sortition retry genuinely collided with an already-drawn juror —\n * eliminating caller choice (no draw_attempt grind).\n */\n seatPrefix: Array<number | bigint>;\n /**\n * Leaf stake per drawn seat. With `seat_prefix`, defines the sortition\n * range `[prefix, prefix+stake)` used for deterministic collision checks.\n */\n seatStake: Array<number | bigint>;\n /**\n * Revealed vote per drawn Juror; `u64::MAX` until revealed. Option index\n * for `Plurality`, fixed-point scalar (settlement-mint base units) for\n * `Median` (ADR-0025). Tail field — struct size stays a multiple of 8.\n */\n reveals: Array<number | bigint>;\n};\n\n/** Gets the encoder for {@link RoundArgs} account data. */\nexport function getRoundEncoder(): FixedSizeEncoder<RoundArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"roundIdx\", getU32Encoder()],\n [\"jurorCount\", getU32Encoder()],\n [\"commitCount\", getU32Encoder()],\n [\"revealCount\", getU32Encoder()],\n [\"drawAttempt\", getU32Encoder()],\n [\"settled\", getU8Encoder()],\n [\"bump\", getU8Encoder()],\n [\"pad0\", fixEncoderSize(getBytesEncoder(), 2)],\n [\"reviewEnd\", getI64Encoder()],\n [\"commitEnd\", getI64Encoder()],\n [\"revealEnd\", getI64Encoder()],\n [\"result\", getU64Encoder()],\n [\"dispute\", getAddressEncoder()],\n [\"jurors\", getArrayEncoder(getAddressEncoder(), { size: 31 })],\n [\n \"commits\",\n getArrayEncoder(fixEncoderSize(getBytesEncoder(), 32), { size: 31 }),\n ],\n [\"seatPrefix\", getArrayEncoder(getU64Encoder(), { size: 31 })],\n [\"seatStake\", getArrayEncoder(getU64Encoder(), { size: 31 })],\n [\"reveals\", getArrayEncoder(getU64Encoder(), { size: 31 })],\n ]),\n (value) => ({ ...value, discriminator: ROUND_DISCRIMINATOR }),\n );\n}\n\n/** Gets the decoder for {@link Round} account data. */\nexport function getRoundDecoder(): FixedSizeDecoder<Round> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"roundIdx\", getU32Decoder()],\n [\"jurorCount\", getU32Decoder()],\n [\"commitCount\", getU32Decoder()],\n [\"revealCount\", getU32Decoder()],\n [\"drawAttempt\", getU32Decoder()],\n [\"settled\", getU8Decoder()],\n [\"bump\", getU8Decoder()],\n [\"pad0\", fixDecoderSize(getBytesDecoder(), 2)],\n [\"reviewEnd\", getI64Decoder()],\n [\"commitEnd\", getI64Decoder()],\n [\"revealEnd\", getI64Decoder()],\n [\"result\", getU64Decoder()],\n [\"dispute\", getAddressDecoder()],\n [\"jurors\", getArrayDecoder(getAddressDecoder(), { size: 31 })],\n [\n \"commits\",\n getArrayDecoder(fixDecoderSize(getBytesDecoder(), 32), { size: 31 }),\n ],\n [\"seatPrefix\", getArrayDecoder(getU64Decoder(), { size: 31 })],\n [\"seatStake\", getArrayDecoder(getU64Decoder(), { size: 31 })],\n [\"reveals\", getArrayDecoder(getU64Decoder(), { size: 31 })],\n ]);\n}\n\n/** Gets the codec for {@link Round} account data. */\nexport function getRoundCodec(): FixedSizeCodec<RoundArgs, Round> {\n return combineCodec(getRoundEncoder(), getRoundDecoder());\n}\n\nexport function decodeRound<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress>,\n): Account<Round, TAddress>;\nexport function decodeRound<TAddress extends string = string>(\n encodedAccount: MaybeEncodedAccount<TAddress>,\n): MaybeAccount<Round, TAddress>;\nexport function decodeRound<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress> | MaybeEncodedAccount<TAddress>,\n): Account<Round, TAddress> | MaybeAccount<Round, TAddress> {\n return decodeAccount(\n encodedAccount as MaybeEncodedAccount<TAddress>,\n getRoundDecoder(),\n );\n}\n\nexport async function fetchRound<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<Account<Round, TAddress>> {\n const maybeAccount = await fetchMaybeRound(rpc, address, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeRound<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<MaybeAccount<Round, TAddress>> {\n const maybeAccount = await fetchEncodedAccount(rpc, address, config);\n return decodeRound(maybeAccount);\n}\n\nexport async function fetchAllRound(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<Account<Round>[]> {\n const maybeAccounts = await fetchAllMaybeRound(rpc, addresses, config);\n assertAccountsExist(maybeAccounts);\n return maybeAccounts;\n}\n\nexport async function fetchAllMaybeRound(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<MaybeAccount<Round>[]> {\n const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n return maybeAccounts.map((maybeAccount) => decodeRound(maybeAccount));\n}\n\nexport function getRoundSize(): number {\n return 2824;\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n assertAccountExists,\n assertAccountsExist,\n combineCodec,\n decodeAccount,\n fetchEncodedAccount,\n fetchEncodedAccounts,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n getU16Decoder,\n getU16Encoder,\n getU32Decoder,\n getU32Encoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n transformEncoder,\n type Account,\n type Address,\n type EncodedAccount,\n type FetchAccountConfig,\n type FetchAccountsConfig,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type MaybeAccount,\n type MaybeEncodedAccount,\n type ReadonlyUint8Array,\n} from \"@solana/kit\";\nimport {\n getAggregationDecoder,\n getAggregationEncoder,\n getShortfallPolicyDecoder,\n getShortfallPolicyEncoder,\n type Aggregation,\n type AggregationArgs,\n type ShortfallPolicy,\n type ShortfallPolicyArgs,\n} from \"../types\";\n\nexport const SUBACCORD_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 210, 63, 193, 190, 9, 166, 89, 170,\n]);\n\nexport function getSubaccordDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(SUBACCORD_DISCRIMINATOR);\n}\n\nexport type Subaccord = {\n discriminator: ReadonlyUint8Array;\n creator: Address;\n stakingToken: Address;\n /**\n * Compensation mint — fees + appeal bonds (ADR-0020). Distinct from\n * `staking_token` so collateral and compensation are decoupled.\n */\n feeToken: Address;\n minStake: bigint;\n /**\n * Slash factor in basis points (10% = 1000). Incoherent Juror loses\n * `alpha_bps * min_stake / 10_000` (flat — ADR-0003 consequence).\n */\n alphaBps: number;\n reviewWindow: bigint;\n commitWindow: bigint;\n revealWindow: bigint;\n /**\n * Appeal window after a round resolves before the dispute goes final\n * (ADR-0022). Per-Subaccord; frozen onto `CaseTerms` at filing.\n */\n appealWindow: bigint;\n maxAppeals: number;\n /**\n * Round-1 (round-0) juror panel size (accord-9q3e, supersedes ADR-0019's\n * fixed constant). Immutable at creation — determines the appeal-ladder\n * geometry `(J+1)·2^k − 1`. Must be odd (tie avoidance) and the ladder top\n * `(J+1)·2^max_appeals − 1` must fit `MAX_JURORS`. Default 3. Frozen onto\n * `CaseTerms` at filing so governance cannot shift panel size mid-dispute.\n * A pool wanting a single juror sets `min_jury_size = 1` + `max_appeals = 0`.\n */\n minJurySize: number;\n /** Per-Subaccord aggregation rule (ADR-0019). v1 = `Plurality`. */\n aggregation: Aggregation;\n feePerJuror: bigint;\n /**\n * Reveal-quorum fraction in basis points (ADR-0021). A round is\n * authoritative only if `reveal_count >= ceil(panel × bps / 10_000)`.\n * Default 6666 (= 2/3); the absolute commitment escalates per appeal\n * for free via panel growth.\n */\n revealThresholdBps: number;\n /** What to do on a shortfall (ADR-0021). v1 = `Redraw`. */\n shortfallPolicy: ShortfallPolicy;\n /**\n * Maximum same-size redraws per round before the dispute fails (ADR-0021).\n * `(round_idx, draw_attempt)` with `draw_attempt` reaching this bound ⇒\n * `Failed`. Orthogonal to `max_appeals` (which bounds `round_idx`).\n */\n maxDrawAttempts: number;\n /**\n * Coherence tolerance for `Median` pools (ADR-0025), in bps of the final\n * median: a revealed vote is coherent iff\n * `|vote − ruling| · 10_000 ≤ ruling · coherence_tol_bps`. `0` = exact\n * match. Inert for `Plurality` (exact option equality). Frozen onto\n * `CaseTerms` at filing; immutable on the Subaccord (not in\n * `UpdatePayload`) — it defines the pool's coherence game.\n */\n coherenceTolBps: number;\n /** `Pubkey::default()` => immutable. Otherwise signs propose/execute updates. */\n authority: Address;\n evidenceOperator: Address;\n /** Immutable identity hash: what class of dispute this pool adjudicates. */\n domainRef: ReadonlyUint8Array;\n /** Immutable evidence-format spec hash (ADR-0006). */\n evidenceSpec: ReadonlyUint8Array;\n /**\n * Attestation-gated juror pool (PROG-ATTESTTION). When both are\n * `Pubkey::default()` the Subaccord is stake-only (today's behavior,\n * unchanged). When set, jurors must hold a valid SAS attestation from\n * `juror_credential` under `juror_schema` to stake and be drawn. Immutable\n * at creation — joins `domain_ref` + `evidence_spec` as the identity\n * triplet (ADR-0005). Both-or-neither: a half-bound Subaccord is rejected\n * at `create_subaccord` (`AttestationBindingPartial`).\n */\n jurorCredential: Address;\n jurorSchema: Address;\n /**\n * Count of **distinct Jurors with any stake** (`JurorStake.staked > 0`).\n * Maintained O(1) by `stake`/`unstake` (0→positive increments,\n * positive→0 decrements). This is a *coarse* intake gate for\n * `create_dispute`/`appeal` (SPEC edge case: revert if fewer active\n * distinct stakers than the required panel). It deliberately does NOT track\n * `min_stake` eligibility — that changes via the 48h timelock and cannot be\n * recomputed without the O(n) ledger ADR-0003 rejected. Precise eligibility\n * (amount ≥ min_stake, distinctness) is verified at `draw` against the\n * finalized Merkle Snapshot.\n */\n stakerCount: number;\n /**\n * On-chain stake accumulator root (ADR-0012). Maintained incrementally on\n * every `stake`/`unstake` via client-supplied Merkle paths; canonical by\n * construction — there is no posted root to withhold or fabricate.\n */\n rootHash: ReadonlyUint8Array;\n /** Total stake committed to by the accumulator tree (= root node sum). */\n totalStake: bigint;\n /**\n * Next free leaf index in the append-only tree. Incremented once per\n * first-time staker; never reused (full unstake zeros the leaf weight but\n * keeps its `tree_index`).\n */\n nextIndex: number;\n /** Fixed tree depth (bounds the pool at `2^depth`). Set at `create_subaccord`. */\n depth: number;\n /**\n * Parallel vault ledger — fee side (bean accord-fdad). Tracks every\n * `fee_token` SPL transfer in/out of the `fee_vault`, independent of the\n * vault's live balance. The vault balance is a *derivable consequence*:\n * `fee_vault.amount == fee_vault_deposited - fee_vault_withdrawn`\n * (separate-mint) or the fee portion of a shared ATA (same-mint).\n */\n feeVaultDeposited: bigint;\n feeVaultWithdrawn: bigint;\n /**\n * Parallel vault ledger — stake side (bean accord-fdad). Tracks every\n * `staking_token` SPL transfer in/out of the `stake_vault`. Bumped only by\n * `stake` (in) and `withdraw` (out); slashing and `request_withdraw` are\n * ledger-only and never touch these.\n */\n stakeVaultDeposited: bigint;\n stakeVaultWithdrawn: bigint;\n /**\n * Head of the free-slot linked list (RECLAIM-LEAF). `u32::MAX` = list empty.\n * When non-MAX, points to a JurorStake whose slot has been reclaimed and is\n * available for reuse by a new staker. Maintained by `reclaim_slot` (push)\n * and `stake` (pop).\n */\n freeHead: number;\n bump: number;\n /**\n * Reserved tail space for future field extensions. Zeroed at `init`;\n * must stay the last field — new fields are carved out of it without\n * moving existing offsets or resizing the account.\n */\n padding: ReadonlyUint8Array;\n};\n\nexport type SubaccordArgs = {\n creator: Address;\n stakingToken: Address;\n /**\n * Compensation mint — fees + appeal bonds (ADR-0020). Distinct from\n * `staking_token` so collateral and compensation are decoupled.\n */\n feeToken: Address;\n minStake: number | bigint;\n /**\n * Slash factor in basis points (10% = 1000). Incoherent Juror loses\n * `alpha_bps * min_stake / 10_000` (flat — ADR-0003 consequence).\n */\n alphaBps: number;\n reviewWindow: number | bigint;\n commitWindow: number | bigint;\n revealWindow: number | bigint;\n /**\n * Appeal window after a round resolves before the dispute goes final\n * (ADR-0022). Per-Subaccord; frozen onto `CaseTerms` at filing.\n */\n appealWindow: number | bigint;\n maxAppeals: number;\n /**\n * Round-1 (round-0) juror panel size (accord-9q3e, supersedes ADR-0019's\n * fixed constant). Immutable at creation — determines the appeal-ladder\n * geometry `(J+1)·2^k − 1`. Must be odd (tie avoidance) and the ladder top\n * `(J+1)·2^max_appeals − 1` must fit `MAX_JURORS`. Default 3. Frozen onto\n * `CaseTerms` at filing so governance cannot shift panel size mid-dispute.\n * A pool wanting a single juror sets `min_jury_size = 1` + `max_appeals = 0`.\n */\n minJurySize: number;\n /** Per-Subaccord aggregation rule (ADR-0019). v1 = `Plurality`. */\n aggregation: AggregationArgs;\n feePerJuror: number | bigint;\n /**\n * Reveal-quorum fraction in basis points (ADR-0021). A round is\n * authoritative only if `reveal_count >= ceil(panel × bps / 10_000)`.\n * Default 6666 (= 2/3); the absolute commitment escalates per appeal\n * for free via panel growth.\n */\n revealThresholdBps: number;\n /** What to do on a shortfall (ADR-0021). v1 = `Redraw`. */\n shortfallPolicy: ShortfallPolicyArgs;\n /**\n * Maximum same-size redraws per round before the dispute fails (ADR-0021).\n * `(round_idx, draw_attempt)` with `draw_attempt` reaching this bound ⇒\n * `Failed`. Orthogonal to `max_appeals` (which bounds `round_idx`).\n */\n maxDrawAttempts: number;\n /**\n * Coherence tolerance for `Median` pools (ADR-0025), in bps of the final\n * median: a revealed vote is coherent iff\n * `|vote − ruling| · 10_000 ≤ ruling · coherence_tol_bps`. `0` = exact\n * match. Inert for `Plurality` (exact option equality). Frozen onto\n * `CaseTerms` at filing; immutable on the Subaccord (not in\n * `UpdatePayload`) — it defines the pool's coherence game.\n */\n coherenceTolBps: number;\n /** `Pubkey::default()` => immutable. Otherwise signs propose/execute updates. */\n authority: Address;\n evidenceOperator: Address;\n /** Immutable identity hash: what class of dispute this pool adjudicates. */\n domainRef: ReadonlyUint8Array;\n /** Immutable evidence-format spec hash (ADR-0006). */\n evidenceSpec: ReadonlyUint8Array;\n /**\n * Attestation-gated juror pool (PROG-ATTESTTION). When both are\n * `Pubkey::default()` the Subaccord is stake-only (today's behavior,\n * unchanged). When set, jurors must hold a valid SAS attestation from\n * `juror_credential` under `juror_schema` to stake and be drawn. Immutable\n * at creation — joins `domain_ref` + `evidence_spec` as the identity\n * triplet (ADR-0005). Both-or-neither: a half-bound Subaccord is rejected\n * at `create_subaccord` (`AttestationBindingPartial`).\n */\n jurorCredential: Address;\n jurorSchema: Address;\n /**\n * Count of **distinct Jurors with any stake** (`JurorStake.staked > 0`).\n * Maintained O(1) by `stake`/`unstake` (0→positive increments,\n * positive→0 decrements). This is a *coarse* intake gate for\n * `create_dispute`/`appeal` (SPEC edge case: revert if fewer active\n * distinct stakers than the required panel). It deliberately does NOT track\n * `min_stake` eligibility — that changes via the 48h timelock and cannot be\n * recomputed without the O(n) ledger ADR-0003 rejected. Precise eligibility\n * (amount ≥ min_stake, distinctness) is verified at `draw` against the\n * finalized Merkle Snapshot.\n */\n stakerCount: number;\n /**\n * On-chain stake accumulator root (ADR-0012). Maintained incrementally on\n * every `stake`/`unstake` via client-supplied Merkle paths; canonical by\n * construction — there is no posted root to withhold or fabricate.\n */\n rootHash: ReadonlyUint8Array;\n /** Total stake committed to by the accumulator tree (= root node sum). */\n totalStake: number | bigint;\n /**\n * Next free leaf index in the append-only tree. Incremented once per\n * first-time staker; never reused (full unstake zeros the leaf weight but\n * keeps its `tree_index`).\n */\n nextIndex: number;\n /** Fixed tree depth (bounds the pool at `2^depth`). Set at `create_subaccord`. */\n depth: number;\n /**\n * Parallel vault ledger — fee side (bean accord-fdad). Tracks every\n * `fee_token` SPL transfer in/out of the `fee_vault`, independent of the\n * vault's live balance. The vault balance is a *derivable consequence*:\n * `fee_vault.amount == fee_vault_deposited - fee_vault_withdrawn`\n * (separate-mint) or the fee portion of a shared ATA (same-mint).\n */\n feeVaultDeposited: number | bigint;\n feeVaultWithdrawn: number | bigint;\n /**\n * Parallel vault ledger — stake side (bean accord-fdad). Tracks every\n * `staking_token` SPL transfer in/out of the `stake_vault`. Bumped only by\n * `stake` (in) and `withdraw` (out); slashing and `request_withdraw` are\n * ledger-only and never touch these.\n */\n stakeVaultDeposited: number | bigint;\n stakeVaultWithdrawn: number | bigint;\n /**\n * Head of the free-slot linked list (RECLAIM-LEAF). `u32::MAX` = list empty.\n * When non-MAX, points to a JurorStake whose slot has been reclaimed and is\n * available for reuse by a new staker. Maintained by `reclaim_slot` (push)\n * and `stake` (pop).\n */\n freeHead: number;\n bump: number;\n /**\n * Reserved tail space for future field extensions. Zeroed at `init`;\n * must stay the last field — new fields are carved out of it without\n * moving existing offsets or resizing the account.\n */\n padding: ReadonlyUint8Array;\n};\n\n/** Gets the encoder for {@link SubaccordArgs} account data. */\nexport function getSubaccordEncoder(): FixedSizeEncoder<SubaccordArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"creator\", getAddressEncoder()],\n [\"stakingToken\", getAddressEncoder()],\n [\"feeToken\", getAddressEncoder()],\n [\"minStake\", getU64Encoder()],\n [\"alphaBps\", getU16Encoder()],\n [\"reviewWindow\", getU64Encoder()],\n [\"commitWindow\", getU64Encoder()],\n [\"revealWindow\", getU64Encoder()],\n [\"appealWindow\", getU64Encoder()],\n [\"maxAppeals\", getU8Encoder()],\n [\"minJurySize\", getU32Encoder()],\n [\"aggregation\", getAggregationEncoder()],\n [\"feePerJuror\", getU64Encoder()],\n [\"revealThresholdBps\", getU16Encoder()],\n [\"shortfallPolicy\", getShortfallPolicyEncoder()],\n [\"maxDrawAttempts\", getU8Encoder()],\n [\"coherenceTolBps\", getU16Encoder()],\n [\"authority\", getAddressEncoder()],\n [\"evidenceOperator\", getAddressEncoder()],\n [\"domainRef\", fixEncoderSize(getBytesEncoder(), 32)],\n [\"evidenceSpec\", fixEncoderSize(getBytesEncoder(), 32)],\n [\"jurorCredential\", getAddressEncoder()],\n [\"jurorSchema\", getAddressEncoder()],\n [\"stakerCount\", getU32Encoder()],\n [\"rootHash\", fixEncoderSize(getBytesEncoder(), 32)],\n [\"totalStake\", getU64Encoder()],\n [\"nextIndex\", getU32Encoder()],\n [\"depth\", getU8Encoder()],\n [\"feeVaultDeposited\", getU64Encoder()],\n [\"feeVaultWithdrawn\", getU64Encoder()],\n [\"stakeVaultDeposited\", getU64Encoder()],\n [\"stakeVaultWithdrawn\", getU64Encoder()],\n [\"freeHead\", getU32Encoder()],\n [\"bump\", getU8Encoder()],\n [\"padding\", fixEncoderSize(getBytesEncoder(), 64)],\n ]),\n (value) => ({ ...value, discriminator: SUBACCORD_DISCRIMINATOR }),\n );\n}\n\n/** Gets the decoder for {@link Subaccord} account data. */\nexport function getSubaccordDecoder(): FixedSizeDecoder<Subaccord> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"creator\", getAddressDecoder()],\n [\"stakingToken\", getAddressDecoder()],\n [\"feeToken\", getAddressDecoder()],\n [\"minStake\", getU64Decoder()],\n [\"alphaBps\", getU16Decoder()],\n [\"reviewWindow\", getU64Decoder()],\n [\"commitWindow\", getU64Decoder()],\n [\"revealWindow\", getU64Decoder()],\n [\"appealWindow\", getU64Decoder()],\n [\"maxAppeals\", getU8Decoder()],\n [\"minJurySize\", getU32Decoder()],\n [\"aggregation\", getAggregationDecoder()],\n [\"feePerJuror\", getU64Decoder()],\n [\"revealThresholdBps\", getU16Decoder()],\n [\"shortfallPolicy\", getShortfallPolicyDecoder()],\n [\"maxDrawAttempts\", getU8Decoder()],\n [\"coherenceTolBps\", getU16Decoder()],\n [\"authority\", getAddressDecoder()],\n [\"evidenceOperator\", getAddressDecoder()],\n [\"domainRef\", fixDecoderSize(getBytesDecoder(), 32)],\n [\"evidenceSpec\", fixDecoderSize(getBytesDecoder(), 32)],\n [\"jurorCredential\", getAddressDecoder()],\n [\"jurorSchema\", getAddressDecoder()],\n [\"stakerCount\", getU32Decoder()],\n [\"rootHash\", fixDecoderSize(getBytesDecoder(), 32)],\n [\"totalStake\", getU64Decoder()],\n [\"nextIndex\", getU32Decoder()],\n [\"depth\", getU8Decoder()],\n [\"feeVaultDeposited\", getU64Decoder()],\n [\"feeVaultWithdrawn\", getU64Decoder()],\n [\"stakeVaultDeposited\", getU64Decoder()],\n [\"stakeVaultWithdrawn\", getU64Decoder()],\n [\"freeHead\", getU32Decoder()],\n [\"bump\", getU8Decoder()],\n [\"padding\", fixDecoderSize(getBytesDecoder(), 64)],\n ]);\n}\n\n/** Gets the codec for {@link Subaccord} account data. */\nexport function getSubaccordCodec(): FixedSizeCodec<SubaccordArgs, Subaccord> {\n return combineCodec(getSubaccordEncoder(), getSubaccordDecoder());\n}\n\nexport function decodeSubaccord<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress>,\n): Account<Subaccord, TAddress>;\nexport function decodeSubaccord<TAddress extends string = string>(\n encodedAccount: MaybeEncodedAccount<TAddress>,\n): MaybeAccount<Subaccord, TAddress>;\nexport function decodeSubaccord<TAddress extends string = string>(\n encodedAccount: EncodedAccount<TAddress> | MaybeEncodedAccount<TAddress>,\n): Account<Subaccord, TAddress> | MaybeAccount<Subaccord, TAddress> {\n return decodeAccount(\n encodedAccount as MaybeEncodedAccount<TAddress>,\n getSubaccordDecoder(),\n );\n}\n\nexport async function fetchSubaccord<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<Account<Subaccord, TAddress>> {\n const maybeAccount = await fetchMaybeSubaccord(rpc, address, config);\n assertAccountExists(maybeAccount);\n return maybeAccount;\n}\n\nexport async function fetchMaybeSubaccord<TAddress extends string = string>(\n rpc: Parameters<typeof fetchEncodedAccount>[0],\n address: Address<TAddress>,\n config?: FetchAccountConfig,\n): Promise<MaybeAccount<Subaccord, TAddress>> {\n const maybeAccount = await fetchEncodedAccount(rpc, address, config);\n return decodeSubaccord(maybeAccount);\n}\n\nexport async function fetchAllSubaccord(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<Account<Subaccord>[]> {\n const maybeAccounts = await fetchAllMaybeSubaccord(rpc, addresses, config);\n assertAccountsExist(maybeAccounts);\n return maybeAccounts;\n}\n\nexport async function fetchAllMaybeSubaccord(\n rpc: Parameters<typeof fetchEncodedAccounts>[0],\n addresses: Array<Address>,\n config?: FetchAccountsConfig,\n): Promise<MaybeAccount<Subaccord>[]> {\n const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);\n return maybeAccounts.map((maybeAccount) => decodeSubaccord(maybeAccount));\n}\n\nexport function getSubaccordSize(): number {\n return 508;\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getAddressEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n getAddressFromResolvedInstructionAccount,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { findAccordStatePda } from \"../pdas\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\n\nexport const APPEAL_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 250, 91, 1, 244, 179, 52, 75, 236,\n]);\n\nexport function getAppealDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(APPEAL_DISCRIMINATOR);\n}\n\nexport type AppealInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountAppellant extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountAccordState extends string | AccountMeta<string> = string,\n TAccountDispute extends string | AccountMeta<string> = string,\n TAccountRound extends string | AccountMeta<string> = string,\n TAccountAppealBond extends string | AccountMeta<string> = string,\n TAccountFeeToken extends string | AccountMeta<string> = string,\n TAccountAppellantTokenAccount extends string | AccountMeta<string> = string,\n TAccountFeeVault extends string | AccountMeta<string> = string,\n TAccountTokenProgram extends string | AccountMeta<string> =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\",\n TAccountAssociatedTokenProgram extends string | AccountMeta<string> =\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\",\n TAccountSystemProgram extends string | AccountMeta<string> =\n \"11111111111111111111111111111111\",\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountAppellant extends string\n ? WritableSignerAccount<TAccountAppellant> &\n AccountSignerMeta<TAccountAppellant>\n : TAccountAppellant,\n TAccountSubaccord extends string\n ? WritableAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountAccordState extends string\n ? ReadonlyAccount<TAccountAccordState>\n : TAccountAccordState,\n TAccountDispute extends string\n ? WritableAccount<TAccountDispute>\n : TAccountDispute,\n TAccountRound extends string\n ? ReadonlyAccount<TAccountRound>\n : TAccountRound,\n TAccountAppealBond extends string\n ? WritableAccount<TAccountAppealBond>\n : TAccountAppealBond,\n TAccountFeeToken extends string\n ? ReadonlyAccount<TAccountFeeToken>\n : TAccountFeeToken,\n TAccountAppellantTokenAccount extends string\n ? WritableAccount<TAccountAppellantTokenAccount>\n : TAccountAppellantTokenAccount,\n TAccountFeeVault extends string\n ? WritableAccount<TAccountFeeVault>\n : TAccountFeeVault,\n TAccountTokenProgram extends string\n ? ReadonlyAccount<TAccountTokenProgram>\n : TAccountTokenProgram,\n TAccountAssociatedTokenProgram extends string\n ? ReadonlyAccount<TAccountAssociatedTokenProgram>\n : TAccountAssociatedTokenProgram,\n TAccountSystemProgram extends string\n ? ReadonlyAccount<TAccountSystemProgram>\n : TAccountSystemProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type AppealInstructionData = {\n discriminator: ReadonlyUint8Array;\n newEvidenceHash: ReadonlyUint8Array;\n};\n\nexport type AppealInstructionDataArgs = { newEvidenceHash: ReadonlyUint8Array };\n\nexport function getAppealInstructionDataEncoder(): FixedSizeEncoder<AppealInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"newEvidenceHash\", fixEncoderSize(getBytesEncoder(), 32)],\n ]),\n (value) => ({ ...value, discriminator: APPEAL_DISCRIMINATOR }),\n );\n}\n\nexport function getAppealInstructionDataDecoder(): FixedSizeDecoder<AppealInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"newEvidenceHash\", fixDecoderSize(getBytesDecoder(), 32)],\n ]);\n}\n\nexport function getAppealInstructionDataCodec(): FixedSizeCodec<\n AppealInstructionDataArgs,\n AppealInstructionData\n> {\n return combineCodec(\n getAppealInstructionDataEncoder(),\n getAppealInstructionDataDecoder(),\n );\n}\n\nexport type AppealAsyncInput<\n TAccountAppellant extends string = string,\n TAccountSubaccord extends string = string,\n TAccountAccordState extends string = string,\n TAccountDispute extends string = string,\n TAccountRound extends string = string,\n TAccountAppealBond extends string = string,\n TAccountFeeToken extends string = string,\n TAccountAppellantTokenAccount extends string = string,\n TAccountFeeVault extends string = string,\n TAccountTokenProgram extends string = string,\n TAccountAssociatedTokenProgram extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n appellant: TransactionSigner<TAccountAppellant>;\n subaccord: Address<TAccountSubaccord>;\n accordState?: Address<TAccountAccordState>;\n dispute: Address<TAccountDispute>;\n /**\n * The round just resolved (`dispute.current_round`) — read-only; supplies\n * `reveal_end` for the appeal-window check and `result` (the prior ruling).\n */\n round: Address<TAccountRound>;\n /** Per-appeal bond custody (ADR-0004). Keyed by the round being appealed. */\n appealBond: Address<TAccountAppealBond>;\n feeToken: Address<TAccountFeeToken>;\n appellantTokenAccount?: Address<TAccountAppellantTokenAccount>;\n feeVault?: Address<TAccountFeeVault>;\n tokenProgram?: Address<TAccountTokenProgram>;\n associatedTokenProgram?: Address<TAccountAssociatedTokenProgram>;\n systemProgram?: Address<TAccountSystemProgram>;\n newEvidenceHash: AppealInstructionDataArgs[\"newEvidenceHash\"];\n};\n\nexport async function getAppealInstructionAsync<\n TAccountAppellant extends string,\n TAccountSubaccord extends string,\n TAccountAccordState extends string,\n TAccountDispute extends string,\n TAccountRound extends string,\n TAccountAppealBond extends string,\n TAccountFeeToken extends string,\n TAccountAppellantTokenAccount extends string,\n TAccountFeeVault extends string,\n TAccountTokenProgram extends string,\n TAccountAssociatedTokenProgram extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: AppealAsyncInput<\n TAccountAppellant,\n TAccountSubaccord,\n TAccountAccordState,\n TAccountDispute,\n TAccountRound,\n TAccountAppealBond,\n TAccountFeeToken,\n TAccountAppellantTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram,\n TAccountAssociatedTokenProgram,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n AppealInstruction<\n TProgramAddress,\n TAccountAppellant,\n TAccountSubaccord,\n TAccountAccordState,\n TAccountDispute,\n TAccountRound,\n TAccountAppealBond,\n TAccountFeeToken,\n TAccountAppellantTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram,\n TAccountAssociatedTokenProgram,\n TAccountSystemProgram\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n appellant: { value: input.appellant ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n accordState: { value: input.accordState ?? null, isWritable: false },\n dispute: { value: input.dispute ?? null, isWritable: true },\n round: { value: input.round ?? null, isWritable: false },\n appealBond: { value: input.appealBond ?? null, isWritable: true },\n feeToken: { value: input.feeToken ?? null, isWritable: false },\n appellantTokenAccount: {\n value: input.appellantTokenAccount ?? null,\n isWritable: true,\n },\n feeVault: { value: input.feeVault ?? null, isWritable: true },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n associatedTokenProgram: {\n value: input.associatedTokenProgram ?? null,\n isWritable: false,\n },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.accordState.value) {\n accounts.accordState.value = await findAccordStatePda();\n }\n if (!accounts.appellantTokenAccount.value) {\n accounts.appellantTokenAccount.value = await getProgramDerivedAddress({\n programAddress:\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\" as Address<\"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\">,\n seeds: [\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"appellant\",\n accounts.appellant.value,\n ),\n ),\n getBytesEncoder().encode(\n new Uint8Array([\n 6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206, 235,\n 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140, 245, 133,\n 126, 255, 0, 169,\n ]),\n ),\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"feeToken\",\n accounts.feeToken.value,\n ),\n ),\n ],\n });\n }\n if (!accounts.feeVault.value) {\n accounts.feeVault.value = await getProgramDerivedAddress({\n programAddress:\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\" as Address<\"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\">,\n seeds: [\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"subaccord\",\n accounts.subaccord.value,\n ),\n ),\n getBytesEncoder().encode(\n new Uint8Array([\n 6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206, 235,\n 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140, 245, 133,\n 126, 255, 0, 169,\n ]),\n ),\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"feeToken\",\n accounts.feeToken.value,\n ),\n ),\n ],\n });\n }\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\" as Address<\"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\">;\n }\n if (!accounts.associatedTokenProgram.value) {\n accounts.associatedTokenProgram.value =\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\" as Address<\"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\">;\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n \"11111111111111111111111111111111\" as Address<\"11111111111111111111111111111111\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"appellant\", accounts.appellant),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"accordState\", accounts.accordState),\n getAccountMeta(\"dispute\", accounts.dispute),\n getAccountMeta(\"round\", accounts.round),\n getAccountMeta(\"appealBond\", accounts.appealBond),\n getAccountMeta(\"feeToken\", accounts.feeToken),\n getAccountMeta(\"appellantTokenAccount\", accounts.appellantTokenAccount),\n getAccountMeta(\"feeVault\", accounts.feeVault),\n getAccountMeta(\"tokenProgram\", accounts.tokenProgram),\n getAccountMeta(\"associatedTokenProgram\", accounts.associatedTokenProgram),\n getAccountMeta(\"systemProgram\", accounts.systemProgram),\n ],\n data: getAppealInstructionDataEncoder().encode(\n args as AppealInstructionDataArgs,\n ),\n programAddress,\n } as AppealInstruction<\n TProgramAddress,\n TAccountAppellant,\n TAccountSubaccord,\n TAccountAccordState,\n TAccountDispute,\n TAccountRound,\n TAccountAppealBond,\n TAccountFeeToken,\n TAccountAppellantTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram,\n TAccountAssociatedTokenProgram,\n TAccountSystemProgram\n >);\n}\n\nexport type AppealInput<\n TAccountAppellant extends string = string,\n TAccountSubaccord extends string = string,\n TAccountAccordState extends string = string,\n TAccountDispute extends string = string,\n TAccountRound extends string = string,\n TAccountAppealBond extends string = string,\n TAccountFeeToken extends string = string,\n TAccountAppellantTokenAccount extends string = string,\n TAccountFeeVault extends string = string,\n TAccountTokenProgram extends string = string,\n TAccountAssociatedTokenProgram extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n appellant: TransactionSigner<TAccountAppellant>;\n subaccord: Address<TAccountSubaccord>;\n accordState: Address<TAccountAccordState>;\n dispute: Address<TAccountDispute>;\n /**\n * The round just resolved (`dispute.current_round`) — read-only; supplies\n * `reveal_end` for the appeal-window check and `result` (the prior ruling).\n */\n round: Address<TAccountRound>;\n /** Per-appeal bond custody (ADR-0004). Keyed by the round being appealed. */\n appealBond: Address<TAccountAppealBond>;\n feeToken: Address<TAccountFeeToken>;\n appellantTokenAccount: Address<TAccountAppellantTokenAccount>;\n feeVault: Address<TAccountFeeVault>;\n tokenProgram?: Address<TAccountTokenProgram>;\n associatedTokenProgram?: Address<TAccountAssociatedTokenProgram>;\n systemProgram?: Address<TAccountSystemProgram>;\n newEvidenceHash: AppealInstructionDataArgs[\"newEvidenceHash\"];\n};\n\nexport function getAppealInstruction<\n TAccountAppellant extends string,\n TAccountSubaccord extends string,\n TAccountAccordState extends string,\n TAccountDispute extends string,\n TAccountRound extends string,\n TAccountAppealBond extends string,\n TAccountFeeToken extends string,\n TAccountAppellantTokenAccount extends string,\n TAccountFeeVault extends string,\n TAccountTokenProgram extends string,\n TAccountAssociatedTokenProgram extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: AppealInput<\n TAccountAppellant,\n TAccountSubaccord,\n TAccountAccordState,\n TAccountDispute,\n TAccountRound,\n TAccountAppealBond,\n TAccountFeeToken,\n TAccountAppellantTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram,\n TAccountAssociatedTokenProgram,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): AppealInstruction<\n TProgramAddress,\n TAccountAppellant,\n TAccountSubaccord,\n TAccountAccordState,\n TAccountDispute,\n TAccountRound,\n TAccountAppealBond,\n TAccountFeeToken,\n TAccountAppellantTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram,\n TAccountAssociatedTokenProgram,\n TAccountSystemProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n appellant: { value: input.appellant ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n accordState: { value: input.accordState ?? null, isWritable: false },\n dispute: { value: input.dispute ?? null, isWritable: true },\n round: { value: input.round ?? null, isWritable: false },\n appealBond: { value: input.appealBond ?? null, isWritable: true },\n feeToken: { value: input.feeToken ?? null, isWritable: false },\n appellantTokenAccount: {\n value: input.appellantTokenAccount ?? null,\n isWritable: true,\n },\n feeVault: { value: input.feeVault ?? null, isWritable: true },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n associatedTokenProgram: {\n value: input.associatedTokenProgram ?? null,\n isWritable: false,\n },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\" as Address<\"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\">;\n }\n if (!accounts.associatedTokenProgram.value) {\n accounts.associatedTokenProgram.value =\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\" as Address<\"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\">;\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n \"11111111111111111111111111111111\" as Address<\"11111111111111111111111111111111\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"appellant\", accounts.appellant),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"accordState\", accounts.accordState),\n getAccountMeta(\"dispute\", accounts.dispute),\n getAccountMeta(\"round\", accounts.round),\n getAccountMeta(\"appealBond\", accounts.appealBond),\n getAccountMeta(\"feeToken\", accounts.feeToken),\n getAccountMeta(\"appellantTokenAccount\", accounts.appellantTokenAccount),\n getAccountMeta(\"feeVault\", accounts.feeVault),\n getAccountMeta(\"tokenProgram\", accounts.tokenProgram),\n getAccountMeta(\"associatedTokenProgram\", accounts.associatedTokenProgram),\n getAccountMeta(\"systemProgram\", accounts.systemProgram),\n ],\n data: getAppealInstructionDataEncoder().encode(\n args as AppealInstructionDataArgs,\n ),\n programAddress,\n } as AppealInstruction<\n TProgramAddress,\n TAccountAppellant,\n TAccountSubaccord,\n TAccountAccordState,\n TAccountDispute,\n TAccountRound,\n TAccountAppealBond,\n TAccountFeeToken,\n TAccountAppellantTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram,\n TAccountAssociatedTokenProgram,\n TAccountSystemProgram\n >);\n}\n\nexport type ParsedAppealInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n appellant: TAccountMetas[0];\n subaccord: TAccountMetas[1];\n accordState: TAccountMetas[2];\n dispute: TAccountMetas[3];\n /**\n * The round just resolved (`dispute.current_round`) — read-only; supplies\n * `reveal_end` for the appeal-window check and `result` (the prior ruling).\n */\n round: TAccountMetas[4];\n /** Per-appeal bond custody (ADR-0004). Keyed by the round being appealed. */\n appealBond: TAccountMetas[5];\n feeToken: TAccountMetas[6];\n appellantTokenAccount: TAccountMetas[7];\n feeVault: TAccountMetas[8];\n tokenProgram: TAccountMetas[9];\n associatedTokenProgram: TAccountMetas[10];\n systemProgram: TAccountMetas[11];\n };\n data: AppealInstructionData;\n};\n\nexport function parseAppealInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedAppealInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 12) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 12,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n appellant: getNextAccount(),\n subaccord: getNextAccount(),\n accordState: getNextAccount(),\n dispute: getNextAccount(),\n round: getNextAccount(),\n appealBond: getNextAccount(),\n feeToken: getNextAccount(),\n appellantTokenAccount: getNextAccount(),\n feeVault: getNextAccount(),\n tokenProgram: getNextAccount(),\n associatedTokenProgram: getNextAccount(),\n systemProgram: getNextAccount(),\n },\n data: getAppealInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n getBytesEncoder,\n getProgramDerivedAddress,\n type Address,\n type ProgramDerivedAddress,\n} from \"@solana/kit\";\n\nexport async function findAccordStatePda(\n config: { programAddress?: Address | undefined } = {},\n): Promise<ProgramDerivedAddress> {\n const {\n programAddress = \"cordhVoshqRV6kzGBmM89A66wuusJGsDCvLMHPLyKed\" as Address<\"cordhVoshqRV6kzGBmM89A66wuusJGsDCvLMHPLyKed\">,\n } = config;\n return await getProgramDerivedAddress({\n programAddress,\n seeds: [getBytesEncoder().encode(new Uint8Array([115, 116, 97, 116, 101]))],\n });\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n getAddressEncoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n getU32Encoder,\n type Address,\n type ProgramDerivedAddress,\n} from \"@solana/kit\";\n\nexport type AppealBondSeeds = {\n dispute: Address;\n roundIdx: number;\n};\n\nexport async function findAppealBondPda(\n seeds: AppealBondSeeds,\n config: { programAddress?: Address | undefined } = {},\n): Promise<ProgramDerivedAddress> {\n const {\n programAddress = \"cordhVoshqRV6kzGBmM89A66wuusJGsDCvLMHPLyKed\" as Address<\"cordhVoshqRV6kzGBmM89A66wuusJGsDCvLMHPLyKed\">,\n } = config;\n return await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getBytesEncoder().encode(new Uint8Array([98, 111, 110, 100])),\n getAddressEncoder().encode(seeds.dispute),\n getU32Encoder().encode(seeds.roundIdx),\n ],\n });\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n getAddressEncoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n getU64Encoder,\n type Address,\n type ProgramDerivedAddress,\n} from \"@solana/kit\";\n\nexport type DisputeSeeds = {\n filer: Address;\n nonce: number | bigint;\n};\n\nexport async function findDisputePda(\n seeds: DisputeSeeds,\n config: { programAddress?: Address | undefined } = {},\n): Promise<ProgramDerivedAddress> {\n const {\n programAddress = \"cordhVoshqRV6kzGBmM89A66wuusJGsDCvLMHPLyKed\" as Address<\"cordhVoshqRV6kzGBmM89A66wuusJGsDCvLMHPLyKed\">,\n } = config;\n return await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getBytesEncoder().encode(\n new Uint8Array([100, 105, 115, 112, 117, 116, 101]),\n ),\n getAddressEncoder().encode(seeds.filer),\n getU64Encoder().encode(seeds.nonce),\n ],\n });\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n getAddressEncoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n type Address,\n type ProgramDerivedAddress,\n} from \"@solana/kit\";\n\nexport type JurorStakeSeeds = {\n subaccord: Address;\n juror: Address;\n};\n\nexport async function findJurorStakePda(\n seeds: JurorStakeSeeds,\n config: { programAddress?: Address | undefined } = {},\n): Promise<ProgramDerivedAddress> {\n const {\n programAddress = \"cordhVoshqRV6kzGBmM89A66wuusJGsDCvLMHPLyKed\" as Address<\"cordhVoshqRV6kzGBmM89A66wuusJGsDCvLMHPLyKed\">,\n } = config;\n return await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getBytesEncoder().encode(new Uint8Array([115, 116, 97, 107, 101])),\n getAddressEncoder().encode(seeds.subaccord),\n getAddressEncoder().encode(seeds.juror),\n ],\n });\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n getAddressEncoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n getU64Encoder,\n type Address,\n type ProgramDerivedAddress,\n} from \"@solana/kit\";\n\nexport type PendingUpdateSeeds = {\n subaccord: Address;\n nonce: number | bigint;\n};\n\nexport async function findPendingUpdatePda(\n seeds: PendingUpdateSeeds,\n config: { programAddress?: Address | undefined } = {},\n): Promise<ProgramDerivedAddress> {\n const {\n programAddress = \"cordhVoshqRV6kzGBmM89A66wuusJGsDCvLMHPLyKed\" as Address<\"cordhVoshqRV6kzGBmM89A66wuusJGsDCvLMHPLyKed\">,\n } = config;\n return await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getBytesEncoder().encode(new Uint8Array([117, 112, 100, 97, 116, 101])),\n getAddressEncoder().encode(seeds.subaccord),\n getU64Encoder().encode(seeds.nonce),\n ],\n });\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n getBytesEncoder,\n getProgramDerivedAddress,\n type Address,\n type ProgramDerivedAddress,\n} from \"@solana/kit\";\n\nexport async function findProgramIdentityPda(\n config: { programAddress?: Address | undefined } = {},\n): Promise<ProgramDerivedAddress> {\n const {\n programAddress = \"cordhVoshqRV6kzGBmM89A66wuusJGsDCvLMHPLyKed\" as Address<\"cordhVoshqRV6kzGBmM89A66wuusJGsDCvLMHPLyKed\">,\n } = config;\n return await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getBytesEncoder().encode(\n new Uint8Array([105, 100, 101, 110, 116, 105, 116, 121]),\n ),\n ],\n });\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n getAddressEncoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n getU32Encoder,\n type Address,\n type ProgramDerivedAddress,\n} from \"@solana/kit\";\n\nexport type RoundSeeds = {\n dispute: Address;\n roundIdx: number;\n};\n\nexport async function findRoundPda(\n seeds: RoundSeeds,\n config: { programAddress?: Address | undefined } = {},\n): Promise<ProgramDerivedAddress> {\n const {\n programAddress = \"cordhVoshqRV6kzGBmM89A66wuusJGsDCvLMHPLyKed\" as Address<\"cordhVoshqRV6kzGBmM89A66wuusJGsDCvLMHPLyKed\">,\n } = config;\n return await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getBytesEncoder().encode(new Uint8Array([114, 111, 117, 110, 100])),\n getAddressEncoder().encode(seeds.dispute),\n getU32Encoder().encode(seeds.roundIdx),\n ],\n });\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n fixEncoderSize,\n getAddressEncoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n type Address,\n type ProgramDerivedAddress,\n type ReadonlyUint8Array,\n} from \"@solana/kit\";\n\nexport type SubaccordSeeds = {\n creator: Address;\n domainRef: ReadonlyUint8Array;\n};\n\nexport async function findSubaccordPda(\n seeds: SubaccordSeeds,\n config: { programAddress?: Address | undefined } = {},\n): Promise<ProgramDerivedAddress> {\n const {\n programAddress = \"cordhVoshqRV6kzGBmM89A66wuusJGsDCvLMHPLyKed\" as Address<\"cordhVoshqRV6kzGBmM89A66wuusJGsDCvLMHPLyKed\">,\n } = config;\n return await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getBytesEncoder().encode(\n new Uint8Array([115, 117, 98, 97, 99, 99, 111, 114, 100]),\n ),\n getAddressEncoder().encode(seeds.creator),\n fixEncoderSize(getBytesEncoder(), 32).encode(seeds.domainRef),\n ],\n });\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getAddressEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n getAddressFromResolvedInstructionAccount,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\n\nexport const CANCEL_DISPUTE_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 23, 155, 220, 94, 76, 141, 231, 124,\n]);\n\nexport function getCancelDisputeDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n CANCEL_DISPUTE_DISCRIMINATOR,\n );\n}\n\nexport type CancelDisputeInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountCaller extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountDispute extends string | AccountMeta<string> = string,\n TAccountFeeToken extends string | AccountMeta<string> = string,\n TAccountFilerTokenAccount extends string | AccountMeta<string> = string,\n TAccountFeeVault extends string | AccountMeta<string> = string,\n TAccountTokenProgram extends string | AccountMeta<string> =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\",\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountCaller extends string\n ? WritableSignerAccount<TAccountCaller> &\n AccountSignerMeta<TAccountCaller>\n : TAccountCaller,\n TAccountSubaccord extends string\n ? WritableAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountDispute extends string\n ? WritableAccount<TAccountDispute>\n : TAccountDispute,\n TAccountFeeToken extends string\n ? ReadonlyAccount<TAccountFeeToken>\n : TAccountFeeToken,\n TAccountFilerTokenAccount extends string\n ? WritableAccount<TAccountFilerTokenAccount>\n : TAccountFilerTokenAccount,\n TAccountFeeVault extends string\n ? WritableAccount<TAccountFeeVault>\n : TAccountFeeVault,\n TAccountTokenProgram extends string\n ? ReadonlyAccount<TAccountTokenProgram>\n : TAccountTokenProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type CancelDisputeInstructionData = {\n discriminator: ReadonlyUint8Array;\n};\n\nexport type CancelDisputeInstructionDataArgs = {};\n\nexport function getCancelDisputeInstructionDataEncoder(): FixedSizeEncoder<CancelDisputeInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([[\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)]]),\n (value) => ({ ...value, discriminator: CANCEL_DISPUTE_DISCRIMINATOR }),\n );\n}\n\nexport function getCancelDisputeInstructionDataDecoder(): FixedSizeDecoder<CancelDisputeInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n ]);\n}\n\nexport function getCancelDisputeInstructionDataCodec(): FixedSizeCodec<\n CancelDisputeInstructionDataArgs,\n CancelDisputeInstructionData\n> {\n return combineCodec(\n getCancelDisputeInstructionDataEncoder(),\n getCancelDisputeInstructionDataDecoder(),\n );\n}\n\nexport type CancelDisputeAsyncInput<\n TAccountCaller extends string = string,\n TAccountSubaccord extends string = string,\n TAccountDispute extends string = string,\n TAccountFeeToken extends string = string,\n TAccountFilerTokenAccount extends string = string,\n TAccountFeeVault extends string = string,\n TAccountTokenProgram extends string = string,\n> = {\n /** Any cranker; no authority check (the elapsed timeout is the gate). */\n caller: TransactionSigner<TAccountCaller>;\n subaccord: Address<TAccountSubaccord>;\n dispute: Address<TAccountDispute>;\n feeToken: Address<TAccountFeeToken>;\n /** Refund destination — must be the filer's ATA. */\n filerTokenAccount: Address<TAccountFilerTokenAccount>;\n feeVault?: Address<TAccountFeeVault>;\n tokenProgram?: Address<TAccountTokenProgram>;\n};\n\nexport async function getCancelDisputeInstructionAsync<\n TAccountCaller extends string,\n TAccountSubaccord extends string,\n TAccountDispute extends string,\n TAccountFeeToken extends string,\n TAccountFilerTokenAccount extends string,\n TAccountFeeVault extends string,\n TAccountTokenProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: CancelDisputeAsyncInput<\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountFeeToken,\n TAccountFilerTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n CancelDisputeInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountFeeToken,\n TAccountFilerTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n caller: { value: input.caller ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n dispute: { value: input.dispute ?? null, isWritable: true },\n feeToken: { value: input.feeToken ?? null, isWritable: false },\n filerTokenAccount: {\n value: input.filerTokenAccount ?? null,\n isWritable: true,\n },\n feeVault: { value: input.feeVault ?? null, isWritable: true },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Resolve default values.\n if (!accounts.feeVault.value) {\n accounts.feeVault.value = await getProgramDerivedAddress({\n programAddress:\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\" as Address<\"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\">,\n seeds: [\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"subaccord\",\n accounts.subaccord.value,\n ),\n ),\n getBytesEncoder().encode(\n new Uint8Array([\n 6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206, 235,\n 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140, 245, 133,\n 126, 255, 0, 169,\n ]),\n ),\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"feeToken\",\n accounts.feeToken.value,\n ),\n ),\n ],\n });\n }\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\" as Address<\"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"caller\", accounts.caller),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"dispute\", accounts.dispute),\n getAccountMeta(\"feeToken\", accounts.feeToken),\n getAccountMeta(\"filerTokenAccount\", accounts.filerTokenAccount),\n getAccountMeta(\"feeVault\", accounts.feeVault),\n getAccountMeta(\"tokenProgram\", accounts.tokenProgram),\n ],\n data: getCancelDisputeInstructionDataEncoder().encode({}),\n programAddress,\n } as CancelDisputeInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountFeeToken,\n TAccountFilerTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n >);\n}\n\nexport type CancelDisputeInput<\n TAccountCaller extends string = string,\n TAccountSubaccord extends string = string,\n TAccountDispute extends string = string,\n TAccountFeeToken extends string = string,\n TAccountFilerTokenAccount extends string = string,\n TAccountFeeVault extends string = string,\n TAccountTokenProgram extends string = string,\n> = {\n /** Any cranker; no authority check (the elapsed timeout is the gate). */\n caller: TransactionSigner<TAccountCaller>;\n subaccord: Address<TAccountSubaccord>;\n dispute: Address<TAccountDispute>;\n feeToken: Address<TAccountFeeToken>;\n /** Refund destination — must be the filer's ATA. */\n filerTokenAccount: Address<TAccountFilerTokenAccount>;\n feeVault: Address<TAccountFeeVault>;\n tokenProgram?: Address<TAccountTokenProgram>;\n};\n\nexport function getCancelDisputeInstruction<\n TAccountCaller extends string,\n TAccountSubaccord extends string,\n TAccountDispute extends string,\n TAccountFeeToken extends string,\n TAccountFilerTokenAccount extends string,\n TAccountFeeVault extends string,\n TAccountTokenProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: CancelDisputeInput<\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountFeeToken,\n TAccountFilerTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): CancelDisputeInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountFeeToken,\n TAccountFilerTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n caller: { value: input.caller ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n dispute: { value: input.dispute ?? null, isWritable: true },\n feeToken: { value: input.feeToken ?? null, isWritable: false },\n filerTokenAccount: {\n value: input.filerTokenAccount ?? null,\n isWritable: true,\n },\n feeVault: { value: input.feeVault ?? null, isWritable: true },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Resolve default values.\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\" as Address<\"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"caller\", accounts.caller),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"dispute\", accounts.dispute),\n getAccountMeta(\"feeToken\", accounts.feeToken),\n getAccountMeta(\"filerTokenAccount\", accounts.filerTokenAccount),\n getAccountMeta(\"feeVault\", accounts.feeVault),\n getAccountMeta(\"tokenProgram\", accounts.tokenProgram),\n ],\n data: getCancelDisputeInstructionDataEncoder().encode({}),\n programAddress,\n } as CancelDisputeInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountFeeToken,\n TAccountFilerTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n >);\n}\n\nexport type ParsedCancelDisputeInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** Any cranker; no authority check (the elapsed timeout is the gate). */\n caller: TAccountMetas[0];\n subaccord: TAccountMetas[1];\n dispute: TAccountMetas[2];\n feeToken: TAccountMetas[3];\n /** Refund destination — must be the filer's ATA. */\n filerTokenAccount: TAccountMetas[4];\n feeVault: TAccountMetas[5];\n tokenProgram: TAccountMetas[6];\n };\n data: CancelDisputeInstructionData;\n};\n\nexport function parseCancelDisputeInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedCancelDisputeInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 7) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 7,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n caller: getNextAccount(),\n subaccord: getNextAccount(),\n dispute: getNextAccount(),\n feeToken: getNextAccount(),\n filerTokenAccount: getNextAccount(),\n feeVault: getNextAccount(),\n tokenProgram: getNextAccount(),\n },\n data: getCancelDisputeInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getAddressEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n getU32Decoder,\n getU32Encoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n getAddressFromResolvedInstructionAccount,\n getNonNullResolvedInstructionInput,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { findAppealBondPda } from \"../pdas\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\n\nexport const CLAIM_APPEAL_REFUND_DISCRIMINATOR: ReadonlyUint8Array =\n new Uint8Array([210, 169, 229, 146, 187, 30, 61, 176]);\n\nexport function getClaimAppealRefundDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n CLAIM_APPEAL_REFUND_DISCRIMINATOR,\n );\n}\n\nexport type ClaimAppealRefundInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountCaller extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountDispute extends string | AccountMeta<string> = string,\n TAccountAppealBond extends string | AccountMeta<string> = string,\n TAccountFeeToken extends string | AccountMeta<string> = string,\n TAccountClaimantTokenAccount extends string | AccountMeta<string> = string,\n TAccountFeeVault extends string | AccountMeta<string> = string,\n TAccountTokenProgram extends string | AccountMeta<string> =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\",\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountCaller extends string\n ? WritableSignerAccount<TAccountCaller> &\n AccountSignerMeta<TAccountCaller>\n : TAccountCaller,\n TAccountSubaccord extends string\n ? WritableAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountDispute extends string\n ? ReadonlyAccount<TAccountDispute>\n : TAccountDispute,\n TAccountAppealBond extends string\n ? WritableAccount<TAccountAppealBond>\n : TAccountAppealBond,\n TAccountFeeToken extends string\n ? ReadonlyAccount<TAccountFeeToken>\n : TAccountFeeToken,\n TAccountClaimantTokenAccount extends string\n ? WritableAccount<TAccountClaimantTokenAccount>\n : TAccountClaimantTokenAccount,\n TAccountFeeVault extends string\n ? WritableAccount<TAccountFeeVault>\n : TAccountFeeVault,\n TAccountTokenProgram extends string\n ? ReadonlyAccount<TAccountTokenProgram>\n : TAccountTokenProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type ClaimAppealRefundInstructionData = {\n discriminator: ReadonlyUint8Array;\n roundIdx: number;\n};\n\nexport type ClaimAppealRefundInstructionDataArgs = { roundIdx: number };\n\nexport function getClaimAppealRefundInstructionDataEncoder(): FixedSizeEncoder<ClaimAppealRefundInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"roundIdx\", getU32Encoder()],\n ]),\n (value) => ({ ...value, discriminator: CLAIM_APPEAL_REFUND_DISCRIMINATOR }),\n );\n}\n\nexport function getClaimAppealRefundInstructionDataDecoder(): FixedSizeDecoder<ClaimAppealRefundInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"roundIdx\", getU32Decoder()],\n ]);\n}\n\nexport function getClaimAppealRefundInstructionDataCodec(): FixedSizeCodec<\n ClaimAppealRefundInstructionDataArgs,\n ClaimAppealRefundInstructionData\n> {\n return combineCodec(\n getClaimAppealRefundInstructionDataEncoder(),\n getClaimAppealRefundInstructionDataDecoder(),\n );\n}\n\nexport type ClaimAppealRefundAsyncInput<\n TAccountCaller extends string = string,\n TAccountSubaccord extends string = string,\n TAccountDispute extends string = string,\n TAccountAppealBond extends string = string,\n TAccountFeeToken extends string = string,\n TAccountClaimantTokenAccount extends string = string,\n TAccountFeeVault extends string = string,\n TAccountTokenProgram extends string = string,\n> = {\n caller: TransactionSigner<TAccountCaller>;\n subaccord: Address<TAccountSubaccord>;\n dispute: Address<TAccountDispute>;\n /** The specific appeal bond being claimed. */\n appealBond?: Address<TAccountAppealBond>;\n feeToken: Address<TAccountFeeToken>;\n /**\n * The appellant's ATA — sweep destination. Any caller may pass it; the\n * handler rejects it unless its owner matches the bond's recorded appellant.\n */\n claimantTokenAccount: Address<TAccountClaimantTokenAccount>;\n feeVault?: Address<TAccountFeeVault>;\n tokenProgram?: Address<TAccountTokenProgram>;\n roundIdx: ClaimAppealRefundInstructionDataArgs[\"roundIdx\"];\n};\n\nexport async function getClaimAppealRefundInstructionAsync<\n TAccountCaller extends string,\n TAccountSubaccord extends string,\n TAccountDispute extends string,\n TAccountAppealBond extends string,\n TAccountFeeToken extends string,\n TAccountClaimantTokenAccount extends string,\n TAccountFeeVault extends string,\n TAccountTokenProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: ClaimAppealRefundAsyncInput<\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountAppealBond,\n TAccountFeeToken,\n TAccountClaimantTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n ClaimAppealRefundInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountAppealBond,\n TAccountFeeToken,\n TAccountClaimantTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n caller: { value: input.caller ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n dispute: { value: input.dispute ?? null, isWritable: false },\n appealBond: { value: input.appealBond ?? null, isWritable: true },\n feeToken: { value: input.feeToken ?? null, isWritable: false },\n claimantTokenAccount: {\n value: input.claimantTokenAccount ?? null,\n isWritable: true,\n },\n feeVault: { value: input.feeVault ?? null, isWritable: true },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.appealBond.value) {\n accounts.appealBond.value = await findAppealBondPda({\n dispute: getAddressFromResolvedInstructionAccount(\n \"dispute\",\n accounts.dispute.value,\n ),\n roundIdx: getNonNullResolvedInstructionInput(\"roundIdx\", args.roundIdx),\n });\n }\n if (!accounts.feeVault.value) {\n accounts.feeVault.value = await getProgramDerivedAddress({\n programAddress:\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\" as Address<\"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\">,\n seeds: [\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"subaccord\",\n accounts.subaccord.value,\n ),\n ),\n getBytesEncoder().encode(\n new Uint8Array([\n 6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206, 235,\n 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140, 245, 133,\n 126, 255, 0, 169,\n ]),\n ),\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"feeToken\",\n accounts.feeToken.value,\n ),\n ),\n ],\n });\n }\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\" as Address<\"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"caller\", accounts.caller),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"dispute\", accounts.dispute),\n getAccountMeta(\"appealBond\", accounts.appealBond),\n getAccountMeta(\"feeToken\", accounts.feeToken),\n getAccountMeta(\"claimantTokenAccount\", accounts.claimantTokenAccount),\n getAccountMeta(\"feeVault\", accounts.feeVault),\n getAccountMeta(\"tokenProgram\", accounts.tokenProgram),\n ],\n data: getClaimAppealRefundInstructionDataEncoder().encode(\n args as ClaimAppealRefundInstructionDataArgs,\n ),\n programAddress,\n } as ClaimAppealRefundInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountAppealBond,\n TAccountFeeToken,\n TAccountClaimantTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n >);\n}\n\nexport type ClaimAppealRefundInput<\n TAccountCaller extends string = string,\n TAccountSubaccord extends string = string,\n TAccountDispute extends string = string,\n TAccountAppealBond extends string = string,\n TAccountFeeToken extends string = string,\n TAccountClaimantTokenAccount extends string = string,\n TAccountFeeVault extends string = string,\n TAccountTokenProgram extends string = string,\n> = {\n caller: TransactionSigner<TAccountCaller>;\n subaccord: Address<TAccountSubaccord>;\n dispute: Address<TAccountDispute>;\n /** The specific appeal bond being claimed. */\n appealBond: Address<TAccountAppealBond>;\n feeToken: Address<TAccountFeeToken>;\n /**\n * The appellant's ATA — sweep destination. Any caller may pass it; the\n * handler rejects it unless its owner matches the bond's recorded appellant.\n */\n claimantTokenAccount: Address<TAccountClaimantTokenAccount>;\n feeVault: Address<TAccountFeeVault>;\n tokenProgram?: Address<TAccountTokenProgram>;\n roundIdx: ClaimAppealRefundInstructionDataArgs[\"roundIdx\"];\n};\n\nexport function getClaimAppealRefundInstruction<\n TAccountCaller extends string,\n TAccountSubaccord extends string,\n TAccountDispute extends string,\n TAccountAppealBond extends string,\n TAccountFeeToken extends string,\n TAccountClaimantTokenAccount extends string,\n TAccountFeeVault extends string,\n TAccountTokenProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: ClaimAppealRefundInput<\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountAppealBond,\n TAccountFeeToken,\n TAccountClaimantTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): ClaimAppealRefundInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountAppealBond,\n TAccountFeeToken,\n TAccountClaimantTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n caller: { value: input.caller ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n dispute: { value: input.dispute ?? null, isWritable: false },\n appealBond: { value: input.appealBond ?? null, isWritable: true },\n feeToken: { value: input.feeToken ?? null, isWritable: false },\n claimantTokenAccount: {\n value: input.claimantTokenAccount ?? null,\n isWritable: true,\n },\n feeVault: { value: input.feeVault ?? null, isWritable: true },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\" as Address<\"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"caller\", accounts.caller),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"dispute\", accounts.dispute),\n getAccountMeta(\"appealBond\", accounts.appealBond),\n getAccountMeta(\"feeToken\", accounts.feeToken),\n getAccountMeta(\"claimantTokenAccount\", accounts.claimantTokenAccount),\n getAccountMeta(\"feeVault\", accounts.feeVault),\n getAccountMeta(\"tokenProgram\", accounts.tokenProgram),\n ],\n data: getClaimAppealRefundInstructionDataEncoder().encode(\n args as ClaimAppealRefundInstructionDataArgs,\n ),\n programAddress,\n } as ClaimAppealRefundInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountAppealBond,\n TAccountFeeToken,\n TAccountClaimantTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n >);\n}\n\nexport type ParsedClaimAppealRefundInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n caller: TAccountMetas[0];\n subaccord: TAccountMetas[1];\n dispute: TAccountMetas[2];\n /** The specific appeal bond being claimed. */\n appealBond: TAccountMetas[3];\n feeToken: TAccountMetas[4];\n /**\n * The appellant's ATA — sweep destination. Any caller may pass it; the\n * handler rejects it unless its owner matches the bond's recorded appellant.\n */\n claimantTokenAccount: TAccountMetas[5];\n feeVault: TAccountMetas[6];\n tokenProgram: TAccountMetas[7];\n };\n data: ClaimAppealRefundInstructionData;\n};\n\nexport function parseClaimAppealRefundInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedClaimAppealRefundInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 8) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 8,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n caller: getNextAccount(),\n subaccord: getNextAccount(),\n dispute: getNextAccount(),\n appealBond: getNextAccount(),\n feeToken: getNextAccount(),\n claimantTokenAccount: getNextAccount(),\n feeVault: getNextAccount(),\n tokenProgram: getNextAccount(),\n },\n data: getClaimAppealRefundInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getAddressEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlySignerAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n getAddressFromResolvedInstructionAccount,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\n\nexport const CLAIM_FILING_BOUNTY_DISCRIMINATOR: ReadonlyUint8Array =\n new Uint8Array([0, 179, 28, 122, 171, 246, 12, 132]);\n\nexport function getClaimFilingBountyDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n CLAIM_FILING_BOUNTY_DISCRIMINATOR,\n );\n}\n\nexport type ClaimFilingBountyInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountCaller extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountDispute extends string | AccountMeta<string> = string,\n TAccountFeeToken extends string | AccountMeta<string> = string,\n TAccountFilerTokenAccount extends string | AccountMeta<string> = string,\n TAccountFeeVault extends string | AccountMeta<string> = string,\n TAccountTokenProgram extends string | AccountMeta<string> =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\",\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountCaller extends string\n ? ReadonlySignerAccount<TAccountCaller> &\n AccountSignerMeta<TAccountCaller>\n : TAccountCaller,\n TAccountSubaccord extends string\n ? WritableAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountDispute extends string\n ? WritableAccount<TAccountDispute>\n : TAccountDispute,\n TAccountFeeToken extends string\n ? ReadonlyAccount<TAccountFeeToken>\n : TAccountFeeToken,\n TAccountFilerTokenAccount extends string\n ? WritableAccount<TAccountFilerTokenAccount>\n : TAccountFilerTokenAccount,\n TAccountFeeVault extends string\n ? WritableAccount<TAccountFeeVault>\n : TAccountFeeVault,\n TAccountTokenProgram extends string\n ? ReadonlyAccount<TAccountTokenProgram>\n : TAccountTokenProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type ClaimFilingBountyInstructionData = {\n discriminator: ReadonlyUint8Array;\n};\n\nexport type ClaimFilingBountyInstructionDataArgs = {};\n\nexport function getClaimFilingBountyInstructionDataEncoder(): FixedSizeEncoder<ClaimFilingBountyInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([[\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)]]),\n (value) => ({ ...value, discriminator: CLAIM_FILING_BOUNTY_DISCRIMINATOR }),\n );\n}\n\nexport function getClaimFilingBountyInstructionDataDecoder(): FixedSizeDecoder<ClaimFilingBountyInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n ]);\n}\n\nexport function getClaimFilingBountyInstructionDataCodec(): FixedSizeCodec<\n ClaimFilingBountyInstructionDataArgs,\n ClaimFilingBountyInstructionData\n> {\n return combineCodec(\n getClaimFilingBountyInstructionDataEncoder(),\n getClaimFilingBountyInstructionDataDecoder(),\n );\n}\n\nexport type ClaimFilingBountyAsyncInput<\n TAccountCaller extends string = string,\n TAccountSubaccord extends string = string,\n TAccountDispute extends string = string,\n TAccountFeeToken extends string = string,\n TAccountFilerTokenAccount extends string = string,\n TAccountFeeVault extends string = string,\n TAccountTokenProgram extends string = string,\n> = {\n /** Any cranker; the dispute's terminal state is the gate. */\n caller: TransactionSigner<TAccountCaller>;\n subaccord: Address<TAccountSubaccord>;\n dispute: Address<TAccountDispute>;\n feeToken: Address<TAccountFeeToken>;\n /**\n * The filer's ATA — sweep destination. Any caller may pass it; Anchor's\n * ATA constraint pins it to `dispute.filer`.\n */\n filerTokenAccount: Address<TAccountFilerTokenAccount>;\n feeVault?: Address<TAccountFeeVault>;\n tokenProgram?: Address<TAccountTokenProgram>;\n};\n\nexport async function getClaimFilingBountyInstructionAsync<\n TAccountCaller extends string,\n TAccountSubaccord extends string,\n TAccountDispute extends string,\n TAccountFeeToken extends string,\n TAccountFilerTokenAccount extends string,\n TAccountFeeVault extends string,\n TAccountTokenProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: ClaimFilingBountyAsyncInput<\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountFeeToken,\n TAccountFilerTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n ClaimFilingBountyInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountFeeToken,\n TAccountFilerTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n caller: { value: input.caller ?? null, isWritable: false },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n dispute: { value: input.dispute ?? null, isWritable: true },\n feeToken: { value: input.feeToken ?? null, isWritable: false },\n filerTokenAccount: {\n value: input.filerTokenAccount ?? null,\n isWritable: true,\n },\n feeVault: { value: input.feeVault ?? null, isWritable: true },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Resolve default values.\n if (!accounts.feeVault.value) {\n accounts.feeVault.value = await getProgramDerivedAddress({\n programAddress:\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\" as Address<\"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\">,\n seeds: [\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"subaccord\",\n accounts.subaccord.value,\n ),\n ),\n getBytesEncoder().encode(\n new Uint8Array([\n 6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206, 235,\n 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140, 245, 133,\n 126, 255, 0, 169,\n ]),\n ),\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"feeToken\",\n accounts.feeToken.value,\n ),\n ),\n ],\n });\n }\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\" as Address<\"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"caller\", accounts.caller),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"dispute\", accounts.dispute),\n getAccountMeta(\"feeToken\", accounts.feeToken),\n getAccountMeta(\"filerTokenAccount\", accounts.filerTokenAccount),\n getAccountMeta(\"feeVault\", accounts.feeVault),\n getAccountMeta(\"tokenProgram\", accounts.tokenProgram),\n ],\n data: getClaimFilingBountyInstructionDataEncoder().encode({}),\n programAddress,\n } as ClaimFilingBountyInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountFeeToken,\n TAccountFilerTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n >);\n}\n\nexport type ClaimFilingBountyInput<\n TAccountCaller extends string = string,\n TAccountSubaccord extends string = string,\n TAccountDispute extends string = string,\n TAccountFeeToken extends string = string,\n TAccountFilerTokenAccount extends string = string,\n TAccountFeeVault extends string = string,\n TAccountTokenProgram extends string = string,\n> = {\n /** Any cranker; the dispute's terminal state is the gate. */\n caller: TransactionSigner<TAccountCaller>;\n subaccord: Address<TAccountSubaccord>;\n dispute: Address<TAccountDispute>;\n feeToken: Address<TAccountFeeToken>;\n /**\n * The filer's ATA — sweep destination. Any caller may pass it; Anchor's\n * ATA constraint pins it to `dispute.filer`.\n */\n filerTokenAccount: Address<TAccountFilerTokenAccount>;\n feeVault: Address<TAccountFeeVault>;\n tokenProgram?: Address<TAccountTokenProgram>;\n};\n\nexport function getClaimFilingBountyInstruction<\n TAccountCaller extends string,\n TAccountSubaccord extends string,\n TAccountDispute extends string,\n TAccountFeeToken extends string,\n TAccountFilerTokenAccount extends string,\n TAccountFeeVault extends string,\n TAccountTokenProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: ClaimFilingBountyInput<\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountFeeToken,\n TAccountFilerTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): ClaimFilingBountyInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountFeeToken,\n TAccountFilerTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n caller: { value: input.caller ?? null, isWritable: false },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n dispute: { value: input.dispute ?? null, isWritable: true },\n feeToken: { value: input.feeToken ?? null, isWritable: false },\n filerTokenAccount: {\n value: input.filerTokenAccount ?? null,\n isWritable: true,\n },\n feeVault: { value: input.feeVault ?? null, isWritable: true },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Resolve default values.\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\" as Address<\"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"caller\", accounts.caller),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"dispute\", accounts.dispute),\n getAccountMeta(\"feeToken\", accounts.feeToken),\n getAccountMeta(\"filerTokenAccount\", accounts.filerTokenAccount),\n getAccountMeta(\"feeVault\", accounts.feeVault),\n getAccountMeta(\"tokenProgram\", accounts.tokenProgram),\n ],\n data: getClaimFilingBountyInstructionDataEncoder().encode({}),\n programAddress,\n } as ClaimFilingBountyInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountFeeToken,\n TAccountFilerTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n >);\n}\n\nexport type ParsedClaimFilingBountyInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** Any cranker; the dispute's terminal state is the gate. */\n caller: TAccountMetas[0];\n subaccord: TAccountMetas[1];\n dispute: TAccountMetas[2];\n feeToken: TAccountMetas[3];\n /**\n * The filer's ATA — sweep destination. Any caller may pass it; Anchor's\n * ATA constraint pins it to `dispute.filer`.\n */\n filerTokenAccount: TAccountMetas[4];\n feeVault: TAccountMetas[5];\n tokenProgram: TAccountMetas[6];\n };\n data: ClaimFilingBountyInstructionData;\n};\n\nexport function parseClaimFilingBountyInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedClaimFilingBountyInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 7) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 7,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n caller: getNextAccount(),\n subaccord: getNextAccount(),\n dispute: getNextAccount(),\n feeToken: getNextAccount(),\n filerTokenAccount: getNextAccount(),\n feeVault: getNextAccount(),\n tokenProgram: getNextAccount(),\n },\n data: getClaimFilingBountyInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\n\nexport const COMMIT_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 223, 140, 142, 165, 229, 208, 156, 74,\n]);\n\nexport function getCommitDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(COMMIT_DISCRIMINATOR);\n}\n\nexport type CommitInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountJuror extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountDispute extends string | AccountMeta<string> = string,\n TAccountRound extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountJuror extends string\n ? WritableSignerAccount<TAccountJuror> &\n AccountSignerMeta<TAccountJuror>\n : TAccountJuror,\n TAccountSubaccord extends string\n ? ReadonlyAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountDispute extends string\n ? WritableAccount<TAccountDispute>\n : TAccountDispute,\n TAccountRound extends string\n ? WritableAccount<TAccountRound>\n : TAccountRound,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type CommitInstructionData = {\n discriminator: ReadonlyUint8Array;\n commitment: ReadonlyUint8Array;\n};\n\nexport type CommitInstructionDataArgs = { commitment: ReadonlyUint8Array };\n\nexport function getCommitInstructionDataEncoder(): FixedSizeEncoder<CommitInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"commitment\", fixEncoderSize(getBytesEncoder(), 32)],\n ]),\n (value) => ({ ...value, discriminator: COMMIT_DISCRIMINATOR }),\n );\n}\n\nexport function getCommitInstructionDataDecoder(): FixedSizeDecoder<CommitInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"commitment\", fixDecoderSize(getBytesDecoder(), 32)],\n ]);\n}\n\nexport function getCommitInstructionDataCodec(): FixedSizeCodec<\n CommitInstructionDataArgs,\n CommitInstructionData\n> {\n return combineCodec(\n getCommitInstructionDataEncoder(),\n getCommitInstructionDataDecoder(),\n );\n}\n\nexport type CommitInput<\n TAccountJuror extends string = string,\n TAccountSubaccord extends string = string,\n TAccountDispute extends string = string,\n TAccountRound extends string = string,\n> = {\n juror: TransactionSigner<TAccountJuror>;\n subaccord: Address<TAccountSubaccord>;\n dispute: Address<TAccountDispute>;\n round: Address<TAccountRound>;\n commitment: CommitInstructionDataArgs[\"commitment\"];\n};\n\nexport function getCommitInstruction<\n TAccountJuror extends string,\n TAccountSubaccord extends string,\n TAccountDispute extends string,\n TAccountRound extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: CommitInput<\n TAccountJuror,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound\n >,\n config?: { programAddress?: TProgramAddress },\n): CommitInstruction<\n TProgramAddress,\n TAccountJuror,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n juror: { value: input.juror ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: false },\n dispute: { value: input.dispute ?? null, isWritable: true },\n round: { value: input.round ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"juror\", accounts.juror),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"dispute\", accounts.dispute),\n getAccountMeta(\"round\", accounts.round),\n ],\n data: getCommitInstructionDataEncoder().encode(\n args as CommitInstructionDataArgs,\n ),\n programAddress,\n } as CommitInstruction<\n TProgramAddress,\n TAccountJuror,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound\n >);\n}\n\nexport type ParsedCommitInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n juror: TAccountMetas[0];\n subaccord: TAccountMetas[1];\n dispute: TAccountMetas[2];\n round: TAccountMetas[3];\n };\n data: CommitInstructionData;\n};\n\nexport function parseCommitInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedCommitInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 4) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 4,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n juror: getNextAccount(),\n subaccord: getNextAccount(),\n dispute: getNextAccount(),\n round: getNextAccount(),\n },\n data: getCommitInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlySignerAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\n\nexport const COMMIT_VRF_CALLBACK_DISCRIMINATOR: ReadonlyUint8Array =\n new Uint8Array([51, 127, 131, 85, 83, 117, 121, 59]);\n\nexport function getCommitVrfCallbackDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n COMMIT_VRF_CALLBACK_DISCRIMINATOR,\n );\n}\n\nexport type CommitVrfCallbackInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountVrfProgramIdentity extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountDispute extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountVrfProgramIdentity extends string\n ? ReadonlySignerAccount<TAccountVrfProgramIdentity> &\n AccountSignerMeta<TAccountVrfProgramIdentity>\n : TAccountVrfProgramIdentity,\n TAccountSubaccord extends string\n ? ReadonlyAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountDispute extends string\n ? WritableAccount<TAccountDispute>\n : TAccountDispute,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type CommitVrfCallbackInstructionData = {\n discriminator: ReadonlyUint8Array;\n randomness: ReadonlyUint8Array;\n};\n\nexport type CommitVrfCallbackInstructionDataArgs = {\n randomness: ReadonlyUint8Array;\n};\n\nexport function getCommitVrfCallbackInstructionDataEncoder(): FixedSizeEncoder<CommitVrfCallbackInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"randomness\", fixEncoderSize(getBytesEncoder(), 32)],\n ]),\n (value) => ({ ...value, discriminator: COMMIT_VRF_CALLBACK_DISCRIMINATOR }),\n );\n}\n\nexport function getCommitVrfCallbackInstructionDataDecoder(): FixedSizeDecoder<CommitVrfCallbackInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"randomness\", fixDecoderSize(getBytesDecoder(), 32)],\n ]);\n}\n\nexport function getCommitVrfCallbackInstructionDataCodec(): FixedSizeCodec<\n CommitVrfCallbackInstructionDataArgs,\n CommitVrfCallbackInstructionData\n> {\n return combineCodec(\n getCommitVrfCallbackInstructionDataEncoder(),\n getCommitVrfCallbackInstructionDataDecoder(),\n );\n}\n\nexport type CommitVrfCallbackInput<\n TAccountVrfProgramIdentity extends string = string,\n TAccountSubaccord extends string = string,\n TAccountDispute extends string = string,\n> = {\n vrfProgramIdentity: TransactionSigner<TAccountVrfProgramIdentity>;\n subaccord: Address<TAccountSubaccord>;\n dispute: Address<TAccountDispute>;\n randomness: CommitVrfCallbackInstructionDataArgs[\"randomness\"];\n};\n\nexport function getCommitVrfCallbackInstruction<\n TAccountVrfProgramIdentity extends string,\n TAccountSubaccord extends string,\n TAccountDispute extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: CommitVrfCallbackInput<\n TAccountVrfProgramIdentity,\n TAccountSubaccord,\n TAccountDispute\n >,\n config?: { programAddress?: TProgramAddress },\n): CommitVrfCallbackInstruction<\n TProgramAddress,\n TAccountVrfProgramIdentity,\n TAccountSubaccord,\n TAccountDispute\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n vrfProgramIdentity: {\n value: input.vrfProgramIdentity ?? null,\n isWritable: false,\n },\n subaccord: { value: input.subaccord ?? null, isWritable: false },\n dispute: { value: input.dispute ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"vrfProgramIdentity\", accounts.vrfProgramIdentity),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"dispute\", accounts.dispute),\n ],\n data: getCommitVrfCallbackInstructionDataEncoder().encode(\n args as CommitVrfCallbackInstructionDataArgs,\n ),\n programAddress,\n } as CommitVrfCallbackInstruction<\n TProgramAddress,\n TAccountVrfProgramIdentity,\n TAccountSubaccord,\n TAccountDispute\n >);\n}\n\nexport type ParsedCommitVrfCallbackInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n vrfProgramIdentity: TAccountMetas[0];\n subaccord: TAccountMetas[1];\n dispute: TAccountMetas[2];\n };\n data: CommitVrfCallbackInstructionData;\n};\n\nexport function parseCommitVrfCallbackInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedCommitVrfCallbackInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 3) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 3,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n vrfProgramIdentity: getNextAccount(),\n subaccord: getNextAccount(),\n dispute: getNextAccount(),\n },\n data: getCommitVrfCallbackInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getAddressEncoder,\n getArrayDecoder,\n getArrayEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n getAddressFromResolvedInstructionAccount,\n getNonNullResolvedInstructionInput,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { findAccordStatePda, findDisputePda } from \"../pdas\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\n\nexport const CREATE_DISPUTE_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 161, 99, 53, 116, 60, 79, 149, 105,\n]);\n\nexport function getCreateDisputeDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n CREATE_DISPUTE_DISCRIMINATOR,\n );\n}\n\nexport type CreateDisputeInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountFiler extends string | AccountMeta<string> = string,\n TAccountRentPayer extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountAccordState extends string | AccountMeta<string> = string,\n TAccountDispute extends string | AccountMeta<string> = string,\n TAccountFeeToken extends string | AccountMeta<string> = string,\n TAccountFilerTokenAccount extends string | AccountMeta<string> = string,\n TAccountFeeVault extends string | AccountMeta<string> = string,\n TAccountTokenProgram extends string | AccountMeta<string> =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\",\n TAccountAssociatedTokenProgram extends string | AccountMeta<string> =\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\",\n TAccountSystemProgram extends string | AccountMeta<string> =\n \"11111111111111111111111111111111\",\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountFiler extends string\n ? WritableSignerAccount<TAccountFiler> &\n AccountSignerMeta<TAccountFiler>\n : TAccountFiler,\n TAccountRentPayer extends string\n ? WritableSignerAccount<TAccountRentPayer> &\n AccountSignerMeta<TAccountRentPayer>\n : TAccountRentPayer,\n TAccountSubaccord extends string\n ? WritableAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountAccordState extends string\n ? ReadonlyAccount<TAccountAccordState>\n : TAccountAccordState,\n TAccountDispute extends string\n ? WritableAccount<TAccountDispute>\n : TAccountDispute,\n TAccountFeeToken extends string\n ? ReadonlyAccount<TAccountFeeToken>\n : TAccountFeeToken,\n TAccountFilerTokenAccount extends string\n ? WritableAccount<TAccountFilerTokenAccount>\n : TAccountFilerTokenAccount,\n TAccountFeeVault extends string\n ? WritableAccount<TAccountFeeVault>\n : TAccountFeeVault,\n TAccountTokenProgram extends string\n ? ReadonlyAccount<TAccountTokenProgram>\n : TAccountTokenProgram,\n TAccountAssociatedTokenProgram extends string\n ? ReadonlyAccount<TAccountAssociatedTokenProgram>\n : TAccountAssociatedTokenProgram,\n TAccountSystemProgram extends string\n ? ReadonlyAccount<TAccountSystemProgram>\n : TAccountSystemProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type CreateDisputeInstructionData = {\n discriminator: ReadonlyUint8Array;\n options: Array<ReadonlyUint8Array>;\n evidenceHash: ReadonlyUint8Array;\n nonce: bigint;\n fee: bigint;\n};\n\nexport type CreateDisputeInstructionDataArgs = {\n options: Array<ReadonlyUint8Array>;\n evidenceHash: ReadonlyUint8Array;\n nonce: number | bigint;\n fee: number | bigint;\n};\n\nexport function getCreateDisputeInstructionDataEncoder(): Encoder<CreateDisputeInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"options\", getArrayEncoder(fixEncoderSize(getBytesEncoder(), 32))],\n [\"evidenceHash\", fixEncoderSize(getBytesEncoder(), 32)],\n [\"nonce\", getU64Encoder()],\n [\"fee\", getU64Encoder()],\n ]),\n (value) => ({ ...value, discriminator: CREATE_DISPUTE_DISCRIMINATOR }),\n );\n}\n\nexport function getCreateDisputeInstructionDataDecoder(): Decoder<CreateDisputeInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"options\", getArrayDecoder(fixDecoderSize(getBytesDecoder(), 32))],\n [\"evidenceHash\", fixDecoderSize(getBytesDecoder(), 32)],\n [\"nonce\", getU64Decoder()],\n [\"fee\", getU64Decoder()],\n ]);\n}\n\nexport function getCreateDisputeInstructionDataCodec(): Codec<\n CreateDisputeInstructionDataArgs,\n CreateDisputeInstructionData\n> {\n return combineCodec(\n getCreateDisputeInstructionDataEncoder(),\n getCreateDisputeInstructionDataDecoder(),\n );\n}\n\nexport type CreateDisputeAsyncInput<\n TAccountFiler extends string = string,\n TAccountRentPayer extends string = string,\n TAccountSubaccord extends string = string,\n TAccountAccordState extends string = string,\n TAccountDispute extends string = string,\n TAccountFeeToken extends string = string,\n TAccountFilerTokenAccount extends string = string,\n TAccountFeeVault extends string = string,\n TAccountTokenProgram extends string = string,\n TAccountAssociatedTokenProgram extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n filer: TransactionSigner<TAccountFiler>;\n /**\n * Rent payer for the dispute `init` + fee_vault `init_if_needed`. MUST be\n * data-free (the system program rejects lamport transfers from\n * data-carrying accounts), so Arbitrables whose filer is a data-carrying\n * PDA pass their crank caller here; wallet filers pass themselves. The\n * dispute-fee itself still flows from `filer_token_account` — this\n * account only carries rent lamports (canon.challenge.spec BLOCKER fix).\n */\n rentPayer: TransactionSigner<TAccountRentPayer>;\n subaccord: Address<TAccountSubaccord>;\n accordState?: Address<TAccountAccordState>;\n dispute?: Address<TAccountDispute>;\n feeToken: Address<TAccountFeeToken>;\n filerTokenAccount?: Address<TAccountFilerTokenAccount>;\n /**\n * Subaccord PDA's fee_vault ATA (ADR-0020). Created on first dispute if\n * it doesn't exist yet.\n */\n feeVault?: Address<TAccountFeeVault>;\n tokenProgram?: Address<TAccountTokenProgram>;\n associatedTokenProgram?: Address<TAccountAssociatedTokenProgram>;\n systemProgram?: Address<TAccountSystemProgram>;\n options: CreateDisputeInstructionDataArgs[\"options\"];\n evidenceHash: CreateDisputeInstructionDataArgs[\"evidenceHash\"];\n nonce: CreateDisputeInstructionDataArgs[\"nonce\"];\n fee: CreateDisputeInstructionDataArgs[\"fee\"];\n};\n\nexport async function getCreateDisputeInstructionAsync<\n TAccountFiler extends string,\n TAccountRentPayer extends string,\n TAccountSubaccord extends string,\n TAccountAccordState extends string,\n TAccountDispute extends string,\n TAccountFeeToken extends string,\n TAccountFilerTokenAccount extends string,\n TAccountFeeVault extends string,\n TAccountTokenProgram extends string,\n TAccountAssociatedTokenProgram extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: CreateDisputeAsyncInput<\n TAccountFiler,\n TAccountRentPayer,\n TAccountSubaccord,\n TAccountAccordState,\n TAccountDispute,\n TAccountFeeToken,\n TAccountFilerTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram,\n TAccountAssociatedTokenProgram,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n CreateDisputeInstruction<\n TProgramAddress,\n TAccountFiler,\n TAccountRentPayer,\n TAccountSubaccord,\n TAccountAccordState,\n TAccountDispute,\n TAccountFeeToken,\n TAccountFilerTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram,\n TAccountAssociatedTokenProgram,\n TAccountSystemProgram\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n filer: { value: input.filer ?? null, isWritable: true },\n rentPayer: { value: input.rentPayer ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n accordState: { value: input.accordState ?? null, isWritable: false },\n dispute: { value: input.dispute ?? null, isWritable: true },\n feeToken: { value: input.feeToken ?? null, isWritable: false },\n filerTokenAccount: {\n value: input.filerTokenAccount ?? null,\n isWritable: true,\n },\n feeVault: { value: input.feeVault ?? null, isWritable: true },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n associatedTokenProgram: {\n value: input.associatedTokenProgram ?? null,\n isWritable: false,\n },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.accordState.value) {\n accounts.accordState.value = await findAccordStatePda();\n }\n if (!accounts.dispute.value) {\n accounts.dispute.value = await findDisputePda({\n filer: getAddressFromResolvedInstructionAccount(\n \"filer\",\n accounts.filer.value,\n ),\n nonce: getNonNullResolvedInstructionInput(\"nonce\", args.nonce),\n });\n }\n if (!accounts.filerTokenAccount.value) {\n accounts.filerTokenAccount.value = await getProgramDerivedAddress({\n programAddress:\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\" as Address<\"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\">,\n seeds: [\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"filer\",\n accounts.filer.value,\n ),\n ),\n getBytesEncoder().encode(\n new Uint8Array([\n 6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206, 235,\n 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140, 245, 133,\n 126, 255, 0, 169,\n ]),\n ),\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"feeToken\",\n accounts.feeToken.value,\n ),\n ),\n ],\n });\n }\n if (!accounts.feeVault.value) {\n accounts.feeVault.value = await getProgramDerivedAddress({\n programAddress:\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\" as Address<\"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\">,\n seeds: [\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"subaccord\",\n accounts.subaccord.value,\n ),\n ),\n getBytesEncoder().encode(\n new Uint8Array([\n 6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206, 235,\n 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140, 245, 133,\n 126, 255, 0, 169,\n ]),\n ),\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"feeToken\",\n accounts.feeToken.value,\n ),\n ),\n ],\n });\n }\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\" as Address<\"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\">;\n }\n if (!accounts.associatedTokenProgram.value) {\n accounts.associatedTokenProgram.value =\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\" as Address<\"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\">;\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n \"11111111111111111111111111111111\" as Address<\"11111111111111111111111111111111\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"filer\", accounts.filer),\n getAccountMeta(\"rentPayer\", accounts.rentPayer),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"accordState\", accounts.accordState),\n getAccountMeta(\"dispute\", accounts.dispute),\n getAccountMeta(\"feeToken\", accounts.feeToken),\n getAccountMeta(\"filerTokenAccount\", accounts.filerTokenAccount),\n getAccountMeta(\"feeVault\", accounts.feeVault),\n getAccountMeta(\"tokenProgram\", accounts.tokenProgram),\n getAccountMeta(\"associatedTokenProgram\", accounts.associatedTokenProgram),\n getAccountMeta(\"systemProgram\", accounts.systemProgram),\n ],\n data: getCreateDisputeInstructionDataEncoder().encode(\n args as CreateDisputeInstructionDataArgs,\n ),\n programAddress,\n } as CreateDisputeInstruction<\n TProgramAddress,\n TAccountFiler,\n TAccountRentPayer,\n TAccountSubaccord,\n TAccountAccordState,\n TAccountDispute,\n TAccountFeeToken,\n TAccountFilerTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram,\n TAccountAssociatedTokenProgram,\n TAccountSystemProgram\n >);\n}\n\nexport type CreateDisputeInput<\n TAccountFiler extends string = string,\n TAccountRentPayer extends string = string,\n TAccountSubaccord extends string = string,\n TAccountAccordState extends string = string,\n TAccountDispute extends string = string,\n TAccountFeeToken extends string = string,\n TAccountFilerTokenAccount extends string = string,\n TAccountFeeVault extends string = string,\n TAccountTokenProgram extends string = string,\n TAccountAssociatedTokenProgram extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n filer: TransactionSigner<TAccountFiler>;\n /**\n * Rent payer for the dispute `init` + fee_vault `init_if_needed`. MUST be\n * data-free (the system program rejects lamport transfers from\n * data-carrying accounts), so Arbitrables whose filer is a data-carrying\n * PDA pass their crank caller here; wallet filers pass themselves. The\n * dispute-fee itself still flows from `filer_token_account` — this\n * account only carries rent lamports (canon.challenge.spec BLOCKER fix).\n */\n rentPayer: TransactionSigner<TAccountRentPayer>;\n subaccord: Address<TAccountSubaccord>;\n accordState: Address<TAccountAccordState>;\n dispute: Address<TAccountDispute>;\n feeToken: Address<TAccountFeeToken>;\n filerTokenAccount: Address<TAccountFilerTokenAccount>;\n /**\n * Subaccord PDA's fee_vault ATA (ADR-0020). Created on first dispute if\n * it doesn't exist yet.\n */\n feeVault: Address<TAccountFeeVault>;\n tokenProgram?: Address<TAccountTokenProgram>;\n associatedTokenProgram?: Address<TAccountAssociatedTokenProgram>;\n systemProgram?: Address<TAccountSystemProgram>;\n options: CreateDisputeInstructionDataArgs[\"options\"];\n evidenceHash: CreateDisputeInstructionDataArgs[\"evidenceHash\"];\n nonce: CreateDisputeInstructionDataArgs[\"nonce\"];\n fee: CreateDisputeInstructionDataArgs[\"fee\"];\n};\n\nexport function getCreateDisputeInstruction<\n TAccountFiler extends string,\n TAccountRentPayer extends string,\n TAccountSubaccord extends string,\n TAccountAccordState extends string,\n TAccountDispute extends string,\n TAccountFeeToken extends string,\n TAccountFilerTokenAccount extends string,\n TAccountFeeVault extends string,\n TAccountTokenProgram extends string,\n TAccountAssociatedTokenProgram extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: CreateDisputeInput<\n TAccountFiler,\n TAccountRentPayer,\n TAccountSubaccord,\n TAccountAccordState,\n TAccountDispute,\n TAccountFeeToken,\n TAccountFilerTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram,\n TAccountAssociatedTokenProgram,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): CreateDisputeInstruction<\n TProgramAddress,\n TAccountFiler,\n TAccountRentPayer,\n TAccountSubaccord,\n TAccountAccordState,\n TAccountDispute,\n TAccountFeeToken,\n TAccountFilerTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram,\n TAccountAssociatedTokenProgram,\n TAccountSystemProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n filer: { value: input.filer ?? null, isWritable: true },\n rentPayer: { value: input.rentPayer ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n accordState: { value: input.accordState ?? null, isWritable: false },\n dispute: { value: input.dispute ?? null, isWritable: true },\n feeToken: { value: input.feeToken ?? null, isWritable: false },\n filerTokenAccount: {\n value: input.filerTokenAccount ?? null,\n isWritable: true,\n },\n feeVault: { value: input.feeVault ?? null, isWritable: true },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n associatedTokenProgram: {\n value: input.associatedTokenProgram ?? null,\n isWritable: false,\n },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\" as Address<\"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\">;\n }\n if (!accounts.associatedTokenProgram.value) {\n accounts.associatedTokenProgram.value =\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\" as Address<\"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\">;\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n \"11111111111111111111111111111111\" as Address<\"11111111111111111111111111111111\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"filer\", accounts.filer),\n getAccountMeta(\"rentPayer\", accounts.rentPayer),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"accordState\", accounts.accordState),\n getAccountMeta(\"dispute\", accounts.dispute),\n getAccountMeta(\"feeToken\", accounts.feeToken),\n getAccountMeta(\"filerTokenAccount\", accounts.filerTokenAccount),\n getAccountMeta(\"feeVault\", accounts.feeVault),\n getAccountMeta(\"tokenProgram\", accounts.tokenProgram),\n getAccountMeta(\"associatedTokenProgram\", accounts.associatedTokenProgram),\n getAccountMeta(\"systemProgram\", accounts.systemProgram),\n ],\n data: getCreateDisputeInstructionDataEncoder().encode(\n args as CreateDisputeInstructionDataArgs,\n ),\n programAddress,\n } as CreateDisputeInstruction<\n TProgramAddress,\n TAccountFiler,\n TAccountRentPayer,\n TAccountSubaccord,\n TAccountAccordState,\n TAccountDispute,\n TAccountFeeToken,\n TAccountFilerTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram,\n TAccountAssociatedTokenProgram,\n TAccountSystemProgram\n >);\n}\n\nexport type ParsedCreateDisputeInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n filer: TAccountMetas[0];\n /**\n * Rent payer for the dispute `init` + fee_vault `init_if_needed`. MUST be\n * data-free (the system program rejects lamport transfers from\n * data-carrying accounts), so Arbitrables whose filer is a data-carrying\n * PDA pass their crank caller here; wallet filers pass themselves. The\n * dispute-fee itself still flows from `filer_token_account` — this\n * account only carries rent lamports (canon.challenge.spec BLOCKER fix).\n */\n rentPayer: TAccountMetas[1];\n subaccord: TAccountMetas[2];\n accordState: TAccountMetas[3];\n dispute: TAccountMetas[4];\n feeToken: TAccountMetas[5];\n filerTokenAccount: TAccountMetas[6];\n /**\n * Subaccord PDA's fee_vault ATA (ADR-0020). Created on first dispute if\n * it doesn't exist yet.\n */\n feeVault: TAccountMetas[7];\n tokenProgram: TAccountMetas[8];\n associatedTokenProgram: TAccountMetas[9];\n systemProgram: TAccountMetas[10];\n };\n data: CreateDisputeInstructionData;\n};\n\nexport function parseCreateDisputeInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedCreateDisputeInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 11) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 11,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n filer: getNextAccount(),\n rentPayer: getNextAccount(),\n subaccord: getNextAccount(),\n accordState: getNextAccount(),\n dispute: getNextAccount(),\n feeToken: getNextAccount(),\n filerTokenAccount: getNextAccount(),\n feeVault: getNextAccount(),\n tokenProgram: getNextAccount(),\n associatedTokenProgram: getNextAccount(),\n systemProgram: getNextAccount(),\n },\n data: getCreateDisputeInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getAddressDecoder,\n getAddressEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n getU16Decoder,\n getU16Encoder,\n getU32Decoder,\n getU32Encoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n getAddressFromResolvedInstructionAccount,\n getNonNullResolvedInstructionInput,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { findSubaccordPda } from \"../pdas\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\nimport {\n getAggregationDecoder,\n getAggregationEncoder,\n getShortfallPolicyDecoder,\n getShortfallPolicyEncoder,\n type Aggregation,\n type AggregationArgs,\n type ShortfallPolicy,\n type ShortfallPolicyArgs,\n} from \"../types\";\n\nexport const CREATE_SUBACCORD_DISCRIMINATOR: ReadonlyUint8Array =\n new Uint8Array([135, 240, 91, 50, 192, 161, 177, 22]);\n\nexport function getCreateSubaccordDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n CREATE_SUBACCORD_DISCRIMINATOR,\n );\n}\n\nexport type CreateSubaccordInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountCreator extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountStakingToken extends string | AccountMeta<string> = string,\n TAccountFeeToken extends string | AccountMeta<string> = string,\n TAccountSystemProgram extends string | AccountMeta<string> =\n \"11111111111111111111111111111111\",\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountCreator extends string\n ? WritableSignerAccount<TAccountCreator> &\n AccountSignerMeta<TAccountCreator>\n : TAccountCreator,\n TAccountSubaccord extends string\n ? WritableAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountStakingToken extends string\n ? ReadonlyAccount<TAccountStakingToken>\n : TAccountStakingToken,\n TAccountFeeToken extends string\n ? ReadonlyAccount<TAccountFeeToken>\n : TAccountFeeToken,\n TAccountSystemProgram extends string\n ? ReadonlyAccount<TAccountSystemProgram>\n : TAccountSystemProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type CreateSubaccordInstructionData = {\n discriminator: ReadonlyUint8Array;\n domainRef: ReadonlyUint8Array;\n evidenceSpec: ReadonlyUint8Array;\n minStake: bigint;\n alphaBps: number;\n reviewWindow: bigint;\n commitWindow: bigint;\n revealWindow: bigint;\n appealWindow: bigint;\n maxAppeals: number;\n /**\n * Round-1 juror panel size (accord-9q3e). Default 3; must be odd and the\n * appeal ladder must fit `MAX_JURORS`. Set 1 + `max_appeals = 0` for a\n * single-juror pool. Immutable on the Subaccord (not in `UpdatePayload`).\n */\n minJurySize: number;\n aggregation: Aggregation;\n feePerJuror: bigint;\n /** Reveal-quorum fraction in bps (ADR-0021). Default 6666 (2/3). */\n revealThresholdBps: number;\n /** Shortfall policy (ADR-0021). v1 = `Redraw`. */\n shortfallPolicy: ShortfallPolicy;\n /** Redraw cap per round (ADR-0021). Default 3. */\n maxDrawAttempts: number;\n /**\n * Coherence tolerance for `Median` pools in bps of the final median\n * (ADR-0025). `0` = exact match. Inert for `Plurality`. Immutable on\n * the Subaccord (not in `UpdatePayload`).\n */\n coherenceTolBps: number;\n authority: Address;\n evidenceOperator: Address;\n depth: number;\n /**\n * Attestation credential binding (PROG-ATTESTTION). `Pubkey::default()`\n * ⇒ stake-only (today's behavior). Both-or-neither with `juror_schema`.\n * Immutable once set on the Subaccord; absent from `UpdatePayload`.\n */\n jurorCredential: Address;\n jurorSchema: Address;\n};\n\nexport type CreateSubaccordInstructionDataArgs = {\n domainRef: ReadonlyUint8Array;\n evidenceSpec: ReadonlyUint8Array;\n minStake: number | bigint;\n alphaBps: number;\n reviewWindow: number | bigint;\n commitWindow: number | bigint;\n revealWindow: number | bigint;\n appealWindow: number | bigint;\n maxAppeals: number;\n /**\n * Round-1 juror panel size (accord-9q3e). Default 3; must be odd and the\n * appeal ladder must fit `MAX_JURORS`. Set 1 + `max_appeals = 0` for a\n * single-juror pool. Immutable on the Subaccord (not in `UpdatePayload`).\n */\n minJurySize: number;\n aggregation: AggregationArgs;\n feePerJuror: number | bigint;\n /** Reveal-quorum fraction in bps (ADR-0021). Default 6666 (2/3). */\n revealThresholdBps: number;\n /** Shortfall policy (ADR-0021). v1 = `Redraw`. */\n shortfallPolicy: ShortfallPolicyArgs;\n /** Redraw cap per round (ADR-0021). Default 3. */\n maxDrawAttempts: number;\n /**\n * Coherence tolerance for `Median` pools in bps of the final median\n * (ADR-0025). `0` = exact match. Inert for `Plurality`. Immutable on\n * the Subaccord (not in `UpdatePayload`).\n */\n coherenceTolBps: number;\n authority: Address;\n evidenceOperator: Address;\n depth: number;\n /**\n * Attestation credential binding (PROG-ATTESTTION). `Pubkey::default()`\n * ⇒ stake-only (today's behavior). Both-or-neither with `juror_schema`.\n * Immutable once set on the Subaccord; absent from `UpdatePayload`.\n */\n jurorCredential: Address;\n jurorSchema: Address;\n};\n\nexport function getCreateSubaccordInstructionDataEncoder(): FixedSizeEncoder<CreateSubaccordInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"domainRef\", fixEncoderSize(getBytesEncoder(), 32)],\n [\"evidenceSpec\", fixEncoderSize(getBytesEncoder(), 32)],\n [\"minStake\", getU64Encoder()],\n [\"alphaBps\", getU16Encoder()],\n [\"reviewWindow\", getU64Encoder()],\n [\"commitWindow\", getU64Encoder()],\n [\"revealWindow\", getU64Encoder()],\n [\"appealWindow\", getU64Encoder()],\n [\"maxAppeals\", getU8Encoder()],\n [\"minJurySize\", getU32Encoder()],\n [\"aggregation\", getAggregationEncoder()],\n [\"feePerJuror\", getU64Encoder()],\n [\"revealThresholdBps\", getU16Encoder()],\n [\"shortfallPolicy\", getShortfallPolicyEncoder()],\n [\"maxDrawAttempts\", getU8Encoder()],\n [\"coherenceTolBps\", getU16Encoder()],\n [\"authority\", getAddressEncoder()],\n [\"evidenceOperator\", getAddressEncoder()],\n [\"depth\", getU8Encoder()],\n [\"jurorCredential\", getAddressEncoder()],\n [\"jurorSchema\", getAddressEncoder()],\n ]),\n (value) => ({ ...value, discriminator: CREATE_SUBACCORD_DISCRIMINATOR }),\n );\n}\n\nexport function getCreateSubaccordInstructionDataDecoder(): FixedSizeDecoder<CreateSubaccordInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"domainRef\", fixDecoderSize(getBytesDecoder(), 32)],\n [\"evidenceSpec\", fixDecoderSize(getBytesDecoder(), 32)],\n [\"minStake\", getU64Decoder()],\n [\"alphaBps\", getU16Decoder()],\n [\"reviewWindow\", getU64Decoder()],\n [\"commitWindow\", getU64Decoder()],\n [\"revealWindow\", getU64Decoder()],\n [\"appealWindow\", getU64Decoder()],\n [\"maxAppeals\", getU8Decoder()],\n [\"minJurySize\", getU32Decoder()],\n [\"aggregation\", getAggregationDecoder()],\n [\"feePerJuror\", getU64Decoder()],\n [\"revealThresholdBps\", getU16Decoder()],\n [\"shortfallPolicy\", getShortfallPolicyDecoder()],\n [\"maxDrawAttempts\", getU8Decoder()],\n [\"coherenceTolBps\", getU16Decoder()],\n [\"authority\", getAddressDecoder()],\n [\"evidenceOperator\", getAddressDecoder()],\n [\"depth\", getU8Decoder()],\n [\"jurorCredential\", getAddressDecoder()],\n [\"jurorSchema\", getAddressDecoder()],\n ]);\n}\n\nexport function getCreateSubaccordInstructionDataCodec(): FixedSizeCodec<\n CreateSubaccordInstructionDataArgs,\n CreateSubaccordInstructionData\n> {\n return combineCodec(\n getCreateSubaccordInstructionDataEncoder(),\n getCreateSubaccordInstructionDataDecoder(),\n );\n}\n\nexport type CreateSubaccordAsyncInput<\n TAccountCreator extends string = string,\n TAccountSubaccord extends string = string,\n TAccountStakingToken extends string = string,\n TAccountFeeToken extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n creator: TransactionSigner<TAccountCreator>;\n subaccord?: Address<TAccountSubaccord>;\n /**\n * L-4: validated as a real legacy SPL Mint — `Account<Mint>` from\n * `anchor_spl::token` checks ownership against the Token Program ID,\n * rejecting Token-2022 mints (owned by Token-2022 Program) by construction.\n */\n stakingToken: Address<TAccountStakingToken>;\n feeToken: Address<TAccountFeeToken>;\n systemProgram?: Address<TAccountSystemProgram>;\n domainRef: CreateSubaccordInstructionDataArgs[\"domainRef\"];\n evidenceSpec: CreateSubaccordInstructionDataArgs[\"evidenceSpec\"];\n minStake: CreateSubaccordInstructionDataArgs[\"minStake\"];\n alphaBps: CreateSubaccordInstructionDataArgs[\"alphaBps\"];\n reviewWindow: CreateSubaccordInstructionDataArgs[\"reviewWindow\"];\n commitWindow: CreateSubaccordInstructionDataArgs[\"commitWindow\"];\n revealWindow: CreateSubaccordInstructionDataArgs[\"revealWindow\"];\n appealWindow: CreateSubaccordInstructionDataArgs[\"appealWindow\"];\n maxAppeals: CreateSubaccordInstructionDataArgs[\"maxAppeals\"];\n minJurySize: CreateSubaccordInstructionDataArgs[\"minJurySize\"];\n aggregation: CreateSubaccordInstructionDataArgs[\"aggregation\"];\n feePerJuror: CreateSubaccordInstructionDataArgs[\"feePerJuror\"];\n revealThresholdBps: CreateSubaccordInstructionDataArgs[\"revealThresholdBps\"];\n shortfallPolicy: CreateSubaccordInstructionDataArgs[\"shortfallPolicy\"];\n maxDrawAttempts: CreateSubaccordInstructionDataArgs[\"maxDrawAttempts\"];\n coherenceTolBps: CreateSubaccordInstructionDataArgs[\"coherenceTolBps\"];\n authority: CreateSubaccordInstructionDataArgs[\"authority\"];\n evidenceOperator: CreateSubaccordInstructionDataArgs[\"evidenceOperator\"];\n depth: CreateSubaccordInstructionDataArgs[\"depth\"];\n jurorCredential: CreateSubaccordInstructionDataArgs[\"jurorCredential\"];\n jurorSchema: CreateSubaccordInstructionDataArgs[\"jurorSchema\"];\n};\n\nexport async function getCreateSubaccordInstructionAsync<\n TAccountCreator extends string,\n TAccountSubaccord extends string,\n TAccountStakingToken extends string,\n TAccountFeeToken extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: CreateSubaccordAsyncInput<\n TAccountCreator,\n TAccountSubaccord,\n TAccountStakingToken,\n TAccountFeeToken,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n CreateSubaccordInstruction<\n TProgramAddress,\n TAccountCreator,\n TAccountSubaccord,\n TAccountStakingToken,\n TAccountFeeToken,\n TAccountSystemProgram\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n creator: { value: input.creator ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n stakingToken: { value: input.stakingToken ?? null, isWritable: false },\n feeToken: { value: input.feeToken ?? null, isWritable: false },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.subaccord.value) {\n accounts.subaccord.value = await findSubaccordPda({\n creator: getAddressFromResolvedInstructionAccount(\n \"creator\",\n accounts.creator.value,\n ),\n domainRef: getNonNullResolvedInstructionInput(\n \"domainRef\",\n args.domainRef,\n ),\n });\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n \"11111111111111111111111111111111\" as Address<\"11111111111111111111111111111111\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"creator\", accounts.creator),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"stakingToken\", accounts.stakingToken),\n getAccountMeta(\"feeToken\", accounts.feeToken),\n getAccountMeta(\"systemProgram\", accounts.systemProgram),\n ],\n data: getCreateSubaccordInstructionDataEncoder().encode(\n args as CreateSubaccordInstructionDataArgs,\n ),\n programAddress,\n } as CreateSubaccordInstruction<\n TProgramAddress,\n TAccountCreator,\n TAccountSubaccord,\n TAccountStakingToken,\n TAccountFeeToken,\n TAccountSystemProgram\n >);\n}\n\nexport type CreateSubaccordInput<\n TAccountCreator extends string = string,\n TAccountSubaccord extends string = string,\n TAccountStakingToken extends string = string,\n TAccountFeeToken extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n creator: TransactionSigner<TAccountCreator>;\n subaccord: Address<TAccountSubaccord>;\n /**\n * L-4: validated as a real legacy SPL Mint — `Account<Mint>` from\n * `anchor_spl::token` checks ownership against the Token Program ID,\n * rejecting Token-2022 mints (owned by Token-2022 Program) by construction.\n */\n stakingToken: Address<TAccountStakingToken>;\n feeToken: Address<TAccountFeeToken>;\n systemProgram?: Address<TAccountSystemProgram>;\n domainRef: CreateSubaccordInstructionDataArgs[\"domainRef\"];\n evidenceSpec: CreateSubaccordInstructionDataArgs[\"evidenceSpec\"];\n minStake: CreateSubaccordInstructionDataArgs[\"minStake\"];\n alphaBps: CreateSubaccordInstructionDataArgs[\"alphaBps\"];\n reviewWindow: CreateSubaccordInstructionDataArgs[\"reviewWindow\"];\n commitWindow: CreateSubaccordInstructionDataArgs[\"commitWindow\"];\n revealWindow: CreateSubaccordInstructionDataArgs[\"revealWindow\"];\n appealWindow: CreateSubaccordInstructionDataArgs[\"appealWindow\"];\n maxAppeals: CreateSubaccordInstructionDataArgs[\"maxAppeals\"];\n minJurySize: CreateSubaccordInstructionDataArgs[\"minJurySize\"];\n aggregation: CreateSubaccordInstructionDataArgs[\"aggregation\"];\n feePerJuror: CreateSubaccordInstructionDataArgs[\"feePerJuror\"];\n revealThresholdBps: CreateSubaccordInstructionDataArgs[\"revealThresholdBps\"];\n shortfallPolicy: CreateSubaccordInstructionDataArgs[\"shortfallPolicy\"];\n maxDrawAttempts: CreateSubaccordInstructionDataArgs[\"maxDrawAttempts\"];\n coherenceTolBps: CreateSubaccordInstructionDataArgs[\"coherenceTolBps\"];\n authority: CreateSubaccordInstructionDataArgs[\"authority\"];\n evidenceOperator: CreateSubaccordInstructionDataArgs[\"evidenceOperator\"];\n depth: CreateSubaccordInstructionDataArgs[\"depth\"];\n jurorCredential: CreateSubaccordInstructionDataArgs[\"jurorCredential\"];\n jurorSchema: CreateSubaccordInstructionDataArgs[\"jurorSchema\"];\n};\n\nexport function getCreateSubaccordInstruction<\n TAccountCreator extends string,\n TAccountSubaccord extends string,\n TAccountStakingToken extends string,\n TAccountFeeToken extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: CreateSubaccordInput<\n TAccountCreator,\n TAccountSubaccord,\n TAccountStakingToken,\n TAccountFeeToken,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): CreateSubaccordInstruction<\n TProgramAddress,\n TAccountCreator,\n TAccountSubaccord,\n TAccountStakingToken,\n TAccountFeeToken,\n TAccountSystemProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n creator: { value: input.creator ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n stakingToken: { value: input.stakingToken ?? null, isWritable: false },\n feeToken: { value: input.feeToken ?? null, isWritable: false },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n \"11111111111111111111111111111111\" as Address<\"11111111111111111111111111111111\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"creator\", accounts.creator),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"stakingToken\", accounts.stakingToken),\n getAccountMeta(\"feeToken\", accounts.feeToken),\n getAccountMeta(\"systemProgram\", accounts.systemProgram),\n ],\n data: getCreateSubaccordInstructionDataEncoder().encode(\n args as CreateSubaccordInstructionDataArgs,\n ),\n programAddress,\n } as CreateSubaccordInstruction<\n TProgramAddress,\n TAccountCreator,\n TAccountSubaccord,\n TAccountStakingToken,\n TAccountFeeToken,\n TAccountSystemProgram\n >);\n}\n\nexport type ParsedCreateSubaccordInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n creator: TAccountMetas[0];\n subaccord: TAccountMetas[1];\n /**\n * L-4: validated as a real legacy SPL Mint — `Account<Mint>` from\n * `anchor_spl::token` checks ownership against the Token Program ID,\n * rejecting Token-2022 mints (owned by Token-2022 Program) by construction.\n */\n stakingToken: TAccountMetas[2];\n feeToken: TAccountMetas[3];\n systemProgram: TAccountMetas[4];\n };\n data: CreateSubaccordInstructionData;\n};\n\nexport function parseCreateSubaccordInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedCreateSubaccordInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 5) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 5,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n creator: getNextAccount(),\n subaccord: getNextAccount(),\n stakingToken: getNextAccount(),\n feeToken: getNextAccount(),\n systemProgram: getNextAccount(),\n },\n data: getCreateSubaccordInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getArrayDecoder,\n getArrayEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n getU32Decoder,\n getU32Encoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\nimport {\n getLeafClaimDecoder,\n getLeafClaimEncoder,\n getMSTNodeDecoder,\n getMSTNodeEncoder,\n type LeafClaim,\n type LeafClaimArgs,\n type MSTNode,\n type MSTNodeArgs,\n} from \"../types\";\n\nexport const DRAW_SEAT_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 52, 26, 56, 16, 128, 4, 149, 236,\n]);\n\nexport function getDrawSeatDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(DRAW_SEAT_DISCRIMINATOR);\n}\n\nexport type DrawSeatInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountCaller extends string | AccountMeta<string> = string,\n TAccountDispute extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountRound extends string | AccountMeta<string> = string,\n TAccountSystemProgram extends string | AccountMeta<string> =\n \"11111111111111111111111111111111\",\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountCaller extends string\n ? WritableSignerAccount<TAccountCaller> &\n AccountSignerMeta<TAccountCaller>\n : TAccountCaller,\n TAccountDispute extends string\n ? WritableAccount<TAccountDispute>\n : TAccountDispute,\n TAccountSubaccord extends string\n ? ReadonlyAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountRound extends string\n ? WritableAccount<TAccountRound>\n : TAccountRound,\n TAccountSystemProgram extends string\n ? ReadonlyAccount<TAccountSystemProgram>\n : TAccountSystemProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type DrawSeatInstructionData = {\n discriminator: ReadonlyUint8Array;\n seat: number;\n retries: number;\n leaf: LeafClaim;\n proof: Array<MSTNode>;\n index: number;\n};\n\nexport type DrawSeatInstructionDataArgs = {\n seat: number;\n retries: number;\n leaf: LeafClaimArgs;\n proof: Array<MSTNodeArgs>;\n index: number;\n};\n\nexport function getDrawSeatInstructionDataEncoder(): Encoder<DrawSeatInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"seat\", getU32Encoder()],\n [\"retries\", getU32Encoder()],\n [\"leaf\", getLeafClaimEncoder()],\n [\"proof\", getArrayEncoder(getMSTNodeEncoder())],\n [\"index\", getU32Encoder()],\n ]),\n (value) => ({ ...value, discriminator: DRAW_SEAT_DISCRIMINATOR }),\n );\n}\n\nexport function getDrawSeatInstructionDataDecoder(): Decoder<DrawSeatInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"seat\", getU32Decoder()],\n [\"retries\", getU32Decoder()],\n [\"leaf\", getLeafClaimDecoder()],\n [\"proof\", getArrayDecoder(getMSTNodeDecoder())],\n [\"index\", getU32Decoder()],\n ]);\n}\n\nexport function getDrawSeatInstructionDataCodec(): Codec<\n DrawSeatInstructionDataArgs,\n DrawSeatInstructionData\n> {\n return combineCodec(\n getDrawSeatInstructionDataEncoder(),\n getDrawSeatInstructionDataDecoder(),\n );\n}\n\nexport type DrawSeatInput<\n TAccountCaller extends string = string,\n TAccountDispute extends string = string,\n TAccountSubaccord extends string = string,\n TAccountRound extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n caller: TransactionSigner<TAccountCaller>;\n dispute: Address<TAccountDispute>;\n /**\n * PROG-ATTESTTION: the backing Subaccord. Always passed; the credential\n * re-check activates only when `juror_credential != default`.\n */\n subaccord: Address<TAccountSubaccord>;\n round: Address<TAccountRound>;\n systemProgram?: Address<TAccountSystemProgram>;\n seat: DrawSeatInstructionDataArgs[\"seat\"];\n retries: DrawSeatInstructionDataArgs[\"retries\"];\n leaf: DrawSeatInstructionDataArgs[\"leaf\"];\n proof: DrawSeatInstructionDataArgs[\"proof\"];\n index: DrawSeatInstructionDataArgs[\"index\"];\n};\n\nexport function getDrawSeatInstruction<\n TAccountCaller extends string,\n TAccountDispute extends string,\n TAccountSubaccord extends string,\n TAccountRound extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: DrawSeatInput<\n TAccountCaller,\n TAccountDispute,\n TAccountSubaccord,\n TAccountRound,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): DrawSeatInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountDispute,\n TAccountSubaccord,\n TAccountRound,\n TAccountSystemProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n caller: { value: input.caller ?? null, isWritable: true },\n dispute: { value: input.dispute ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: false },\n round: { value: input.round ?? null, isWritable: true },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n \"11111111111111111111111111111111\" as Address<\"11111111111111111111111111111111\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"caller\", accounts.caller),\n getAccountMeta(\"dispute\", accounts.dispute),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"round\", accounts.round),\n getAccountMeta(\"systemProgram\", accounts.systemProgram),\n ],\n data: getDrawSeatInstructionDataEncoder().encode(\n args as DrawSeatInstructionDataArgs,\n ),\n programAddress,\n } as DrawSeatInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountDispute,\n TAccountSubaccord,\n TAccountRound,\n TAccountSystemProgram\n >);\n}\n\nexport type ParsedDrawSeatInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n caller: TAccountMetas[0];\n dispute: TAccountMetas[1];\n /**\n * PROG-ATTESTTION: the backing Subaccord. Always passed; the credential\n * re-check activates only when `juror_credential != default`.\n */\n subaccord: TAccountMetas[2];\n round: TAccountMetas[3];\n systemProgram: TAccountMetas[4];\n };\n data: DrawSeatInstructionData;\n};\n\nexport function parseDrawSeatInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedDrawSeatInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 5) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 5,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n caller: getNextAccount(),\n dispute: getNextAccount(),\n subaccord: getNextAccount(),\n round: getNextAccount(),\n systemProgram: getNextAccount(),\n },\n data: getDrawSeatInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\n\nexport const EXECUTE_SUBACCORD_UPDATE_DISCRIMINATOR: ReadonlyUint8Array =\n new Uint8Array([145, 99, 105, 27, 63, 159, 254, 203]);\n\nexport function getExecuteSubaccordUpdateDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n EXECUTE_SUBACCORD_UPDATE_DISCRIMINATOR,\n );\n}\n\nexport type ExecuteSubaccordUpdateInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountCaller extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountPendingUpdate extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountCaller extends string\n ? WritableSignerAccount<TAccountCaller> &\n AccountSignerMeta<TAccountCaller>\n : TAccountCaller,\n TAccountSubaccord extends string\n ? WritableAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountPendingUpdate extends string\n ? WritableAccount<TAccountPendingUpdate>\n : TAccountPendingUpdate,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type ExecuteSubaccordUpdateInstructionData = {\n discriminator: ReadonlyUint8Array;\n};\n\nexport type ExecuteSubaccordUpdateInstructionDataArgs = {};\n\nexport function getExecuteSubaccordUpdateInstructionDataEncoder(): FixedSizeEncoder<ExecuteSubaccordUpdateInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([[\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)]]),\n (value) => ({\n ...value,\n discriminator: EXECUTE_SUBACCORD_UPDATE_DISCRIMINATOR,\n }),\n );\n}\n\nexport function getExecuteSubaccordUpdateInstructionDataDecoder(): FixedSizeDecoder<ExecuteSubaccordUpdateInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n ]);\n}\n\nexport function getExecuteSubaccordUpdateInstructionDataCodec(): FixedSizeCodec<\n ExecuteSubaccordUpdateInstructionDataArgs,\n ExecuteSubaccordUpdateInstructionData\n> {\n return combineCodec(\n getExecuteSubaccordUpdateInstructionDataEncoder(),\n getExecuteSubaccordUpdateInstructionDataDecoder(),\n );\n}\n\nexport type ExecuteSubaccordUpdateInput<\n TAccountCaller extends string = string,\n TAccountSubaccord extends string = string,\n TAccountPendingUpdate extends string = string,\n> = {\n caller: TransactionSigner<TAccountCaller>;\n subaccord: Address<TAccountSubaccord>;\n pendingUpdate: Address<TAccountPendingUpdate>;\n};\n\nexport function getExecuteSubaccordUpdateInstruction<\n TAccountCaller extends string,\n TAccountSubaccord extends string,\n TAccountPendingUpdate extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: ExecuteSubaccordUpdateInput<\n TAccountCaller,\n TAccountSubaccord,\n TAccountPendingUpdate\n >,\n config?: { programAddress?: TProgramAddress },\n): ExecuteSubaccordUpdateInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountPendingUpdate\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n caller: { value: input.caller ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n pendingUpdate: { value: input.pendingUpdate ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"caller\", accounts.caller),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"pendingUpdate\", accounts.pendingUpdate),\n ],\n data: getExecuteSubaccordUpdateInstructionDataEncoder().encode({}),\n programAddress,\n } as ExecuteSubaccordUpdateInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountPendingUpdate\n >);\n}\n\nexport type ParsedExecuteSubaccordUpdateInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n caller: TAccountMetas[0];\n subaccord: TAccountMetas[1];\n pendingUpdate: TAccountMetas[2];\n };\n data: ExecuteSubaccordUpdateInstructionData;\n};\n\nexport function parseExecuteSubaccordUpdateInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedExecuteSubaccordUpdateInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 3) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 3,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n caller: getNextAccount(),\n subaccord: getNextAccount(),\n pendingUpdate: getNextAccount(),\n },\n data: getExecuteSubaccordUpdateInstructionDataDecoder().decode(\n instruction.data,\n ),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { findAccordStatePda } from \"../pdas\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\n\nexport const EXECUTE_UNPAUSE_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array(\n [55, 43, 56, 5, 154, 156, 52, 232],\n);\n\nexport function getExecuteUnpauseDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n EXECUTE_UNPAUSE_DISCRIMINATOR,\n );\n}\n\nexport type ExecuteUnpauseInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountCaller extends string | AccountMeta<string> = string,\n TAccountAccordState extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountCaller extends string\n ? WritableSignerAccount<TAccountCaller> &\n AccountSignerMeta<TAccountCaller>\n : TAccountCaller,\n TAccountAccordState extends string\n ? WritableAccount<TAccountAccordState>\n : TAccountAccordState,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type ExecuteUnpauseInstructionData = {\n discriminator: ReadonlyUint8Array;\n};\n\nexport type ExecuteUnpauseInstructionDataArgs = {};\n\nexport function getExecuteUnpauseInstructionDataEncoder(): FixedSizeEncoder<ExecuteUnpauseInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([[\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)]]),\n (value) => ({ ...value, discriminator: EXECUTE_UNPAUSE_DISCRIMINATOR }),\n );\n}\n\nexport function getExecuteUnpauseInstructionDataDecoder(): FixedSizeDecoder<ExecuteUnpauseInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n ]);\n}\n\nexport function getExecuteUnpauseInstructionDataCodec(): FixedSizeCodec<\n ExecuteUnpauseInstructionDataArgs,\n ExecuteUnpauseInstructionData\n> {\n return combineCodec(\n getExecuteUnpauseInstructionDataEncoder(),\n getExecuteUnpauseInstructionDataDecoder(),\n );\n}\n\nexport type ExecuteUnpauseAsyncInput<\n TAccountCaller extends string = string,\n TAccountAccordState extends string = string,\n> = {\n /**\n * Any cranker pays the tx fee; no authority check on execute (ADR-0007:\n * the notice period, not the signer, gates the unpause).\n */\n caller: TransactionSigner<TAccountCaller>;\n accordState?: Address<TAccountAccordState>;\n};\n\nexport async function getExecuteUnpauseInstructionAsync<\n TAccountCaller extends string,\n TAccountAccordState extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: ExecuteUnpauseAsyncInput<TAccountCaller, TAccountAccordState>,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n ExecuteUnpauseInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountAccordState\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n caller: { value: input.caller ?? null, isWritable: true },\n accordState: { value: input.accordState ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Resolve default values.\n if (!accounts.accordState.value) {\n accounts.accordState.value = await findAccordStatePda();\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"caller\", accounts.caller),\n getAccountMeta(\"accordState\", accounts.accordState),\n ],\n data: getExecuteUnpauseInstructionDataEncoder().encode({}),\n programAddress,\n } as ExecuteUnpauseInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountAccordState\n >);\n}\n\nexport type ExecuteUnpauseInput<\n TAccountCaller extends string = string,\n TAccountAccordState extends string = string,\n> = {\n /**\n * Any cranker pays the tx fee; no authority check on execute (ADR-0007:\n * the notice period, not the signer, gates the unpause).\n */\n caller: TransactionSigner<TAccountCaller>;\n accordState: Address<TAccountAccordState>;\n};\n\nexport function getExecuteUnpauseInstruction<\n TAccountCaller extends string,\n TAccountAccordState extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: ExecuteUnpauseInput<TAccountCaller, TAccountAccordState>,\n config?: { programAddress?: TProgramAddress },\n): ExecuteUnpauseInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountAccordState\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n caller: { value: input.caller ?? null, isWritable: true },\n accordState: { value: input.accordState ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"caller\", accounts.caller),\n getAccountMeta(\"accordState\", accounts.accordState),\n ],\n data: getExecuteUnpauseInstructionDataEncoder().encode({}),\n programAddress,\n } as ExecuteUnpauseInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountAccordState\n >);\n}\n\nexport type ParsedExecuteUnpauseInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /**\n * Any cranker pays the tx fee; no authority check on execute (ADR-0007:\n * the notice period, not the signer, gates the unpause).\n */\n caller: TAccountMetas[0];\n accordState: TAccountMetas[1];\n };\n data: ExecuteUnpauseInstructionData;\n};\n\nexport function parseExecuteUnpauseInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedExecuteUnpauseInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 2) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 2,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: { caller: getNextAccount(), accordState: getNextAccount() },\n data: getExecuteUnpauseInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\n\nexport const FINALIZE_DISPUTE_DISCRIMINATOR: ReadonlyUint8Array =\n new Uint8Array([190, 211, 17, 122, 247, 157, 27, 223]);\n\nexport function getFinalizeDisputeDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n FINALIZE_DISPUTE_DISCRIMINATOR,\n );\n}\n\nexport type FinalizeDisputeInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountCaller extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountDispute extends string | AccountMeta<string> = string,\n TAccountRound extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountCaller extends string\n ? WritableSignerAccount<TAccountCaller> &\n AccountSignerMeta<TAccountCaller>\n : TAccountCaller,\n TAccountSubaccord extends string\n ? ReadonlyAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountDispute extends string\n ? WritableAccount<TAccountDispute>\n : TAccountDispute,\n TAccountRound extends string\n ? WritableAccount<TAccountRound>\n : TAccountRound,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type FinalizeDisputeInstructionData = {\n discriminator: ReadonlyUint8Array;\n};\n\nexport type FinalizeDisputeInstructionDataArgs = {};\n\nexport function getFinalizeDisputeInstructionDataEncoder(): FixedSizeEncoder<FinalizeDisputeInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([[\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)]]),\n (value) => ({ ...value, discriminator: FINALIZE_DISPUTE_DISCRIMINATOR }),\n );\n}\n\nexport function getFinalizeDisputeInstructionDataDecoder(): FixedSizeDecoder<FinalizeDisputeInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n ]);\n}\n\nexport function getFinalizeDisputeInstructionDataCodec(): FixedSizeCodec<\n FinalizeDisputeInstructionDataArgs,\n FinalizeDisputeInstructionData\n> {\n return combineCodec(\n getFinalizeDisputeInstructionDataEncoder(),\n getFinalizeDisputeInstructionDataDecoder(),\n );\n}\n\nexport type FinalizeDisputeInput<\n TAccountCaller extends string = string,\n TAccountSubaccord extends string = string,\n TAccountDispute extends string = string,\n TAccountRound extends string = string,\n> = {\n caller: TransactionSigner<TAccountCaller>;\n subaccord: Address<TAccountSubaccord>;\n dispute: Address<TAccountDispute>;\n round: Address<TAccountRound>;\n};\n\nexport function getFinalizeDisputeInstruction<\n TAccountCaller extends string,\n TAccountSubaccord extends string,\n TAccountDispute extends string,\n TAccountRound extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: FinalizeDisputeInput<\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound\n >,\n config?: { programAddress?: TProgramAddress },\n): FinalizeDisputeInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n caller: { value: input.caller ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: false },\n dispute: { value: input.dispute ?? null, isWritable: true },\n round: { value: input.round ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"caller\", accounts.caller),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"dispute\", accounts.dispute),\n getAccountMeta(\"round\", accounts.round),\n ],\n data: getFinalizeDisputeInstructionDataEncoder().encode({}),\n programAddress,\n } as FinalizeDisputeInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound\n >);\n}\n\nexport type ParsedFinalizeDisputeInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n caller: TAccountMetas[0];\n subaccord: TAccountMetas[1];\n dispute: TAccountMetas[2];\n round: TAccountMetas[3];\n };\n data: FinalizeDisputeInstructionData;\n};\n\nexport function parseFinalizeDisputeInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedFinalizeDisputeInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 4) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 4,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n caller: getNextAccount(),\n subaccord: getNextAccount(),\n dispute: getNextAccount(),\n round: getNextAccount(),\n },\n data: getFinalizeDisputeInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\n\nexport const FINALIZE_ROUND_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 239, 160, 254, 11, 254, 144, 53, 148,\n]);\n\nexport function getFinalizeRoundDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n FINALIZE_ROUND_DISCRIMINATOR,\n );\n}\n\nexport type FinalizeRoundInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountCaller extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountDispute extends string | AccountMeta<string> = string,\n TAccountRound extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountCaller extends string\n ? WritableSignerAccount<TAccountCaller> &\n AccountSignerMeta<TAccountCaller>\n : TAccountCaller,\n TAccountSubaccord extends string\n ? ReadonlyAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountDispute extends string\n ? WritableAccount<TAccountDispute>\n : TAccountDispute,\n TAccountRound extends string\n ? WritableAccount<TAccountRound>\n : TAccountRound,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type FinalizeRoundInstructionData = {\n discriminator: ReadonlyUint8Array;\n};\n\nexport type FinalizeRoundInstructionDataArgs = {};\n\nexport function getFinalizeRoundInstructionDataEncoder(): FixedSizeEncoder<FinalizeRoundInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([[\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)]]),\n (value) => ({ ...value, discriminator: FINALIZE_ROUND_DISCRIMINATOR }),\n );\n}\n\nexport function getFinalizeRoundInstructionDataDecoder(): FixedSizeDecoder<FinalizeRoundInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n ]);\n}\n\nexport function getFinalizeRoundInstructionDataCodec(): FixedSizeCodec<\n FinalizeRoundInstructionDataArgs,\n FinalizeRoundInstructionData\n> {\n return combineCodec(\n getFinalizeRoundInstructionDataEncoder(),\n getFinalizeRoundInstructionDataDecoder(),\n );\n}\n\nexport type FinalizeRoundInput<\n TAccountCaller extends string = string,\n TAccountSubaccord extends string = string,\n TAccountDispute extends string = string,\n TAccountRound extends string = string,\n> = {\n caller: TransactionSigner<TAccountCaller>;\n subaccord: Address<TAccountSubaccord>;\n dispute: Address<TAccountDispute>;\n round: Address<TAccountRound>;\n};\n\nexport function getFinalizeRoundInstruction<\n TAccountCaller extends string,\n TAccountSubaccord extends string,\n TAccountDispute extends string,\n TAccountRound extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: FinalizeRoundInput<\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound\n >,\n config?: { programAddress?: TProgramAddress },\n): FinalizeRoundInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n caller: { value: input.caller ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: false },\n dispute: { value: input.dispute ?? null, isWritable: true },\n round: { value: input.round ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"caller\", accounts.caller),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"dispute\", accounts.dispute),\n getAccountMeta(\"round\", accounts.round),\n ],\n data: getFinalizeRoundInstructionDataEncoder().encode({}),\n programAddress,\n } as FinalizeRoundInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound\n >);\n}\n\nexport type ParsedFinalizeRoundInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n caller: TAccountMetas[0];\n subaccord: TAccountMetas[1];\n dispute: TAccountMetas[2];\n round: TAccountMetas[3];\n };\n data: FinalizeRoundInstructionData;\n};\n\nexport function parseFinalizeRoundInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedFinalizeRoundInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 4) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 4,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n caller: getNextAccount(),\n subaccord: getNextAccount(),\n dispute: getNextAccount(),\n round: getNextAccount(),\n },\n data: getFinalizeRoundInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\n\nexport const GET_RULING_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 196, 52, 54, 1, 180, 75, 86, 16,\n]);\n\nexport function getGetRulingDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(GET_RULING_DISCRIMINATOR);\n}\n\nexport type GetRulingInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountCaller extends string | AccountMeta<string> = string,\n TAccountDispute extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountCaller extends string\n ? WritableSignerAccount<TAccountCaller> &\n AccountSignerMeta<TAccountCaller>\n : TAccountCaller,\n TAccountDispute extends string\n ? ReadonlyAccount<TAccountDispute>\n : TAccountDispute,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type GetRulingInstructionData = { discriminator: ReadonlyUint8Array };\n\nexport type GetRulingInstructionDataArgs = {};\n\nexport function getGetRulingInstructionDataEncoder(): FixedSizeEncoder<GetRulingInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([[\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)]]),\n (value) => ({ ...value, discriminator: GET_RULING_DISCRIMINATOR }),\n );\n}\n\nexport function getGetRulingInstructionDataDecoder(): FixedSizeDecoder<GetRulingInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n ]);\n}\n\nexport function getGetRulingInstructionDataCodec(): FixedSizeCodec<\n GetRulingInstructionDataArgs,\n GetRulingInstructionData\n> {\n return combineCodec(\n getGetRulingInstructionDataEncoder(),\n getGetRulingInstructionDataDecoder(),\n );\n}\n\nexport type GetRulingInput<\n TAccountCaller extends string = string,\n TAccountDispute extends string = string,\n> = {\n /** Fee payer for the transaction (CPI caller or cranker). */\n caller: TransactionSigner<TAccountCaller>;\n dispute: Address<TAccountDispute>;\n};\n\nexport function getGetRulingInstruction<\n TAccountCaller extends string,\n TAccountDispute extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: GetRulingInput<TAccountCaller, TAccountDispute>,\n config?: { programAddress?: TProgramAddress },\n): GetRulingInstruction<TProgramAddress, TAccountCaller, TAccountDispute> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n caller: { value: input.caller ?? null, isWritable: true },\n dispute: { value: input.dispute ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"caller\", accounts.caller),\n getAccountMeta(\"dispute\", accounts.dispute),\n ],\n data: getGetRulingInstructionDataEncoder().encode({}),\n programAddress,\n } as GetRulingInstruction<TProgramAddress, TAccountCaller, TAccountDispute>);\n}\n\nexport type ParsedGetRulingInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** Fee payer for the transaction (CPI caller or cranker). */\n caller: TAccountMetas[0];\n dispute: TAccountMetas[1];\n };\n data: GetRulingInstructionData;\n};\n\nexport function parseGetRulingInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedGetRulingInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 2) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 2,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: { caller: getNextAccount(), dispute: getNextAccount() },\n data: getGetRulingInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlySignerAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\n\nexport const HEALTH_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 235, 42, 47, 99, 10, 7, 249, 16,\n]);\n\nexport function getHealthDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(HEALTH_DISCRIMINATOR);\n}\n\nexport type HealthInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountCaller extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountCaller extends string\n ? ReadonlySignerAccount<TAccountCaller> &\n AccountSignerMeta<TAccountCaller>\n : TAccountCaller,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type HealthInstructionData = { discriminator: ReadonlyUint8Array };\n\nexport type HealthInstructionDataArgs = {};\n\nexport function getHealthInstructionDataEncoder(): FixedSizeEncoder<HealthInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([[\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)]]),\n (value) => ({ ...value, discriminator: HEALTH_DISCRIMINATOR }),\n );\n}\n\nexport function getHealthInstructionDataDecoder(): FixedSizeDecoder<HealthInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n ]);\n}\n\nexport function getHealthInstructionDataCodec(): FixedSizeCodec<\n HealthInstructionDataArgs,\n HealthInstructionData\n> {\n return combineCodec(\n getHealthInstructionDataEncoder(),\n getHealthInstructionDataDecoder(),\n );\n}\n\nexport type HealthInput<TAccountCaller extends string = string> = {\n caller: TransactionSigner<TAccountCaller>;\n};\n\nexport function getHealthInstruction<\n TAccountCaller extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: HealthInput<TAccountCaller>,\n config?: { programAddress?: TProgramAddress },\n): HealthInstruction<TProgramAddress, TAccountCaller> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n caller: { value: input.caller ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [getAccountMeta(\"caller\", accounts.caller)],\n data: getHealthInstructionDataEncoder().encode({}),\n programAddress,\n } as HealthInstruction<TProgramAddress, TAccountCaller>);\n}\n\nexport type ParsedHealthInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n caller: TAccountMetas[0];\n };\n data: HealthInstructionData;\n};\n\nexport function parseHealthInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedHealthInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 1) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 1,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: { caller: getNextAccount() },\n data: getHealthInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { findAccordStatePda } from \"../pdas\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\n\nexport const INITIALIZE_PAUSE_DISCRIMINATOR: ReadonlyUint8Array =\n new Uint8Array([70, 32, 55, 248, 231, 46, 123, 153]);\n\nexport function getInitializePauseDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n INITIALIZE_PAUSE_DISCRIMINATOR,\n );\n}\n\nexport type InitializePauseInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountAuthority extends string | AccountMeta<string> = string,\n TAccountAccordState extends string | AccountMeta<string> = string,\n TAccountSystemProgram extends string | AccountMeta<string> =\n \"11111111111111111111111111111111\",\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountAuthority extends string\n ? WritableSignerAccount<TAccountAuthority> &\n AccountSignerMeta<TAccountAuthority>\n : TAccountAuthority,\n TAccountAccordState extends string\n ? WritableAccount<TAccountAccordState>\n : TAccountAccordState,\n TAccountSystemProgram extends string\n ? ReadonlyAccount<TAccountSystemProgram>\n : TAccountSystemProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type InitializePauseInstructionData = {\n discriminator: ReadonlyUint8Array;\n};\n\nexport type InitializePauseInstructionDataArgs = {};\n\nexport function getInitializePauseInstructionDataEncoder(): FixedSizeEncoder<InitializePauseInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([[\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)]]),\n (value) => ({ ...value, discriminator: INITIALIZE_PAUSE_DISCRIMINATOR }),\n );\n}\n\nexport function getInitializePauseInstructionDataDecoder(): FixedSizeDecoder<InitializePauseInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n ]);\n}\n\nexport function getInitializePauseInstructionDataCodec(): FixedSizeCodec<\n InitializePauseInstructionDataArgs,\n InitializePauseInstructionData\n> {\n return combineCodec(\n getInitializePauseInstructionDataEncoder(),\n getInitializePauseInstructionDataDecoder(),\n );\n}\n\nexport type InitializePauseAsyncInput<\n TAccountAuthority extends string = string,\n TAccountAccordState extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n authority: TransactionSigner<TAccountAuthority>;\n accordState?: Address<TAccountAccordState>;\n systemProgram?: Address<TAccountSystemProgram>;\n};\n\nexport async function getInitializePauseInstructionAsync<\n TAccountAuthority extends string,\n TAccountAccordState extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: InitializePauseAsyncInput<\n TAccountAuthority,\n TAccountAccordState,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n InitializePauseInstruction<\n TProgramAddress,\n TAccountAuthority,\n TAccountAccordState,\n TAccountSystemProgram\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n authority: { value: input.authority ?? null, isWritable: true },\n accordState: { value: input.accordState ?? null, isWritable: true },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Resolve default values.\n if (!accounts.accordState.value) {\n accounts.accordState.value = await findAccordStatePda();\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n \"11111111111111111111111111111111\" as Address<\"11111111111111111111111111111111\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"authority\", accounts.authority),\n getAccountMeta(\"accordState\", accounts.accordState),\n getAccountMeta(\"systemProgram\", accounts.systemProgram),\n ],\n data: getInitializePauseInstructionDataEncoder().encode({}),\n programAddress,\n } as InitializePauseInstruction<\n TProgramAddress,\n TAccountAuthority,\n TAccountAccordState,\n TAccountSystemProgram\n >);\n}\n\nexport type InitializePauseInput<\n TAccountAuthority extends string = string,\n TAccountAccordState extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n authority: TransactionSigner<TAccountAuthority>;\n accordState: Address<TAccountAccordState>;\n systemProgram?: Address<TAccountSystemProgram>;\n};\n\nexport function getInitializePauseInstruction<\n TAccountAuthority extends string,\n TAccountAccordState extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: InitializePauseInput<\n TAccountAuthority,\n TAccountAccordState,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): InitializePauseInstruction<\n TProgramAddress,\n TAccountAuthority,\n TAccountAccordState,\n TAccountSystemProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n authority: { value: input.authority ?? null, isWritable: true },\n accordState: { value: input.accordState ?? null, isWritable: true },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Resolve default values.\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n \"11111111111111111111111111111111\" as Address<\"11111111111111111111111111111111\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"authority\", accounts.authority),\n getAccountMeta(\"accordState\", accounts.accordState),\n getAccountMeta(\"systemProgram\", accounts.systemProgram),\n ],\n data: getInitializePauseInstructionDataEncoder().encode({}),\n programAddress,\n } as InitializePauseInstruction<\n TProgramAddress,\n TAccountAuthority,\n TAccountAccordState,\n TAccountSystemProgram\n >);\n}\n\nexport type ParsedInitializePauseInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n authority: TAccountMetas[0];\n accordState: TAccountMetas[1];\n systemProgram: TAccountMetas[2];\n };\n data: InitializePauseInstructionData;\n};\n\nexport function parseInitializePauseInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedInitializePauseInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 3) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 3,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n authority: getNextAccount(),\n accordState: getNextAccount(),\n systemProgram: getNextAccount(),\n },\n data: getInitializePauseInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { findAccordStatePda } from \"../pdas\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\n\nexport const PAUSE_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 211, 22, 221, 251, 74, 121, 193, 47,\n]);\n\nexport function getPauseDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(PAUSE_DISCRIMINATOR);\n}\n\nexport type PauseInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountAuthority extends string | AccountMeta<string> = string,\n TAccountAccordState extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountAuthority extends string\n ? WritableSignerAccount<TAccountAuthority> &\n AccountSignerMeta<TAccountAuthority>\n : TAccountAuthority,\n TAccountAccordState extends string\n ? WritableAccount<TAccountAccordState>\n : TAccountAccordState,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type PauseInstructionData = { discriminator: ReadonlyUint8Array };\n\nexport type PauseInstructionDataArgs = {};\n\nexport function getPauseInstructionDataEncoder(): FixedSizeEncoder<PauseInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([[\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)]]),\n (value) => ({ ...value, discriminator: PAUSE_DISCRIMINATOR }),\n );\n}\n\nexport function getPauseInstructionDataDecoder(): FixedSizeDecoder<PauseInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n ]);\n}\n\nexport function getPauseInstructionDataCodec(): FixedSizeCodec<\n PauseInstructionDataArgs,\n PauseInstructionData\n> {\n return combineCodec(\n getPauseInstructionDataEncoder(),\n getPauseInstructionDataDecoder(),\n );\n}\n\nexport type PauseAsyncInput<\n TAccountAuthority extends string = string,\n TAccountAccordState extends string = string,\n> = {\n authority: TransactionSigner<TAccountAuthority>;\n accordState?: Address<TAccountAccordState>;\n};\n\nexport async function getPauseInstructionAsync<\n TAccountAuthority extends string,\n TAccountAccordState extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: PauseAsyncInput<TAccountAuthority, TAccountAccordState>,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n PauseInstruction<TProgramAddress, TAccountAuthority, TAccountAccordState>\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n authority: { value: input.authority ?? null, isWritable: true },\n accordState: { value: input.accordState ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Resolve default values.\n if (!accounts.accordState.value) {\n accounts.accordState.value = await findAccordStatePda();\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"authority\", accounts.authority),\n getAccountMeta(\"accordState\", accounts.accordState),\n ],\n data: getPauseInstructionDataEncoder().encode({}),\n programAddress,\n } as PauseInstruction<\n TProgramAddress,\n TAccountAuthority,\n TAccountAccordState\n >);\n}\n\nexport type PauseInput<\n TAccountAuthority extends string = string,\n TAccountAccordState extends string = string,\n> = {\n authority: TransactionSigner<TAccountAuthority>;\n accordState: Address<TAccountAccordState>;\n};\n\nexport function getPauseInstruction<\n TAccountAuthority extends string,\n TAccountAccordState extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: PauseInput<TAccountAuthority, TAccountAccordState>,\n config?: { programAddress?: TProgramAddress },\n): PauseInstruction<TProgramAddress, TAccountAuthority, TAccountAccordState> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n authority: { value: input.authority ?? null, isWritable: true },\n accordState: { value: input.accordState ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"authority\", accounts.authority),\n getAccountMeta(\"accordState\", accounts.accordState),\n ],\n data: getPauseInstructionDataEncoder().encode({}),\n programAddress,\n } as PauseInstruction<\n TProgramAddress,\n TAccountAuthority,\n TAccountAccordState\n >);\n}\n\nexport type ParsedPauseInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n authority: TAccountMetas[0];\n accordState: TAccountMetas[1];\n };\n data: PauseInstructionData;\n};\n\nexport function parsePauseInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedPauseInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 2) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 2,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: { authority: getNextAccount(), accordState: getNextAccount() },\n data: getPauseInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlySignerAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n getAddressFromResolvedInstructionAccount,\n getNonNullResolvedInstructionInput,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { findPendingUpdatePda } from \"../pdas\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\nimport {\n getUpdatePayloadDecoder,\n getUpdatePayloadEncoder,\n type UpdatePayload,\n type UpdatePayloadArgs,\n} from \"../types\";\n\nexport const PROPOSE_SUBACCORD_UPDATE_DISCRIMINATOR: ReadonlyUint8Array =\n new Uint8Array([8, 224, 186, 131, 130, 76, 165, 172]);\n\nexport function getProposeSubaccordUpdateDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n PROPOSE_SUBACCORD_UPDATE_DISCRIMINATOR,\n );\n}\n\nexport type ProposeSubaccordUpdateInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountAuthority extends string | AccountMeta<string> = string,\n TAccountRentPayer extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountPendingUpdate extends string | AccountMeta<string> = string,\n TAccountSystemProgram extends string | AccountMeta<string> =\n \"11111111111111111111111111111111\",\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountAuthority extends string\n ? ReadonlySignerAccount<TAccountAuthority> &\n AccountSignerMeta<TAccountAuthority>\n : TAccountAuthority,\n TAccountRentPayer extends string\n ? WritableSignerAccount<TAccountRentPayer> &\n AccountSignerMeta<TAccountRentPayer>\n : TAccountRentPayer,\n TAccountSubaccord extends string\n ? ReadonlyAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountPendingUpdate extends string\n ? WritableAccount<TAccountPendingUpdate>\n : TAccountPendingUpdate,\n TAccountSystemProgram extends string\n ? ReadonlyAccount<TAccountSystemProgram>\n : TAccountSystemProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type ProposeSubaccordUpdateInstructionData = {\n discriminator: ReadonlyUint8Array;\n nonce: bigint;\n payload: UpdatePayload;\n};\n\nexport type ProposeSubaccordUpdateInstructionDataArgs = {\n nonce: number | bigint;\n payload: UpdatePayloadArgs;\n};\n\nexport function getProposeSubaccordUpdateInstructionDataEncoder(): Encoder<ProposeSubaccordUpdateInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"nonce\", getU64Encoder()],\n [\"payload\", getUpdatePayloadEncoder()],\n ]),\n (value) => ({\n ...value,\n discriminator: PROPOSE_SUBACCORD_UPDATE_DISCRIMINATOR,\n }),\n );\n}\n\nexport function getProposeSubaccordUpdateInstructionDataDecoder(): Decoder<ProposeSubaccordUpdateInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"nonce\", getU64Decoder()],\n [\"payload\", getUpdatePayloadDecoder()],\n ]);\n}\n\nexport function getProposeSubaccordUpdateInstructionDataCodec(): Codec<\n ProposeSubaccordUpdateInstructionDataArgs,\n ProposeSubaccordUpdateInstructionData\n> {\n return combineCodec(\n getProposeSubaccordUpdateInstructionDataEncoder(),\n getProposeSubaccordUpdateInstructionDataDecoder(),\n );\n}\n\nexport type ProposeSubaccordUpdateAsyncInput<\n TAccountAuthority extends string = string,\n TAccountRentPayer extends string = string,\n TAccountSubaccord extends string = string,\n TAccountPendingUpdate extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n /** Must equal `subaccord.authority`; signs the proposal. */\n authority: TransactionSigner<TAccountAuthority>;\n /**\n * Rent payer for the PendingUpdate `init`. MUST be data-free (the system\n * program rejects lamport transfers from data-carrying accounts), so\n * Arbitrables whose authority is a data-carrying PDA (e.g. Canon's list\n * PDA) pass their crank caller here; wallet authorities pass themselves.\n */\n rentPayer: TransactionSigner<TAccountRentPayer>;\n subaccord: Address<TAccountSubaccord>;\n pendingUpdate?: Address<TAccountPendingUpdate>;\n systemProgram?: Address<TAccountSystemProgram>;\n nonce: ProposeSubaccordUpdateInstructionDataArgs[\"nonce\"];\n payload: ProposeSubaccordUpdateInstructionDataArgs[\"payload\"];\n};\n\nexport async function getProposeSubaccordUpdateInstructionAsync<\n TAccountAuthority extends string,\n TAccountRentPayer extends string,\n TAccountSubaccord extends string,\n TAccountPendingUpdate extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: ProposeSubaccordUpdateAsyncInput<\n TAccountAuthority,\n TAccountRentPayer,\n TAccountSubaccord,\n TAccountPendingUpdate,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n ProposeSubaccordUpdateInstruction<\n TProgramAddress,\n TAccountAuthority,\n TAccountRentPayer,\n TAccountSubaccord,\n TAccountPendingUpdate,\n TAccountSystemProgram\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n authority: { value: input.authority ?? null, isWritable: false },\n rentPayer: { value: input.rentPayer ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: false },\n pendingUpdate: { value: input.pendingUpdate ?? null, isWritable: true },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.pendingUpdate.value) {\n accounts.pendingUpdate.value = await findPendingUpdatePda({\n subaccord: getAddressFromResolvedInstructionAccount(\n \"subaccord\",\n accounts.subaccord.value,\n ),\n nonce: getNonNullResolvedInstructionInput(\"nonce\", args.nonce),\n });\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n \"11111111111111111111111111111111\" as Address<\"11111111111111111111111111111111\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"authority\", accounts.authority),\n getAccountMeta(\"rentPayer\", accounts.rentPayer),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"pendingUpdate\", accounts.pendingUpdate),\n getAccountMeta(\"systemProgram\", accounts.systemProgram),\n ],\n data: getProposeSubaccordUpdateInstructionDataEncoder().encode(\n args as ProposeSubaccordUpdateInstructionDataArgs,\n ),\n programAddress,\n } as ProposeSubaccordUpdateInstruction<\n TProgramAddress,\n TAccountAuthority,\n TAccountRentPayer,\n TAccountSubaccord,\n TAccountPendingUpdate,\n TAccountSystemProgram\n >);\n}\n\nexport type ProposeSubaccordUpdateInput<\n TAccountAuthority extends string = string,\n TAccountRentPayer extends string = string,\n TAccountSubaccord extends string = string,\n TAccountPendingUpdate extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n /** Must equal `subaccord.authority`; signs the proposal. */\n authority: TransactionSigner<TAccountAuthority>;\n /**\n * Rent payer for the PendingUpdate `init`. MUST be data-free (the system\n * program rejects lamport transfers from data-carrying accounts), so\n * Arbitrables whose authority is a data-carrying PDA (e.g. Canon's list\n * PDA) pass their crank caller here; wallet authorities pass themselves.\n */\n rentPayer: TransactionSigner<TAccountRentPayer>;\n subaccord: Address<TAccountSubaccord>;\n pendingUpdate: Address<TAccountPendingUpdate>;\n systemProgram?: Address<TAccountSystemProgram>;\n nonce: ProposeSubaccordUpdateInstructionDataArgs[\"nonce\"];\n payload: ProposeSubaccordUpdateInstructionDataArgs[\"payload\"];\n};\n\nexport function getProposeSubaccordUpdateInstruction<\n TAccountAuthority extends string,\n TAccountRentPayer extends string,\n TAccountSubaccord extends string,\n TAccountPendingUpdate extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: ProposeSubaccordUpdateInput<\n TAccountAuthority,\n TAccountRentPayer,\n TAccountSubaccord,\n TAccountPendingUpdate,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): ProposeSubaccordUpdateInstruction<\n TProgramAddress,\n TAccountAuthority,\n TAccountRentPayer,\n TAccountSubaccord,\n TAccountPendingUpdate,\n TAccountSystemProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n authority: { value: input.authority ?? null, isWritable: false },\n rentPayer: { value: input.rentPayer ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: false },\n pendingUpdate: { value: input.pendingUpdate ?? null, isWritable: true },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n \"11111111111111111111111111111111\" as Address<\"11111111111111111111111111111111\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"authority\", accounts.authority),\n getAccountMeta(\"rentPayer\", accounts.rentPayer),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"pendingUpdate\", accounts.pendingUpdate),\n getAccountMeta(\"systemProgram\", accounts.systemProgram),\n ],\n data: getProposeSubaccordUpdateInstructionDataEncoder().encode(\n args as ProposeSubaccordUpdateInstructionDataArgs,\n ),\n programAddress,\n } as ProposeSubaccordUpdateInstruction<\n TProgramAddress,\n TAccountAuthority,\n TAccountRentPayer,\n TAccountSubaccord,\n TAccountPendingUpdate,\n TAccountSystemProgram\n >);\n}\n\nexport type ParsedProposeSubaccordUpdateInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n /** Must equal `subaccord.authority`; signs the proposal. */\n authority: TAccountMetas[0];\n /**\n * Rent payer for the PendingUpdate `init`. MUST be data-free (the system\n * program rejects lamport transfers from data-carrying accounts), so\n * Arbitrables whose authority is a data-carrying PDA (e.g. Canon's list\n * PDA) pass their crank caller here; wallet authorities pass themselves.\n */\n rentPayer: TAccountMetas[1];\n subaccord: TAccountMetas[2];\n pendingUpdate: TAccountMetas[3];\n systemProgram: TAccountMetas[4];\n };\n data: ProposeSubaccordUpdateInstructionData;\n};\n\nexport function parseProposeSubaccordUpdateInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedProposeSubaccordUpdateInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 5) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 5,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n authority: getNextAccount(),\n rentPayer: getNextAccount(),\n subaccord: getNextAccount(),\n pendingUpdate: getNextAccount(),\n systemProgram: getNextAccount(),\n },\n data: getProposeSubaccordUpdateInstructionDataDecoder().decode(\n instruction.data,\n ),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { findAccordStatePda } from \"../pdas\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\n\nexport const PROPOSE_UNPAUSE_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array(\n [45, 136, 163, 143, 156, 57, 113, 132],\n);\n\nexport function getProposeUnpauseDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n PROPOSE_UNPAUSE_DISCRIMINATOR,\n );\n}\n\nexport type ProposeUnpauseInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountAuthority extends string | AccountMeta<string> = string,\n TAccountAccordState extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountAuthority extends string\n ? WritableSignerAccount<TAccountAuthority> &\n AccountSignerMeta<TAccountAuthority>\n : TAccountAuthority,\n TAccountAccordState extends string\n ? WritableAccount<TAccountAccordState>\n : TAccountAccordState,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type ProposeUnpauseInstructionData = {\n discriminator: ReadonlyUint8Array;\n};\n\nexport type ProposeUnpauseInstructionDataArgs = {};\n\nexport function getProposeUnpauseInstructionDataEncoder(): FixedSizeEncoder<ProposeUnpauseInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([[\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)]]),\n (value) => ({ ...value, discriminator: PROPOSE_UNPAUSE_DISCRIMINATOR }),\n );\n}\n\nexport function getProposeUnpauseInstructionDataDecoder(): FixedSizeDecoder<ProposeUnpauseInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n ]);\n}\n\nexport function getProposeUnpauseInstructionDataCodec(): FixedSizeCodec<\n ProposeUnpauseInstructionDataArgs,\n ProposeUnpauseInstructionData\n> {\n return combineCodec(\n getProposeUnpauseInstructionDataEncoder(),\n getProposeUnpauseInstructionDataDecoder(),\n );\n}\n\nexport type ProposeUnpauseAsyncInput<\n TAccountAuthority extends string = string,\n TAccountAccordState extends string = string,\n> = {\n authority: TransactionSigner<TAccountAuthority>;\n accordState?: Address<TAccountAccordState>;\n};\n\nexport async function getProposeUnpauseInstructionAsync<\n TAccountAuthority extends string,\n TAccountAccordState extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: ProposeUnpauseAsyncInput<TAccountAuthority, TAccountAccordState>,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n ProposeUnpauseInstruction<\n TProgramAddress,\n TAccountAuthority,\n TAccountAccordState\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n authority: { value: input.authority ?? null, isWritable: true },\n accordState: { value: input.accordState ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Resolve default values.\n if (!accounts.accordState.value) {\n accounts.accordState.value = await findAccordStatePda();\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"authority\", accounts.authority),\n getAccountMeta(\"accordState\", accounts.accordState),\n ],\n data: getProposeUnpauseInstructionDataEncoder().encode({}),\n programAddress,\n } as ProposeUnpauseInstruction<\n TProgramAddress,\n TAccountAuthority,\n TAccountAccordState\n >);\n}\n\nexport type ProposeUnpauseInput<\n TAccountAuthority extends string = string,\n TAccountAccordState extends string = string,\n> = {\n authority: TransactionSigner<TAccountAuthority>;\n accordState: Address<TAccountAccordState>;\n};\n\nexport function getProposeUnpauseInstruction<\n TAccountAuthority extends string,\n TAccountAccordState extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: ProposeUnpauseInput<TAccountAuthority, TAccountAccordState>,\n config?: { programAddress?: TProgramAddress },\n): ProposeUnpauseInstruction<\n TProgramAddress,\n TAccountAuthority,\n TAccountAccordState\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n authority: { value: input.authority ?? null, isWritable: true },\n accordState: { value: input.accordState ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"authority\", accounts.authority),\n getAccountMeta(\"accordState\", accounts.accordState),\n ],\n data: getProposeUnpauseInstructionDataEncoder().encode({}),\n programAddress,\n } as ProposeUnpauseInstruction<\n TProgramAddress,\n TAccountAuthority,\n TAccountAccordState\n >);\n}\n\nexport type ParsedProposeUnpauseInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n authority: TAccountMetas[0];\n accordState: TAccountMetas[1];\n };\n data: ProposeUnpauseInstructionData;\n};\n\nexport function parseProposeUnpauseInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedProposeUnpauseInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 2) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 2,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: { authority: getNextAccount(), accordState: getNextAccount() },\n data: getProposeUnpauseInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getArrayDecoder,\n getArrayEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n getAddressFromResolvedInstructionAccount,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { findJurorStakePda } from \"../pdas\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\nimport {\n getMSTNodeDecoder,\n getMSTNodeEncoder,\n type MSTNode,\n type MSTNodeArgs,\n} from \"../types\";\n\nexport const PRUNE_JUROR_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 49, 219, 100, 132, 202, 120, 18, 167,\n]);\n\nexport function getPruneJurorDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(PRUNE_JUROR_DISCRIMINATOR);\n}\n\nexport type PruneJurorInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountCaller extends string | AccountMeta<string> = string,\n TAccountJuror extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountJurorStake extends string | AccountMeta<string> = string,\n TAccountSystemProgram extends string | AccountMeta<string> =\n \"11111111111111111111111111111111\",\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountCaller extends string\n ? WritableSignerAccount<TAccountCaller> &\n AccountSignerMeta<TAccountCaller>\n : TAccountCaller,\n TAccountJuror extends string\n ? ReadonlyAccount<TAccountJuror>\n : TAccountJuror,\n TAccountSubaccord extends string\n ? WritableAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountJurorStake extends string\n ? WritableAccount<TAccountJurorStake>\n : TAccountJurorStake,\n TAccountSystemProgram extends string\n ? ReadonlyAccount<TAccountSystemProgram>\n : TAccountSystemProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type PruneJurorInstructionData = {\n discriminator: ReadonlyUint8Array;\n path: Array<MSTNode>;\n};\n\nexport type PruneJurorInstructionDataArgs = { path: Array<MSTNodeArgs> };\n\nexport function getPruneJurorInstructionDataEncoder(): Encoder<PruneJurorInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"path\", getArrayEncoder(getMSTNodeEncoder())],\n ]),\n (value) => ({ ...value, discriminator: PRUNE_JUROR_DISCRIMINATOR }),\n );\n}\n\nexport function getPruneJurorInstructionDataDecoder(): Decoder<PruneJurorInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"path\", getArrayDecoder(getMSTNodeDecoder())],\n ]);\n}\n\nexport function getPruneJurorInstructionDataCodec(): Codec<\n PruneJurorInstructionDataArgs,\n PruneJurorInstructionData\n> {\n return combineCodec(\n getPruneJurorInstructionDataEncoder(),\n getPruneJurorInstructionDataDecoder(),\n );\n}\n\nexport type PruneJurorAsyncInput<\n TAccountCaller extends string = string,\n TAccountJuror extends string = string,\n TAccountSubaccord extends string = string,\n TAccountJurorStake extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n caller: TransactionSigner<TAccountCaller>;\n /** address seeds the `JurorStake` PDA below, linking the two. */\n juror: Address<TAccountJuror>;\n subaccord: Address<TAccountSubaccord>;\n jurorStake?: Address<TAccountJurorStake>;\n systemProgram?: Address<TAccountSystemProgram>;\n path: PruneJurorInstructionDataArgs[\"path\"];\n};\n\nexport async function getPruneJurorInstructionAsync<\n TAccountCaller extends string,\n TAccountJuror extends string,\n TAccountSubaccord extends string,\n TAccountJurorStake extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: PruneJurorAsyncInput<\n TAccountCaller,\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n PruneJurorInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake,\n TAccountSystemProgram\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n caller: { value: input.caller ?? null, isWritable: true },\n juror: { value: input.juror ?? null, isWritable: false },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n jurorStake: { value: input.jurorStake ?? null, isWritable: true },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.jurorStake.value) {\n accounts.jurorStake.value = await findJurorStakePda({\n subaccord: getAddressFromResolvedInstructionAccount(\n \"subaccord\",\n accounts.subaccord.value,\n ),\n juror: getAddressFromResolvedInstructionAccount(\n \"juror\",\n accounts.juror.value,\n ),\n });\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n \"11111111111111111111111111111111\" as Address<\"11111111111111111111111111111111\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"caller\", accounts.caller),\n getAccountMeta(\"juror\", accounts.juror),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"jurorStake\", accounts.jurorStake),\n getAccountMeta(\"systemProgram\", accounts.systemProgram),\n ],\n data: getPruneJurorInstructionDataEncoder().encode(\n args as PruneJurorInstructionDataArgs,\n ),\n programAddress,\n } as PruneJurorInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake,\n TAccountSystemProgram\n >);\n}\n\nexport type PruneJurorInput<\n TAccountCaller extends string = string,\n TAccountJuror extends string = string,\n TAccountSubaccord extends string = string,\n TAccountJurorStake extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n caller: TransactionSigner<TAccountCaller>;\n /** address seeds the `JurorStake` PDA below, linking the two. */\n juror: Address<TAccountJuror>;\n subaccord: Address<TAccountSubaccord>;\n jurorStake: Address<TAccountJurorStake>;\n systemProgram?: Address<TAccountSystemProgram>;\n path: PruneJurorInstructionDataArgs[\"path\"];\n};\n\nexport function getPruneJurorInstruction<\n TAccountCaller extends string,\n TAccountJuror extends string,\n TAccountSubaccord extends string,\n TAccountJurorStake extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: PruneJurorInput<\n TAccountCaller,\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): PruneJurorInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake,\n TAccountSystemProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n caller: { value: input.caller ?? null, isWritable: true },\n juror: { value: input.juror ?? null, isWritable: false },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n jurorStake: { value: input.jurorStake ?? null, isWritable: true },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n \"11111111111111111111111111111111\" as Address<\"11111111111111111111111111111111\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"caller\", accounts.caller),\n getAccountMeta(\"juror\", accounts.juror),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"jurorStake\", accounts.jurorStake),\n getAccountMeta(\"systemProgram\", accounts.systemProgram),\n ],\n data: getPruneJurorInstructionDataEncoder().encode(\n args as PruneJurorInstructionDataArgs,\n ),\n programAddress,\n } as PruneJurorInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake,\n TAccountSystemProgram\n >);\n}\n\nexport type ParsedPruneJurorInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n caller: TAccountMetas[0];\n /** address seeds the `JurorStake` PDA below, linking the two. */\n juror: TAccountMetas[1];\n subaccord: TAccountMetas[2];\n jurorStake: TAccountMetas[3];\n systemProgram: TAccountMetas[4];\n };\n data: PruneJurorInstructionData;\n};\n\nexport function parsePruneJurorInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedPruneJurorInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 5) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 5,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n caller: getNextAccount(),\n juror: getNextAccount(),\n subaccord: getNextAccount(),\n jurorStake: getNextAccount(),\n systemProgram: getNextAccount(),\n },\n data: getPruneJurorInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getArrayDecoder,\n getArrayEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\nimport {\n getMSTNodeDecoder,\n getMSTNodeEncoder,\n type MSTNode,\n type MSTNodeArgs,\n} from \"../types\";\n\nexport const RECLAIM_SLOT_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 44, 216, 234, 229, 129, 82, 98, 5,\n]);\n\nexport function getReclaimSlotDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n RECLAIM_SLOT_DISCRIMINATOR,\n );\n}\n\nexport type ReclaimSlotInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountCaller extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountJurorStake extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountCaller extends string\n ? WritableSignerAccount<TAccountCaller> &\n AccountSignerMeta<TAccountCaller>\n : TAccountCaller,\n TAccountSubaccord extends string\n ? WritableAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountJurorStake extends string\n ? WritableAccount<TAccountJurorStake>\n : TAccountJurorStake,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type ReclaimSlotInstructionData = {\n discriminator: ReadonlyUint8Array;\n path: Array<MSTNode>;\n};\n\nexport type ReclaimSlotInstructionDataArgs = { path: Array<MSTNodeArgs> };\n\nexport function getReclaimSlotInstructionDataEncoder(): Encoder<ReclaimSlotInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"path\", getArrayEncoder(getMSTNodeEncoder())],\n ]),\n (value) => ({ ...value, discriminator: RECLAIM_SLOT_DISCRIMINATOR }),\n );\n}\n\nexport function getReclaimSlotInstructionDataDecoder(): Decoder<ReclaimSlotInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"path\", getArrayDecoder(getMSTNodeDecoder())],\n ]);\n}\n\nexport function getReclaimSlotInstructionDataCodec(): Codec<\n ReclaimSlotInstructionDataArgs,\n ReclaimSlotInstructionData\n> {\n return combineCodec(\n getReclaimSlotInstructionDataEncoder(),\n getReclaimSlotInstructionDataDecoder(),\n );\n}\n\nexport type ReclaimSlotInput<\n TAccountCaller extends string = string,\n TAccountSubaccord extends string = string,\n TAccountJurorStake extends string = string,\n> = {\n caller: TransactionSigner<TAccountCaller>;\n subaccord: Address<TAccountSubaccord>;\n jurorStake: Address<TAccountJurorStake>;\n path: ReclaimSlotInstructionDataArgs[\"path\"];\n};\n\nexport function getReclaimSlotInstruction<\n TAccountCaller extends string,\n TAccountSubaccord extends string,\n TAccountJurorStake extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: ReclaimSlotInput<\n TAccountCaller,\n TAccountSubaccord,\n TAccountJurorStake\n >,\n config?: { programAddress?: TProgramAddress },\n): ReclaimSlotInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountJurorStake\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n caller: { value: input.caller ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n jurorStake: { value: input.jurorStake ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"caller\", accounts.caller),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"jurorStake\", accounts.jurorStake),\n ],\n data: getReclaimSlotInstructionDataEncoder().encode(\n args as ReclaimSlotInstructionDataArgs,\n ),\n programAddress,\n } as ReclaimSlotInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountJurorStake\n >);\n}\n\nexport type ParsedReclaimSlotInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n caller: TAccountMetas[0];\n subaccord: TAccountMetas[1];\n jurorStake: TAccountMetas[2];\n };\n data: ReclaimSlotInstructionData;\n};\n\nexport function parseReclaimSlotInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedReclaimSlotInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 3) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 3,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n caller: getNextAccount(),\n subaccord: getNextAccount(),\n jurorStake: getNextAccount(),\n },\n data: getReclaimSlotInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getArrayDecoder,\n getArrayEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\nimport {\n getMSTNodeDecoder,\n getMSTNodeEncoder,\n type MSTNode,\n type MSTNodeArgs,\n} from \"../types\";\n\nexport const RECONCILE_STAKE_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array(\n [40, 103, 128, 85, 211, 11, 34, 80],\n);\n\nexport function getReconcileStakeDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n RECONCILE_STAKE_DISCRIMINATOR,\n );\n}\n\nexport type ReconcileStakeInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountCaller extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountJurorStake extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountCaller extends string\n ? WritableSignerAccount<TAccountCaller> &\n AccountSignerMeta<TAccountCaller>\n : TAccountCaller,\n TAccountSubaccord extends string\n ? WritableAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountJurorStake extends string\n ? WritableAccount<TAccountJurorStake>\n : TAccountJurorStake,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type ReconcileStakeInstructionData = {\n discriminator: ReadonlyUint8Array;\n path: Array<MSTNode>;\n};\n\nexport type ReconcileStakeInstructionDataArgs = { path: Array<MSTNodeArgs> };\n\nexport function getReconcileStakeInstructionDataEncoder(): Encoder<ReconcileStakeInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"path\", getArrayEncoder(getMSTNodeEncoder())],\n ]),\n (value) => ({ ...value, discriminator: RECONCILE_STAKE_DISCRIMINATOR }),\n );\n}\n\nexport function getReconcileStakeInstructionDataDecoder(): Decoder<ReconcileStakeInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"path\", getArrayDecoder(getMSTNodeDecoder())],\n ]);\n}\n\nexport function getReconcileStakeInstructionDataCodec(): Codec<\n ReconcileStakeInstructionDataArgs,\n ReconcileStakeInstructionData\n> {\n return combineCodec(\n getReconcileStakeInstructionDataEncoder(),\n getReconcileStakeInstructionDataDecoder(),\n );\n}\n\nexport type ReconcileStakeInput<\n TAccountCaller extends string = string,\n TAccountSubaccord extends string = string,\n TAccountJurorStake extends string = string,\n> = {\n caller: TransactionSigner<TAccountCaller>;\n subaccord: Address<TAccountSubaccord>;\n jurorStake: Address<TAccountJurorStake>;\n path: ReconcileStakeInstructionDataArgs[\"path\"];\n};\n\nexport function getReconcileStakeInstruction<\n TAccountCaller extends string,\n TAccountSubaccord extends string,\n TAccountJurorStake extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: ReconcileStakeInput<\n TAccountCaller,\n TAccountSubaccord,\n TAccountJurorStake\n >,\n config?: { programAddress?: TProgramAddress },\n): ReconcileStakeInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountJurorStake\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n caller: { value: input.caller ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n jurorStake: { value: input.jurorStake ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"caller\", accounts.caller),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"jurorStake\", accounts.jurorStake),\n ],\n data: getReconcileStakeInstructionDataEncoder().encode(\n args as ReconcileStakeInstructionDataArgs,\n ),\n programAddress,\n } as ReconcileStakeInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountJurorStake\n >);\n}\n\nexport type ParsedReconcileStakeInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n caller: TAccountMetas[0];\n subaccord: TAccountMetas[1];\n jurorStake: TAccountMetas[2];\n };\n data: ReconcileStakeInstructionData;\n};\n\nexport function parseReconcileStakeInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedReconcileStakeInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 3) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 3,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n caller: getNextAccount(),\n subaccord: getNextAccount(),\n jurorStake: getNextAccount(),\n },\n data: getReconcileStakeInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getAddressEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n getAddressFromResolvedInstructionAccount,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\n\nexport const REDRAW_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 86, 111, 66, 164, 105, 158, 114, 164,\n]);\n\nexport function getRedrawDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(REDRAW_DISCRIMINATOR);\n}\n\nexport type RedrawInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountCaller extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountDispute extends string | AccountMeta<string> = string,\n TAccountRound extends string | AccountMeta<string> = string,\n TAccountFeeToken extends string | AccountMeta<string> = string,\n TAccountFilerTokenAccount extends string | AccountMeta<string> = string,\n TAccountFeeVault extends string | AccountMeta<string> = string,\n TAccountTokenProgram extends string | AccountMeta<string> =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\",\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountCaller extends string\n ? WritableSignerAccount<TAccountCaller> &\n AccountSignerMeta<TAccountCaller>\n : TAccountCaller,\n TAccountSubaccord extends string\n ? WritableAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountDispute extends string\n ? WritableAccount<TAccountDispute>\n : TAccountDispute,\n TAccountRound extends string\n ? WritableAccount<TAccountRound>\n : TAccountRound,\n TAccountFeeToken extends string\n ? ReadonlyAccount<TAccountFeeToken>\n : TAccountFeeToken,\n TAccountFilerTokenAccount extends string\n ? WritableAccount<TAccountFilerTokenAccount>\n : TAccountFilerTokenAccount,\n TAccountFeeVault extends string\n ? WritableAccount<TAccountFeeVault>\n : TAccountFeeVault,\n TAccountTokenProgram extends string\n ? ReadonlyAccount<TAccountTokenProgram>\n : TAccountTokenProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type RedrawInstructionData = { discriminator: ReadonlyUint8Array };\n\nexport type RedrawInstructionDataArgs = {};\n\nexport function getRedrawInstructionDataEncoder(): FixedSizeEncoder<RedrawInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([[\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)]]),\n (value) => ({ ...value, discriminator: REDRAW_DISCRIMINATOR }),\n );\n}\n\nexport function getRedrawInstructionDataDecoder(): FixedSizeDecoder<RedrawInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n ]);\n}\n\nexport function getRedrawInstructionDataCodec(): FixedSizeCodec<\n RedrawInstructionDataArgs,\n RedrawInstructionData\n> {\n return combineCodec(\n getRedrawInstructionDataEncoder(),\n getRedrawInstructionDataDecoder(),\n );\n}\n\nexport type RedrawAsyncInput<\n TAccountCaller extends string = string,\n TAccountSubaccord extends string = string,\n TAccountDispute extends string = string,\n TAccountRound extends string = string,\n TAccountFeeToken extends string = string,\n TAccountFilerTokenAccount extends string = string,\n TAccountFeeVault extends string = string,\n TAccountTokenProgram extends string = string,\n> = {\n caller: TransactionSigner<TAccountCaller>;\n subaccord: Address<TAccountSubaccord>;\n dispute: Address<TAccountDispute>;\n /** The shortfall round (`dispute.current_round`). */\n round: Address<TAccountRound>;\n feeToken: Address<TAccountFeeToken>;\n /**\n * Filer refund destination (Fail branch). Unused on the Redraw branch but\n * always validated — the cranker passes it regardless.\n */\n filerTokenAccount: Address<TAccountFilerTokenAccount>;\n feeVault?: Address<TAccountFeeVault>;\n tokenProgram?: Address<TAccountTokenProgram>;\n};\n\nexport async function getRedrawInstructionAsync<\n TAccountCaller extends string,\n TAccountSubaccord extends string,\n TAccountDispute extends string,\n TAccountRound extends string,\n TAccountFeeToken extends string,\n TAccountFilerTokenAccount extends string,\n TAccountFeeVault extends string,\n TAccountTokenProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: RedrawAsyncInput<\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound,\n TAccountFeeToken,\n TAccountFilerTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n RedrawInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound,\n TAccountFeeToken,\n TAccountFilerTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n caller: { value: input.caller ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n dispute: { value: input.dispute ?? null, isWritable: true },\n round: { value: input.round ?? null, isWritable: true },\n feeToken: { value: input.feeToken ?? null, isWritable: false },\n filerTokenAccount: {\n value: input.filerTokenAccount ?? null,\n isWritable: true,\n },\n feeVault: { value: input.feeVault ?? null, isWritable: true },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Resolve default values.\n if (!accounts.feeVault.value) {\n accounts.feeVault.value = await getProgramDerivedAddress({\n programAddress:\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\" as Address<\"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\">,\n seeds: [\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"subaccord\",\n accounts.subaccord.value,\n ),\n ),\n getBytesEncoder().encode(\n new Uint8Array([\n 6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206, 235,\n 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140, 245, 133,\n 126, 255, 0, 169,\n ]),\n ),\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"feeToken\",\n accounts.feeToken.value,\n ),\n ),\n ],\n });\n }\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\" as Address<\"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"caller\", accounts.caller),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"dispute\", accounts.dispute),\n getAccountMeta(\"round\", accounts.round),\n getAccountMeta(\"feeToken\", accounts.feeToken),\n getAccountMeta(\"filerTokenAccount\", accounts.filerTokenAccount),\n getAccountMeta(\"feeVault\", accounts.feeVault),\n getAccountMeta(\"tokenProgram\", accounts.tokenProgram),\n ],\n data: getRedrawInstructionDataEncoder().encode({}),\n programAddress,\n } as RedrawInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound,\n TAccountFeeToken,\n TAccountFilerTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n >);\n}\n\nexport type RedrawInput<\n TAccountCaller extends string = string,\n TAccountSubaccord extends string = string,\n TAccountDispute extends string = string,\n TAccountRound extends string = string,\n TAccountFeeToken extends string = string,\n TAccountFilerTokenAccount extends string = string,\n TAccountFeeVault extends string = string,\n TAccountTokenProgram extends string = string,\n> = {\n caller: TransactionSigner<TAccountCaller>;\n subaccord: Address<TAccountSubaccord>;\n dispute: Address<TAccountDispute>;\n /** The shortfall round (`dispute.current_round`). */\n round: Address<TAccountRound>;\n feeToken: Address<TAccountFeeToken>;\n /**\n * Filer refund destination (Fail branch). Unused on the Redraw branch but\n * always validated — the cranker passes it regardless.\n */\n filerTokenAccount: Address<TAccountFilerTokenAccount>;\n feeVault: Address<TAccountFeeVault>;\n tokenProgram?: Address<TAccountTokenProgram>;\n};\n\nexport function getRedrawInstruction<\n TAccountCaller extends string,\n TAccountSubaccord extends string,\n TAccountDispute extends string,\n TAccountRound extends string,\n TAccountFeeToken extends string,\n TAccountFilerTokenAccount extends string,\n TAccountFeeVault extends string,\n TAccountTokenProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: RedrawInput<\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound,\n TAccountFeeToken,\n TAccountFilerTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): RedrawInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound,\n TAccountFeeToken,\n TAccountFilerTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n caller: { value: input.caller ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n dispute: { value: input.dispute ?? null, isWritable: true },\n round: { value: input.round ?? null, isWritable: true },\n feeToken: { value: input.feeToken ?? null, isWritable: false },\n filerTokenAccount: {\n value: input.filerTokenAccount ?? null,\n isWritable: true,\n },\n feeVault: { value: input.feeVault ?? null, isWritable: true },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Resolve default values.\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\" as Address<\"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"caller\", accounts.caller),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"dispute\", accounts.dispute),\n getAccountMeta(\"round\", accounts.round),\n getAccountMeta(\"feeToken\", accounts.feeToken),\n getAccountMeta(\"filerTokenAccount\", accounts.filerTokenAccount),\n getAccountMeta(\"feeVault\", accounts.feeVault),\n getAccountMeta(\"tokenProgram\", accounts.tokenProgram),\n ],\n data: getRedrawInstructionDataEncoder().encode({}),\n programAddress,\n } as RedrawInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound,\n TAccountFeeToken,\n TAccountFilerTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n >);\n}\n\nexport type ParsedRedrawInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n caller: TAccountMetas[0];\n subaccord: TAccountMetas[1];\n dispute: TAccountMetas[2];\n /** The shortfall round (`dispute.current_round`). */\n round: TAccountMetas[3];\n feeToken: TAccountMetas[4];\n /**\n * Filer refund destination (Fail branch). Unused on the Redraw branch but\n * always validated — the cranker passes it regardless.\n */\n filerTokenAccount: TAccountMetas[5];\n feeVault: TAccountMetas[6];\n tokenProgram: TAccountMetas[7];\n };\n data: RedrawInstructionData;\n};\n\nexport function parseRedrawInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedRedrawInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 8) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 8,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n caller: getNextAccount(),\n subaccord: getNextAccount(),\n dispute: getNextAccount(),\n round: getNextAccount(),\n feeToken: getNextAccount(),\n filerTokenAccount: getNextAccount(),\n feeVault: getNextAccount(),\n tokenProgram: getNextAccount(),\n },\n data: getRedrawInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { findProgramIdentityPda } from \"../pdas\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\n\nexport const REQUEST_VRF_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 5, 87, 79, 152, 164, 176, 190, 226,\n]);\n\nexport function getRequestVrfDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(REQUEST_VRF_DISCRIMINATOR);\n}\n\nexport type RequestVrfInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountCaller extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountDispute extends string | AccountMeta<string> = string,\n TAccountOracleQueue extends string | AccountMeta<string> =\n \"Cuj97ggrhhidhbu39TijNVqE74xvKJ69gDervRUXAxGh\",\n TAccountProgramIdentity extends string | AccountMeta<string> = string,\n TAccountVrfProgram extends string | AccountMeta<string> =\n \"Vrf1RNUjXmQGjmQrQLvJHs9SNkvDJEsRVFPkfSQUwGz\",\n TAccountSlotHashes extends string | AccountMeta<string> =\n \"SysvarS1otHashes111111111111111111111111111\",\n TAccountSystemProgram extends string | AccountMeta<string> =\n \"11111111111111111111111111111111\",\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountCaller extends string\n ? WritableSignerAccount<TAccountCaller> &\n AccountSignerMeta<TAccountCaller>\n : TAccountCaller,\n TAccountSubaccord extends string\n ? ReadonlyAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountDispute extends string\n ? WritableAccount<TAccountDispute>\n : TAccountDispute,\n TAccountOracleQueue extends string\n ? WritableAccount<TAccountOracleQueue>\n : TAccountOracleQueue,\n TAccountProgramIdentity extends string\n ? ReadonlyAccount<TAccountProgramIdentity>\n : TAccountProgramIdentity,\n TAccountVrfProgram extends string\n ? ReadonlyAccount<TAccountVrfProgram>\n : TAccountVrfProgram,\n TAccountSlotHashes extends string\n ? ReadonlyAccount<TAccountSlotHashes>\n : TAccountSlotHashes,\n TAccountSystemProgram extends string\n ? ReadonlyAccount<TAccountSystemProgram>\n : TAccountSystemProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type RequestVrfInstructionData = { discriminator: ReadonlyUint8Array };\n\nexport type RequestVrfInstructionDataArgs = {};\n\nexport function getRequestVrfInstructionDataEncoder(): FixedSizeEncoder<RequestVrfInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([[\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)]]),\n (value) => ({ ...value, discriminator: REQUEST_VRF_DISCRIMINATOR }),\n );\n}\n\nexport function getRequestVrfInstructionDataDecoder(): FixedSizeDecoder<RequestVrfInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n ]);\n}\n\nexport function getRequestVrfInstructionDataCodec(): FixedSizeCodec<\n RequestVrfInstructionDataArgs,\n RequestVrfInstructionData\n> {\n return combineCodec(\n getRequestVrfInstructionDataEncoder(),\n getRequestVrfInstructionDataDecoder(),\n );\n}\n\nexport type RequestVrfAsyncInput<\n TAccountCaller extends string = string,\n TAccountSubaccord extends string = string,\n TAccountDispute extends string = string,\n TAccountOracleQueue extends string = string,\n TAccountProgramIdentity extends string = string,\n TAccountVrfProgram extends string = string,\n TAccountSlotHashes extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n caller: TransactionSigner<TAccountCaller>;\n subaccord: Address<TAccountSubaccord>;\n dispute: Address<TAccountDispute>;\n oracleQueue?: Address<TAccountOracleQueue>;\n programIdentity?: Address<TAccountProgramIdentity>;\n vrfProgram?: Address<TAccountVrfProgram>;\n slotHashes?: Address<TAccountSlotHashes>;\n systemProgram?: Address<TAccountSystemProgram>;\n};\n\nexport async function getRequestVrfInstructionAsync<\n TAccountCaller extends string,\n TAccountSubaccord extends string,\n TAccountDispute extends string,\n TAccountOracleQueue extends string,\n TAccountProgramIdentity extends string,\n TAccountVrfProgram extends string,\n TAccountSlotHashes extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: RequestVrfAsyncInput<\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountOracleQueue,\n TAccountProgramIdentity,\n TAccountVrfProgram,\n TAccountSlotHashes,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n RequestVrfInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountOracleQueue,\n TAccountProgramIdentity,\n TAccountVrfProgram,\n TAccountSlotHashes,\n TAccountSystemProgram\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n caller: { value: input.caller ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: false },\n dispute: { value: input.dispute ?? null, isWritable: true },\n oracleQueue: { value: input.oracleQueue ?? null, isWritable: true },\n programIdentity: {\n value: input.programIdentity ?? null,\n isWritable: false,\n },\n vrfProgram: { value: input.vrfProgram ?? null, isWritable: false },\n slotHashes: { value: input.slotHashes ?? null, isWritable: false },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Resolve default values.\n if (!accounts.oracleQueue.value) {\n accounts.oracleQueue.value =\n \"Cuj97ggrhhidhbu39TijNVqE74xvKJ69gDervRUXAxGh\" as Address<\"Cuj97ggrhhidhbu39TijNVqE74xvKJ69gDervRUXAxGh\">;\n }\n if (!accounts.programIdentity.value) {\n accounts.programIdentity.value = await findProgramIdentityPda();\n }\n if (!accounts.vrfProgram.value) {\n accounts.vrfProgram.value =\n \"Vrf1RNUjXmQGjmQrQLvJHs9SNkvDJEsRVFPkfSQUwGz\" as Address<\"Vrf1RNUjXmQGjmQrQLvJHs9SNkvDJEsRVFPkfSQUwGz\">;\n }\n if (!accounts.slotHashes.value) {\n accounts.slotHashes.value =\n \"SysvarS1otHashes111111111111111111111111111\" as Address<\"SysvarS1otHashes111111111111111111111111111\">;\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n \"11111111111111111111111111111111\" as Address<\"11111111111111111111111111111111\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"caller\", accounts.caller),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"dispute\", accounts.dispute),\n getAccountMeta(\"oracleQueue\", accounts.oracleQueue),\n getAccountMeta(\"programIdentity\", accounts.programIdentity),\n getAccountMeta(\"vrfProgram\", accounts.vrfProgram),\n getAccountMeta(\"slotHashes\", accounts.slotHashes),\n getAccountMeta(\"systemProgram\", accounts.systemProgram),\n ],\n data: getRequestVrfInstructionDataEncoder().encode({}),\n programAddress,\n } as RequestVrfInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountOracleQueue,\n TAccountProgramIdentity,\n TAccountVrfProgram,\n TAccountSlotHashes,\n TAccountSystemProgram\n >);\n}\n\nexport type RequestVrfInput<\n TAccountCaller extends string = string,\n TAccountSubaccord extends string = string,\n TAccountDispute extends string = string,\n TAccountOracleQueue extends string = string,\n TAccountProgramIdentity extends string = string,\n TAccountVrfProgram extends string = string,\n TAccountSlotHashes extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n caller: TransactionSigner<TAccountCaller>;\n subaccord: Address<TAccountSubaccord>;\n dispute: Address<TAccountDispute>;\n oracleQueue?: Address<TAccountOracleQueue>;\n programIdentity: Address<TAccountProgramIdentity>;\n vrfProgram?: Address<TAccountVrfProgram>;\n slotHashes?: Address<TAccountSlotHashes>;\n systemProgram?: Address<TAccountSystemProgram>;\n};\n\nexport function getRequestVrfInstruction<\n TAccountCaller extends string,\n TAccountSubaccord extends string,\n TAccountDispute extends string,\n TAccountOracleQueue extends string,\n TAccountProgramIdentity extends string,\n TAccountVrfProgram extends string,\n TAccountSlotHashes extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: RequestVrfInput<\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountOracleQueue,\n TAccountProgramIdentity,\n TAccountVrfProgram,\n TAccountSlotHashes,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): RequestVrfInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountOracleQueue,\n TAccountProgramIdentity,\n TAccountVrfProgram,\n TAccountSlotHashes,\n TAccountSystemProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n caller: { value: input.caller ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: false },\n dispute: { value: input.dispute ?? null, isWritable: true },\n oracleQueue: { value: input.oracleQueue ?? null, isWritable: true },\n programIdentity: {\n value: input.programIdentity ?? null,\n isWritable: false,\n },\n vrfProgram: { value: input.vrfProgram ?? null, isWritable: false },\n slotHashes: { value: input.slotHashes ?? null, isWritable: false },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Resolve default values.\n if (!accounts.oracleQueue.value) {\n accounts.oracleQueue.value =\n \"Cuj97ggrhhidhbu39TijNVqE74xvKJ69gDervRUXAxGh\" as Address<\"Cuj97ggrhhidhbu39TijNVqE74xvKJ69gDervRUXAxGh\">;\n }\n if (!accounts.vrfProgram.value) {\n accounts.vrfProgram.value =\n \"Vrf1RNUjXmQGjmQrQLvJHs9SNkvDJEsRVFPkfSQUwGz\" as Address<\"Vrf1RNUjXmQGjmQrQLvJHs9SNkvDJEsRVFPkfSQUwGz\">;\n }\n if (!accounts.slotHashes.value) {\n accounts.slotHashes.value =\n \"SysvarS1otHashes111111111111111111111111111\" as Address<\"SysvarS1otHashes111111111111111111111111111\">;\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n \"11111111111111111111111111111111\" as Address<\"11111111111111111111111111111111\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"caller\", accounts.caller),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"dispute\", accounts.dispute),\n getAccountMeta(\"oracleQueue\", accounts.oracleQueue),\n getAccountMeta(\"programIdentity\", accounts.programIdentity),\n getAccountMeta(\"vrfProgram\", accounts.vrfProgram),\n getAccountMeta(\"slotHashes\", accounts.slotHashes),\n getAccountMeta(\"systemProgram\", accounts.systemProgram),\n ],\n data: getRequestVrfInstructionDataEncoder().encode({}),\n programAddress,\n } as RequestVrfInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountOracleQueue,\n TAccountProgramIdentity,\n TAccountVrfProgram,\n TAccountSlotHashes,\n TAccountSystemProgram\n >);\n}\n\nexport type ParsedRequestVrfInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n caller: TAccountMetas[0];\n subaccord: TAccountMetas[1];\n dispute: TAccountMetas[2];\n oracleQueue: TAccountMetas[3];\n programIdentity: TAccountMetas[4];\n vrfProgram: TAccountMetas[5];\n slotHashes: TAccountMetas[6];\n systemProgram: TAccountMetas[7];\n };\n data: RequestVrfInstructionData;\n};\n\nexport function parseRequestVrfInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedRequestVrfInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 8) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 8,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n caller: getNextAccount(),\n subaccord: getNextAccount(),\n dispute: getNextAccount(),\n oracleQueue: getNextAccount(),\n programIdentity: getNextAccount(),\n vrfProgram: getNextAccount(),\n slotHashes: getNextAccount(),\n systemProgram: getNextAccount(),\n },\n data: getRequestVrfInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getArrayDecoder,\n getArrayEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n getAddressFromResolvedInstructionAccount,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { findJurorStakePda } from \"../pdas\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\nimport {\n getMSTNodeDecoder,\n getMSTNodeEncoder,\n type MSTNode,\n type MSTNodeArgs,\n} from \"../types\";\n\nexport const REQUEST_WITHDRAW_DISCRIMINATOR: ReadonlyUint8Array =\n new Uint8Array([137, 95, 187, 96, 250, 138, 31, 182]);\n\nexport function getRequestWithdrawDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n REQUEST_WITHDRAW_DISCRIMINATOR,\n );\n}\n\nexport type RequestWithdrawInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountJuror extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountJurorStake extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountJuror extends string\n ? WritableSignerAccount<TAccountJuror> &\n AccountSignerMeta<TAccountJuror>\n : TAccountJuror,\n TAccountSubaccord extends string\n ? WritableAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountJurorStake extends string\n ? WritableAccount<TAccountJurorStake>\n : TAccountJurorStake,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type RequestWithdrawInstructionData = {\n discriminator: ReadonlyUint8Array;\n amount: bigint;\n path: Array<MSTNode>;\n};\n\nexport type RequestWithdrawInstructionDataArgs = {\n amount: number | bigint;\n path: Array<MSTNodeArgs>;\n};\n\nexport function getRequestWithdrawInstructionDataEncoder(): Encoder<RequestWithdrawInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"amount\", getU64Encoder()],\n [\"path\", getArrayEncoder(getMSTNodeEncoder())],\n ]),\n (value) => ({ ...value, discriminator: REQUEST_WITHDRAW_DISCRIMINATOR }),\n );\n}\n\nexport function getRequestWithdrawInstructionDataDecoder(): Decoder<RequestWithdrawInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"amount\", getU64Decoder()],\n [\"path\", getArrayDecoder(getMSTNodeDecoder())],\n ]);\n}\n\nexport function getRequestWithdrawInstructionDataCodec(): Codec<\n RequestWithdrawInstructionDataArgs,\n RequestWithdrawInstructionData\n> {\n return combineCodec(\n getRequestWithdrawInstructionDataEncoder(),\n getRequestWithdrawInstructionDataDecoder(),\n );\n}\n\nexport type RequestWithdrawAsyncInput<\n TAccountJuror extends string = string,\n TAccountSubaccord extends string = string,\n TAccountJurorStake extends string = string,\n> = {\n juror: TransactionSigner<TAccountJuror>;\n subaccord: Address<TAccountSubaccord>;\n jurorStake?: Address<TAccountJurorStake>;\n amount: RequestWithdrawInstructionDataArgs[\"amount\"];\n path: RequestWithdrawInstructionDataArgs[\"path\"];\n};\n\nexport async function getRequestWithdrawInstructionAsync<\n TAccountJuror extends string,\n TAccountSubaccord extends string,\n TAccountJurorStake extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: RequestWithdrawAsyncInput<\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n RequestWithdrawInstruction<\n TProgramAddress,\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n juror: { value: input.juror ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n jurorStake: { value: input.jurorStake ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.jurorStake.value) {\n accounts.jurorStake.value = await findJurorStakePda({\n subaccord: getAddressFromResolvedInstructionAccount(\n \"subaccord\",\n accounts.subaccord.value,\n ),\n juror: getAddressFromResolvedInstructionAccount(\n \"juror\",\n accounts.juror.value,\n ),\n });\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"juror\", accounts.juror),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"jurorStake\", accounts.jurorStake),\n ],\n data: getRequestWithdrawInstructionDataEncoder().encode(\n args as RequestWithdrawInstructionDataArgs,\n ),\n programAddress,\n } as RequestWithdrawInstruction<\n TProgramAddress,\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake\n >);\n}\n\nexport type RequestWithdrawInput<\n TAccountJuror extends string = string,\n TAccountSubaccord extends string = string,\n TAccountJurorStake extends string = string,\n> = {\n juror: TransactionSigner<TAccountJuror>;\n subaccord: Address<TAccountSubaccord>;\n jurorStake: Address<TAccountJurorStake>;\n amount: RequestWithdrawInstructionDataArgs[\"amount\"];\n path: RequestWithdrawInstructionDataArgs[\"path\"];\n};\n\nexport function getRequestWithdrawInstruction<\n TAccountJuror extends string,\n TAccountSubaccord extends string,\n TAccountJurorStake extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: RequestWithdrawInput<\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake\n >,\n config?: { programAddress?: TProgramAddress },\n): RequestWithdrawInstruction<\n TProgramAddress,\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n juror: { value: input.juror ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n jurorStake: { value: input.jurorStake ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"juror\", accounts.juror),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"jurorStake\", accounts.jurorStake),\n ],\n data: getRequestWithdrawInstructionDataEncoder().encode(\n args as RequestWithdrawInstructionDataArgs,\n ),\n programAddress,\n } as RequestWithdrawInstruction<\n TProgramAddress,\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake\n >);\n}\n\nexport type ParsedRequestWithdrawInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n juror: TAccountMetas[0];\n subaccord: TAccountMetas[1];\n jurorStake: TAccountMetas[2];\n };\n data: RequestWithdrawInstructionData;\n};\n\nexport function parseRequestWithdrawInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedRequestWithdrawInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 3) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 3,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n juror: getNextAccount(),\n subaccord: getNextAccount(),\n jurorStake: getNextAccount(),\n },\n data: getRequestWithdrawInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\n\nexport const REVEAL_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 9, 35, 59, 190, 167, 249, 76, 115,\n]);\n\nexport function getRevealDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(REVEAL_DISCRIMINATOR);\n}\n\nexport type RevealInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountJuror extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountDispute extends string | AccountMeta<string> = string,\n TAccountRound extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountJuror extends string\n ? WritableSignerAccount<TAccountJuror> &\n AccountSignerMeta<TAccountJuror>\n : TAccountJuror,\n TAccountSubaccord extends string\n ? ReadonlyAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountDispute extends string\n ? WritableAccount<TAccountDispute>\n : TAccountDispute,\n TAccountRound extends string\n ? WritableAccount<TAccountRound>\n : TAccountRound,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type RevealInstructionData = {\n discriminator: ReadonlyUint8Array;\n vote: bigint;\n salt: ReadonlyUint8Array;\n};\n\nexport type RevealInstructionDataArgs = {\n vote: number | bigint;\n salt: ReadonlyUint8Array;\n};\n\nexport function getRevealInstructionDataEncoder(): FixedSizeEncoder<RevealInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"vote\", getU64Encoder()],\n [\"salt\", fixEncoderSize(getBytesEncoder(), 32)],\n ]),\n (value) => ({ ...value, discriminator: REVEAL_DISCRIMINATOR }),\n );\n}\n\nexport function getRevealInstructionDataDecoder(): FixedSizeDecoder<RevealInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"vote\", getU64Decoder()],\n [\"salt\", fixDecoderSize(getBytesDecoder(), 32)],\n ]);\n}\n\nexport function getRevealInstructionDataCodec(): FixedSizeCodec<\n RevealInstructionDataArgs,\n RevealInstructionData\n> {\n return combineCodec(\n getRevealInstructionDataEncoder(),\n getRevealInstructionDataDecoder(),\n );\n}\n\nexport type RevealInput<\n TAccountJuror extends string = string,\n TAccountSubaccord extends string = string,\n TAccountDispute extends string = string,\n TAccountRound extends string = string,\n> = {\n juror: TransactionSigner<TAccountJuror>;\n subaccord: Address<TAccountSubaccord>;\n dispute: Address<TAccountDispute>;\n round: Address<TAccountRound>;\n vote: RevealInstructionDataArgs[\"vote\"];\n salt: RevealInstructionDataArgs[\"salt\"];\n};\n\nexport function getRevealInstruction<\n TAccountJuror extends string,\n TAccountSubaccord extends string,\n TAccountDispute extends string,\n TAccountRound extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: RevealInput<\n TAccountJuror,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound\n >,\n config?: { programAddress?: TProgramAddress },\n): RevealInstruction<\n TProgramAddress,\n TAccountJuror,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n juror: { value: input.juror ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: false },\n dispute: { value: input.dispute ?? null, isWritable: true },\n round: { value: input.round ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"juror\", accounts.juror),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"dispute\", accounts.dispute),\n getAccountMeta(\"round\", accounts.round),\n ],\n data: getRevealInstructionDataEncoder().encode(\n args as RevealInstructionDataArgs,\n ),\n programAddress,\n } as RevealInstruction<\n TProgramAddress,\n TAccountJuror,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound\n >);\n}\n\nexport type ParsedRevealInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n juror: TAccountMetas[0];\n subaccord: TAccountMetas[1];\n dispute: TAccountMetas[2];\n round: TAccountMetas[3];\n };\n data: RevealInstructionData;\n};\n\nexport function parseRevealInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedRevealInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 4) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 4,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n juror: getNextAccount(),\n subaccord: getNextAccount(),\n dispute: getNextAccount(),\n round: getNextAccount(),\n },\n data: getRevealInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getBytesDecoder,\n getBytesEncoder,\n getStructDecoder,\n getStructEncoder,\n getU32Decoder,\n getU32Encoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n getAddressFromResolvedInstructionAccount,\n getNonNullResolvedInstructionInput,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { findRoundPda } from \"../pdas\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\n\nexport const SETTLE_ROUND_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 40, 101, 18, 1, 31, 129, 52, 77,\n]);\n\nexport function getSettleRoundDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n SETTLE_ROUND_DISCRIMINATOR,\n );\n}\n\nexport type SettleRoundInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountCaller extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountDispute extends string | AccountMeta<string> = string,\n TAccountRound extends string | AccountMeta<string> = string,\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountCaller extends string\n ? WritableSignerAccount<TAccountCaller> &\n AccountSignerMeta<TAccountCaller>\n : TAccountCaller,\n TAccountSubaccord extends string\n ? ReadonlyAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountDispute extends string\n ? WritableAccount<TAccountDispute>\n : TAccountDispute,\n TAccountRound extends string\n ? WritableAccount<TAccountRound>\n : TAccountRound,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type SettleRoundInstructionData = {\n discriminator: ReadonlyUint8Array;\n roundIdx: number;\n};\n\nexport type SettleRoundInstructionDataArgs = { roundIdx: number };\n\nexport function getSettleRoundInstructionDataEncoder(): FixedSizeEncoder<SettleRoundInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"roundIdx\", getU32Encoder()],\n ]),\n (value) => ({ ...value, discriminator: SETTLE_ROUND_DISCRIMINATOR }),\n );\n}\n\nexport function getSettleRoundInstructionDataDecoder(): FixedSizeDecoder<SettleRoundInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"roundIdx\", getU32Decoder()],\n ]);\n}\n\nexport function getSettleRoundInstructionDataCodec(): FixedSizeCodec<\n SettleRoundInstructionDataArgs,\n SettleRoundInstructionData\n> {\n return combineCodec(\n getSettleRoundInstructionDataEncoder(),\n getSettleRoundInstructionDataDecoder(),\n );\n}\n\nexport type SettleRoundAsyncInput<\n TAccountCaller extends string = string,\n TAccountSubaccord extends string = string,\n TAccountDispute extends string = string,\n TAccountRound extends string = string,\n> = {\n caller: TransactionSigner<TAccountCaller>;\n subaccord: Address<TAccountSubaccord>;\n dispute: Address<TAccountDispute>;\n round?: Address<TAccountRound>;\n roundIdx: SettleRoundInstructionDataArgs[\"roundIdx\"];\n};\n\nexport async function getSettleRoundInstructionAsync<\n TAccountCaller extends string,\n TAccountSubaccord extends string,\n TAccountDispute extends string,\n TAccountRound extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: SettleRoundAsyncInput<\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n SettleRoundInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n caller: { value: input.caller ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: false },\n dispute: { value: input.dispute ?? null, isWritable: true },\n round: { value: input.round ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.round.value) {\n accounts.round.value = await findRoundPda({\n dispute: getAddressFromResolvedInstructionAccount(\n \"dispute\",\n accounts.dispute.value,\n ),\n roundIdx: getNonNullResolvedInstructionInput(\"roundIdx\", args.roundIdx),\n });\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"caller\", accounts.caller),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"dispute\", accounts.dispute),\n getAccountMeta(\"round\", accounts.round),\n ],\n data: getSettleRoundInstructionDataEncoder().encode(\n args as SettleRoundInstructionDataArgs,\n ),\n programAddress,\n } as SettleRoundInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound\n >);\n}\n\nexport type SettleRoundInput<\n TAccountCaller extends string = string,\n TAccountSubaccord extends string = string,\n TAccountDispute extends string = string,\n TAccountRound extends string = string,\n> = {\n caller: TransactionSigner<TAccountCaller>;\n subaccord: Address<TAccountSubaccord>;\n dispute: Address<TAccountDispute>;\n round: Address<TAccountRound>;\n roundIdx: SettleRoundInstructionDataArgs[\"roundIdx\"];\n};\n\nexport function getSettleRoundInstruction<\n TAccountCaller extends string,\n TAccountSubaccord extends string,\n TAccountDispute extends string,\n TAccountRound extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: SettleRoundInput<\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound\n >,\n config?: { programAddress?: TProgramAddress },\n): SettleRoundInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n caller: { value: input.caller ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: false },\n dispute: { value: input.dispute ?? null, isWritable: true },\n round: { value: input.round ?? null, isWritable: true },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"caller\", accounts.caller),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"dispute\", accounts.dispute),\n getAccountMeta(\"round\", accounts.round),\n ],\n data: getSettleRoundInstructionDataEncoder().encode(\n args as SettleRoundInstructionDataArgs,\n ),\n programAddress,\n } as SettleRoundInstruction<\n TProgramAddress,\n TAccountCaller,\n TAccountSubaccord,\n TAccountDispute,\n TAccountRound\n >);\n}\n\nexport type ParsedSettleRoundInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n caller: TAccountMetas[0];\n subaccord: TAccountMetas[1];\n dispute: TAccountMetas[2];\n round: TAccountMetas[3];\n };\n data: SettleRoundInstructionData;\n};\n\nexport function parseSettleRoundInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedSettleRoundInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 4) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 4,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n caller: getNextAccount(),\n subaccord: getNextAccount(),\n dispute: getNextAccount(),\n round: getNextAccount(),\n },\n data: getSettleRoundInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getAddressEncoder,\n getArrayDecoder,\n getArrayEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type Codec,\n type Decoder,\n type Encoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n getAddressFromResolvedInstructionAccount,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { findAccordStatePda, findJurorStakePda } from \"../pdas\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\nimport {\n getMSTNodeDecoder,\n getMSTNodeEncoder,\n type MSTNode,\n type MSTNodeArgs,\n} from \"../types\";\n\nexport const STAKE_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 206, 176, 202, 18, 200, 209, 179, 108,\n]);\n\nexport function getStakeDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(STAKE_DISCRIMINATOR);\n}\n\nexport type StakeInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountJuror extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountAccordState extends string | AccountMeta<string> = string,\n TAccountJurorStake extends string | AccountMeta<string> = string,\n TAccountStakingToken extends string | AccountMeta<string> = string,\n TAccountJurorTokenAccount extends string | AccountMeta<string> = string,\n TAccountStakeVault extends string | AccountMeta<string> = string,\n TAccountTokenProgram extends string | AccountMeta<string> =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\",\n TAccountAssociatedTokenProgram extends string | AccountMeta<string> =\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\",\n TAccountSystemProgram extends string | AccountMeta<string> =\n \"11111111111111111111111111111111\",\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountJuror extends string\n ? WritableSignerAccount<TAccountJuror> &\n AccountSignerMeta<TAccountJuror>\n : TAccountJuror,\n TAccountSubaccord extends string\n ? WritableAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountAccordState extends string\n ? ReadonlyAccount<TAccountAccordState>\n : TAccountAccordState,\n TAccountJurorStake extends string\n ? WritableAccount<TAccountJurorStake>\n : TAccountJurorStake,\n TAccountStakingToken extends string\n ? ReadonlyAccount<TAccountStakingToken>\n : TAccountStakingToken,\n TAccountJurorTokenAccount extends string\n ? WritableAccount<TAccountJurorTokenAccount>\n : TAccountJurorTokenAccount,\n TAccountStakeVault extends string\n ? WritableAccount<TAccountStakeVault>\n : TAccountStakeVault,\n TAccountTokenProgram extends string\n ? ReadonlyAccount<TAccountTokenProgram>\n : TAccountTokenProgram,\n TAccountAssociatedTokenProgram extends string\n ? ReadonlyAccount<TAccountAssociatedTokenProgram>\n : TAccountAssociatedTokenProgram,\n TAccountSystemProgram extends string\n ? ReadonlyAccount<TAccountSystemProgram>\n : TAccountSystemProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type StakeInstructionData = {\n discriminator: ReadonlyUint8Array;\n amount: bigint;\n path: Array<MSTNode>;\n};\n\nexport type StakeInstructionDataArgs = {\n amount: number | bigint;\n path: Array<MSTNodeArgs>;\n};\n\nexport function getStakeInstructionDataEncoder(): Encoder<StakeInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([\n [\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)],\n [\"amount\", getU64Encoder()],\n [\"path\", getArrayEncoder(getMSTNodeEncoder())],\n ]),\n (value) => ({ ...value, discriminator: STAKE_DISCRIMINATOR }),\n );\n}\n\nexport function getStakeInstructionDataDecoder(): Decoder<StakeInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n [\"amount\", getU64Decoder()],\n [\"path\", getArrayDecoder(getMSTNodeDecoder())],\n ]);\n}\n\nexport function getStakeInstructionDataCodec(): Codec<\n StakeInstructionDataArgs,\n StakeInstructionData\n> {\n return combineCodec(\n getStakeInstructionDataEncoder(),\n getStakeInstructionDataDecoder(),\n );\n}\n\nexport type StakeAsyncInput<\n TAccountJuror extends string = string,\n TAccountSubaccord extends string = string,\n TAccountAccordState extends string = string,\n TAccountJurorStake extends string = string,\n TAccountStakingToken extends string = string,\n TAccountJurorTokenAccount extends string = string,\n TAccountStakeVault extends string = string,\n TAccountTokenProgram extends string = string,\n TAccountAssociatedTokenProgram extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n juror: TransactionSigner<TAccountJuror>;\n subaccord: Address<TAccountSubaccord>;\n /** Circuit breaker (ADR-0007): stake reverts while paused. */\n accordState?: Address<TAccountAccordState>;\n jurorStake?: Address<TAccountJurorStake>;\n /** Must be the Subaccord's declared staking token. */\n stakingToken: Address<TAccountStakingToken>;\n jurorTokenAccount?: Address<TAccountJurorTokenAccount>;\n /** Subaccord PDA's stake_vault ATA; `authority` (wallet) is the Subaccord PDA. */\n stakeVault?: Address<TAccountStakeVault>;\n tokenProgram?: Address<TAccountTokenProgram>;\n associatedTokenProgram?: Address<TAccountAssociatedTokenProgram>;\n systemProgram?: Address<TAccountSystemProgram>;\n amount: StakeInstructionDataArgs[\"amount\"];\n path: StakeInstructionDataArgs[\"path\"];\n};\n\nexport async function getStakeInstructionAsync<\n TAccountJuror extends string,\n TAccountSubaccord extends string,\n TAccountAccordState extends string,\n TAccountJurorStake extends string,\n TAccountStakingToken extends string,\n TAccountJurorTokenAccount extends string,\n TAccountStakeVault extends string,\n TAccountTokenProgram extends string,\n TAccountAssociatedTokenProgram extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: StakeAsyncInput<\n TAccountJuror,\n TAccountSubaccord,\n TAccountAccordState,\n TAccountJurorStake,\n TAccountStakingToken,\n TAccountJurorTokenAccount,\n TAccountStakeVault,\n TAccountTokenProgram,\n TAccountAssociatedTokenProgram,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n StakeInstruction<\n TProgramAddress,\n TAccountJuror,\n TAccountSubaccord,\n TAccountAccordState,\n TAccountJurorStake,\n TAccountStakingToken,\n TAccountJurorTokenAccount,\n TAccountStakeVault,\n TAccountTokenProgram,\n TAccountAssociatedTokenProgram,\n TAccountSystemProgram\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n juror: { value: input.juror ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n accordState: { value: input.accordState ?? null, isWritable: false },\n jurorStake: { value: input.jurorStake ?? null, isWritable: true },\n stakingToken: { value: input.stakingToken ?? null, isWritable: false },\n jurorTokenAccount: {\n value: input.jurorTokenAccount ?? null,\n isWritable: true,\n },\n stakeVault: { value: input.stakeVault ?? null, isWritable: true },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n associatedTokenProgram: {\n value: input.associatedTokenProgram ?? null,\n isWritable: false,\n },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.accordState.value) {\n accounts.accordState.value = await findAccordStatePda();\n }\n if (!accounts.jurorStake.value) {\n accounts.jurorStake.value = await findJurorStakePda({\n subaccord: getAddressFromResolvedInstructionAccount(\n \"subaccord\",\n accounts.subaccord.value,\n ),\n juror: getAddressFromResolvedInstructionAccount(\n \"juror\",\n accounts.juror.value,\n ),\n });\n }\n if (!accounts.jurorTokenAccount.value) {\n accounts.jurorTokenAccount.value = await getProgramDerivedAddress({\n programAddress:\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\" as Address<\"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\">,\n seeds: [\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"juror\",\n accounts.juror.value,\n ),\n ),\n getBytesEncoder().encode(\n new Uint8Array([\n 6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206, 235,\n 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140, 245, 133,\n 126, 255, 0, 169,\n ]),\n ),\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"stakingToken\",\n accounts.stakingToken.value,\n ),\n ),\n ],\n });\n }\n if (!accounts.stakeVault.value) {\n accounts.stakeVault.value = await getProgramDerivedAddress({\n programAddress:\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\" as Address<\"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\">,\n seeds: [\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"subaccord\",\n accounts.subaccord.value,\n ),\n ),\n getBytesEncoder().encode(\n new Uint8Array([\n 6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206, 235,\n 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140, 245, 133,\n 126, 255, 0, 169,\n ]),\n ),\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"stakingToken\",\n accounts.stakingToken.value,\n ),\n ),\n ],\n });\n }\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\" as Address<\"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\">;\n }\n if (!accounts.associatedTokenProgram.value) {\n accounts.associatedTokenProgram.value =\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\" as Address<\"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\">;\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n \"11111111111111111111111111111111\" as Address<\"11111111111111111111111111111111\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"juror\", accounts.juror),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"accordState\", accounts.accordState),\n getAccountMeta(\"jurorStake\", accounts.jurorStake),\n getAccountMeta(\"stakingToken\", accounts.stakingToken),\n getAccountMeta(\"jurorTokenAccount\", accounts.jurorTokenAccount),\n getAccountMeta(\"stakeVault\", accounts.stakeVault),\n getAccountMeta(\"tokenProgram\", accounts.tokenProgram),\n getAccountMeta(\"associatedTokenProgram\", accounts.associatedTokenProgram),\n getAccountMeta(\"systemProgram\", accounts.systemProgram),\n ],\n data: getStakeInstructionDataEncoder().encode(\n args as StakeInstructionDataArgs,\n ),\n programAddress,\n } as StakeInstruction<\n TProgramAddress,\n TAccountJuror,\n TAccountSubaccord,\n TAccountAccordState,\n TAccountJurorStake,\n TAccountStakingToken,\n TAccountJurorTokenAccount,\n TAccountStakeVault,\n TAccountTokenProgram,\n TAccountAssociatedTokenProgram,\n TAccountSystemProgram\n >);\n}\n\nexport type StakeInput<\n TAccountJuror extends string = string,\n TAccountSubaccord extends string = string,\n TAccountAccordState extends string = string,\n TAccountJurorStake extends string = string,\n TAccountStakingToken extends string = string,\n TAccountJurorTokenAccount extends string = string,\n TAccountStakeVault extends string = string,\n TAccountTokenProgram extends string = string,\n TAccountAssociatedTokenProgram extends string = string,\n TAccountSystemProgram extends string = string,\n> = {\n juror: TransactionSigner<TAccountJuror>;\n subaccord: Address<TAccountSubaccord>;\n /** Circuit breaker (ADR-0007): stake reverts while paused. */\n accordState: Address<TAccountAccordState>;\n jurorStake: Address<TAccountJurorStake>;\n /** Must be the Subaccord's declared staking token. */\n stakingToken: Address<TAccountStakingToken>;\n jurorTokenAccount: Address<TAccountJurorTokenAccount>;\n /** Subaccord PDA's stake_vault ATA; `authority` (wallet) is the Subaccord PDA. */\n stakeVault: Address<TAccountStakeVault>;\n tokenProgram?: Address<TAccountTokenProgram>;\n associatedTokenProgram?: Address<TAccountAssociatedTokenProgram>;\n systemProgram?: Address<TAccountSystemProgram>;\n amount: StakeInstructionDataArgs[\"amount\"];\n path: StakeInstructionDataArgs[\"path\"];\n};\n\nexport function getStakeInstruction<\n TAccountJuror extends string,\n TAccountSubaccord extends string,\n TAccountAccordState extends string,\n TAccountJurorStake extends string,\n TAccountStakingToken extends string,\n TAccountJurorTokenAccount extends string,\n TAccountStakeVault extends string,\n TAccountTokenProgram extends string,\n TAccountAssociatedTokenProgram extends string,\n TAccountSystemProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: StakeInput<\n TAccountJuror,\n TAccountSubaccord,\n TAccountAccordState,\n TAccountJurorStake,\n TAccountStakingToken,\n TAccountJurorTokenAccount,\n TAccountStakeVault,\n TAccountTokenProgram,\n TAccountAssociatedTokenProgram,\n TAccountSystemProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): StakeInstruction<\n TProgramAddress,\n TAccountJuror,\n TAccountSubaccord,\n TAccountAccordState,\n TAccountJurorStake,\n TAccountStakingToken,\n TAccountJurorTokenAccount,\n TAccountStakeVault,\n TAccountTokenProgram,\n TAccountAssociatedTokenProgram,\n TAccountSystemProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n juror: { value: input.juror ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n accordState: { value: input.accordState ?? null, isWritable: false },\n jurorStake: { value: input.jurorStake ?? null, isWritable: true },\n stakingToken: { value: input.stakingToken ?? null, isWritable: false },\n jurorTokenAccount: {\n value: input.jurorTokenAccount ?? null,\n isWritable: true,\n },\n stakeVault: { value: input.stakeVault ?? null, isWritable: true },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n associatedTokenProgram: {\n value: input.associatedTokenProgram ?? null,\n isWritable: false,\n },\n systemProgram: { value: input.systemProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Original args.\n const args = { ...input };\n\n // Resolve default values.\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\" as Address<\"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\">;\n }\n if (!accounts.associatedTokenProgram.value) {\n accounts.associatedTokenProgram.value =\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\" as Address<\"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\">;\n }\n if (!accounts.systemProgram.value) {\n accounts.systemProgram.value =\n \"11111111111111111111111111111111\" as Address<\"11111111111111111111111111111111\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"juror\", accounts.juror),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"accordState\", accounts.accordState),\n getAccountMeta(\"jurorStake\", accounts.jurorStake),\n getAccountMeta(\"stakingToken\", accounts.stakingToken),\n getAccountMeta(\"jurorTokenAccount\", accounts.jurorTokenAccount),\n getAccountMeta(\"stakeVault\", accounts.stakeVault),\n getAccountMeta(\"tokenProgram\", accounts.tokenProgram),\n getAccountMeta(\"associatedTokenProgram\", accounts.associatedTokenProgram),\n getAccountMeta(\"systemProgram\", accounts.systemProgram),\n ],\n data: getStakeInstructionDataEncoder().encode(\n args as StakeInstructionDataArgs,\n ),\n programAddress,\n } as StakeInstruction<\n TProgramAddress,\n TAccountJuror,\n TAccountSubaccord,\n TAccountAccordState,\n TAccountJurorStake,\n TAccountStakingToken,\n TAccountJurorTokenAccount,\n TAccountStakeVault,\n TAccountTokenProgram,\n TAccountAssociatedTokenProgram,\n TAccountSystemProgram\n >);\n}\n\nexport type ParsedStakeInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n juror: TAccountMetas[0];\n subaccord: TAccountMetas[1];\n /** Circuit breaker (ADR-0007): stake reverts while paused. */\n accordState: TAccountMetas[2];\n jurorStake: TAccountMetas[3];\n /** Must be the Subaccord's declared staking token. */\n stakingToken: TAccountMetas[4];\n jurorTokenAccount: TAccountMetas[5];\n /** Subaccord PDA's stake_vault ATA; `authority` (wallet) is the Subaccord PDA. */\n stakeVault: TAccountMetas[6];\n tokenProgram: TAccountMetas[7];\n associatedTokenProgram: TAccountMetas[8];\n systemProgram: TAccountMetas[9];\n };\n data: StakeInstructionData;\n};\n\nexport function parseStakeInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedStakeInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 10) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 10,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n juror: getNextAccount(),\n subaccord: getNextAccount(),\n accordState: getNextAccount(),\n jurorStake: getNextAccount(),\n stakingToken: getNextAccount(),\n jurorTokenAccount: getNextAccount(),\n stakeVault: getNextAccount(),\n tokenProgram: getNextAccount(),\n associatedTokenProgram: getNextAccount(),\n systemProgram: getNextAccount(),\n },\n data: getStakeInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getAddressEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n getAddressFromResolvedInstructionAccount,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { findJurorStakePda } from \"../pdas\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\n\nexport const WITHDRAW_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 183, 18, 70, 156, 148, 109, 161, 34,\n]);\n\nexport function getWithdrawDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(WITHDRAW_DISCRIMINATOR);\n}\n\nexport type WithdrawInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountJuror extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountJurorStake extends string | AccountMeta<string> = string,\n TAccountStakingToken extends string | AccountMeta<string> = string,\n TAccountJurorTokenAccount extends string | AccountMeta<string> = string,\n TAccountStakeVault extends string | AccountMeta<string> = string,\n TAccountTokenProgram extends string | AccountMeta<string> =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\",\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountJuror extends string\n ? WritableSignerAccount<TAccountJuror> &\n AccountSignerMeta<TAccountJuror>\n : TAccountJuror,\n TAccountSubaccord extends string\n ? WritableAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountJurorStake extends string\n ? WritableAccount<TAccountJurorStake>\n : TAccountJurorStake,\n TAccountStakingToken extends string\n ? ReadonlyAccount<TAccountStakingToken>\n : TAccountStakingToken,\n TAccountJurorTokenAccount extends string\n ? WritableAccount<TAccountJurorTokenAccount>\n : TAccountJurorTokenAccount,\n TAccountStakeVault extends string\n ? WritableAccount<TAccountStakeVault>\n : TAccountStakeVault,\n TAccountTokenProgram extends string\n ? ReadonlyAccount<TAccountTokenProgram>\n : TAccountTokenProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type WithdrawInstructionData = { discriminator: ReadonlyUint8Array };\n\nexport type WithdrawInstructionDataArgs = {};\n\nexport function getWithdrawInstructionDataEncoder(): FixedSizeEncoder<WithdrawInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([[\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)]]),\n (value) => ({ ...value, discriminator: WITHDRAW_DISCRIMINATOR }),\n );\n}\n\nexport function getWithdrawInstructionDataDecoder(): FixedSizeDecoder<WithdrawInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n ]);\n}\n\nexport function getWithdrawInstructionDataCodec(): FixedSizeCodec<\n WithdrawInstructionDataArgs,\n WithdrawInstructionData\n> {\n return combineCodec(\n getWithdrawInstructionDataEncoder(),\n getWithdrawInstructionDataDecoder(),\n );\n}\n\nexport type WithdrawAsyncInput<\n TAccountJuror extends string = string,\n TAccountSubaccord extends string = string,\n TAccountJurorStake extends string = string,\n TAccountStakingToken extends string = string,\n TAccountJurorTokenAccount extends string = string,\n TAccountStakeVault extends string = string,\n TAccountTokenProgram extends string = string,\n> = {\n juror: TransactionSigner<TAccountJuror>;\n subaccord: Address<TAccountSubaccord>;\n jurorStake?: Address<TAccountJurorStake>;\n stakingToken: Address<TAccountStakingToken>;\n jurorTokenAccount?: Address<TAccountJurorTokenAccount>;\n stakeVault?: Address<TAccountStakeVault>;\n tokenProgram?: Address<TAccountTokenProgram>;\n};\n\nexport async function getWithdrawInstructionAsync<\n TAccountJuror extends string,\n TAccountSubaccord extends string,\n TAccountJurorStake extends string,\n TAccountStakingToken extends string,\n TAccountJurorTokenAccount extends string,\n TAccountStakeVault extends string,\n TAccountTokenProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: WithdrawAsyncInput<\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake,\n TAccountStakingToken,\n TAccountJurorTokenAccount,\n TAccountStakeVault,\n TAccountTokenProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n WithdrawInstruction<\n TProgramAddress,\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake,\n TAccountStakingToken,\n TAccountJurorTokenAccount,\n TAccountStakeVault,\n TAccountTokenProgram\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n juror: { value: input.juror ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n jurorStake: { value: input.jurorStake ?? null, isWritable: true },\n stakingToken: { value: input.stakingToken ?? null, isWritable: false },\n jurorTokenAccount: {\n value: input.jurorTokenAccount ?? null,\n isWritable: true,\n },\n stakeVault: { value: input.stakeVault ?? null, isWritable: true },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Resolve default values.\n if (!accounts.jurorStake.value) {\n accounts.jurorStake.value = await findJurorStakePda({\n subaccord: getAddressFromResolvedInstructionAccount(\n \"subaccord\",\n accounts.subaccord.value,\n ),\n juror: getAddressFromResolvedInstructionAccount(\n \"juror\",\n accounts.juror.value,\n ),\n });\n }\n if (!accounts.jurorTokenAccount.value) {\n accounts.jurorTokenAccount.value = await getProgramDerivedAddress({\n programAddress:\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\" as Address<\"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\">,\n seeds: [\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"juror\",\n accounts.juror.value,\n ),\n ),\n getBytesEncoder().encode(\n new Uint8Array([\n 6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206, 235,\n 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140, 245, 133,\n 126, 255, 0, 169,\n ]),\n ),\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"stakingToken\",\n accounts.stakingToken.value,\n ),\n ),\n ],\n });\n }\n if (!accounts.stakeVault.value) {\n accounts.stakeVault.value = await getProgramDerivedAddress({\n programAddress:\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\" as Address<\"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\">,\n seeds: [\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"subaccord\",\n accounts.subaccord.value,\n ),\n ),\n getBytesEncoder().encode(\n new Uint8Array([\n 6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206, 235,\n 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140, 245, 133,\n 126, 255, 0, 169,\n ]),\n ),\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"stakingToken\",\n accounts.stakingToken.value,\n ),\n ),\n ],\n });\n }\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\" as Address<\"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"juror\", accounts.juror),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"jurorStake\", accounts.jurorStake),\n getAccountMeta(\"stakingToken\", accounts.stakingToken),\n getAccountMeta(\"jurorTokenAccount\", accounts.jurorTokenAccount),\n getAccountMeta(\"stakeVault\", accounts.stakeVault),\n getAccountMeta(\"tokenProgram\", accounts.tokenProgram),\n ],\n data: getWithdrawInstructionDataEncoder().encode({}),\n programAddress,\n } as WithdrawInstruction<\n TProgramAddress,\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake,\n TAccountStakingToken,\n TAccountJurorTokenAccount,\n TAccountStakeVault,\n TAccountTokenProgram\n >);\n}\n\nexport type WithdrawInput<\n TAccountJuror extends string = string,\n TAccountSubaccord extends string = string,\n TAccountJurorStake extends string = string,\n TAccountStakingToken extends string = string,\n TAccountJurorTokenAccount extends string = string,\n TAccountStakeVault extends string = string,\n TAccountTokenProgram extends string = string,\n> = {\n juror: TransactionSigner<TAccountJuror>;\n subaccord: Address<TAccountSubaccord>;\n jurorStake: Address<TAccountJurorStake>;\n stakingToken: Address<TAccountStakingToken>;\n jurorTokenAccount: Address<TAccountJurorTokenAccount>;\n stakeVault: Address<TAccountStakeVault>;\n tokenProgram?: Address<TAccountTokenProgram>;\n};\n\nexport function getWithdrawInstruction<\n TAccountJuror extends string,\n TAccountSubaccord extends string,\n TAccountJurorStake extends string,\n TAccountStakingToken extends string,\n TAccountJurorTokenAccount extends string,\n TAccountStakeVault extends string,\n TAccountTokenProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: WithdrawInput<\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake,\n TAccountStakingToken,\n TAccountJurorTokenAccount,\n TAccountStakeVault,\n TAccountTokenProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): WithdrawInstruction<\n TProgramAddress,\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake,\n TAccountStakingToken,\n TAccountJurorTokenAccount,\n TAccountStakeVault,\n TAccountTokenProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n juror: { value: input.juror ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n jurorStake: { value: input.jurorStake ?? null, isWritable: true },\n stakingToken: { value: input.stakingToken ?? null, isWritable: false },\n jurorTokenAccount: {\n value: input.jurorTokenAccount ?? null,\n isWritable: true,\n },\n stakeVault: { value: input.stakeVault ?? null, isWritable: true },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Resolve default values.\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\" as Address<\"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"juror\", accounts.juror),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"jurorStake\", accounts.jurorStake),\n getAccountMeta(\"stakingToken\", accounts.stakingToken),\n getAccountMeta(\"jurorTokenAccount\", accounts.jurorTokenAccount),\n getAccountMeta(\"stakeVault\", accounts.stakeVault),\n getAccountMeta(\"tokenProgram\", accounts.tokenProgram),\n ],\n data: getWithdrawInstructionDataEncoder().encode({}),\n programAddress,\n } as WithdrawInstruction<\n TProgramAddress,\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake,\n TAccountStakingToken,\n TAccountJurorTokenAccount,\n TAccountStakeVault,\n TAccountTokenProgram\n >);\n}\n\nexport type ParsedWithdrawInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n juror: TAccountMetas[0];\n subaccord: TAccountMetas[1];\n jurorStake: TAccountMetas[2];\n stakingToken: TAccountMetas[3];\n jurorTokenAccount: TAccountMetas[4];\n stakeVault: TAccountMetas[5];\n tokenProgram: TAccountMetas[6];\n };\n data: WithdrawInstructionData;\n};\n\nexport function parseWithdrawInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedWithdrawInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 7) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 7,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n juror: getNextAccount(),\n subaccord: getNextAccount(),\n jurorStake: getNextAccount(),\n stakingToken: getNextAccount(),\n jurorTokenAccount: getNextAccount(),\n stakeVault: getNextAccount(),\n tokenProgram: getNextAccount(),\n },\n data: getWithdrawInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport {\n combineCodec,\n fixDecoderSize,\n fixEncoderSize,\n getAddressEncoder,\n getBytesDecoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n getStructDecoder,\n getStructEncoder,\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n SolanaError,\n transformEncoder,\n type AccountMeta,\n type AccountSignerMeta,\n type Address,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n type Instruction,\n type InstructionWithAccounts,\n type InstructionWithData,\n type ReadonlyAccount,\n type ReadonlyUint8Array,\n type TransactionSigner,\n type WritableAccount,\n type WritableSignerAccount,\n} from \"@solana/kit\";\nimport {\n getAccountMetaFactory,\n getAddressFromResolvedInstructionAccount,\n type ResolvedInstructionAccount,\n} from \"@solana/kit/program-client-core\";\nimport { findJurorStakePda } from \"../pdas\";\nimport { ACCORD_PROGRAM_ADDRESS } from \"../programs\";\n\nexport const WITHDRAW_FEES_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([\n 198, 212, 171, 109, 144, 215, 174, 89,\n]);\n\nexport function getWithdrawFeesDiscriminatorBytes(): ReadonlyUint8Array {\n return fixEncoderSize(getBytesEncoder(), 8).encode(\n WITHDRAW_FEES_DISCRIMINATOR,\n );\n}\n\nexport type WithdrawFeesInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountJuror extends string | AccountMeta<string> = string,\n TAccountSubaccord extends string | AccountMeta<string> = string,\n TAccountJurorStake extends string | AccountMeta<string> = string,\n TAccountFeeToken extends string | AccountMeta<string> = string,\n TAccountJurorFeeTokenAccount extends string | AccountMeta<string> = string,\n TAccountFeeVault extends string | AccountMeta<string> = string,\n TAccountTokenProgram extends string | AccountMeta<string> =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\",\n TRemainingAccounts extends readonly AccountMeta<string>[] = [],\n> = Instruction<TProgram> &\n InstructionWithData<ReadonlyUint8Array> &\n InstructionWithAccounts<\n [\n TAccountJuror extends string\n ? WritableSignerAccount<TAccountJuror> &\n AccountSignerMeta<TAccountJuror>\n : TAccountJuror,\n TAccountSubaccord extends string\n ? WritableAccount<TAccountSubaccord>\n : TAccountSubaccord,\n TAccountJurorStake extends string\n ? WritableAccount<TAccountJurorStake>\n : TAccountJurorStake,\n TAccountFeeToken extends string\n ? ReadonlyAccount<TAccountFeeToken>\n : TAccountFeeToken,\n TAccountJurorFeeTokenAccount extends string\n ? WritableAccount<TAccountJurorFeeTokenAccount>\n : TAccountJurorFeeTokenAccount,\n TAccountFeeVault extends string\n ? WritableAccount<TAccountFeeVault>\n : TAccountFeeVault,\n TAccountTokenProgram extends string\n ? ReadonlyAccount<TAccountTokenProgram>\n : TAccountTokenProgram,\n ...TRemainingAccounts,\n ]\n >;\n\nexport type WithdrawFeesInstructionData = { discriminator: ReadonlyUint8Array };\n\nexport type WithdrawFeesInstructionDataArgs = {};\n\nexport function getWithdrawFeesInstructionDataEncoder(): FixedSizeEncoder<WithdrawFeesInstructionDataArgs> {\n return transformEncoder(\n getStructEncoder([[\"discriminator\", fixEncoderSize(getBytesEncoder(), 8)]]),\n (value) => ({ ...value, discriminator: WITHDRAW_FEES_DISCRIMINATOR }),\n );\n}\n\nexport function getWithdrawFeesInstructionDataDecoder(): FixedSizeDecoder<WithdrawFeesInstructionData> {\n return getStructDecoder([\n [\"discriminator\", fixDecoderSize(getBytesDecoder(), 8)],\n ]);\n}\n\nexport function getWithdrawFeesInstructionDataCodec(): FixedSizeCodec<\n WithdrawFeesInstructionDataArgs,\n WithdrawFeesInstructionData\n> {\n return combineCodec(\n getWithdrawFeesInstructionDataEncoder(),\n getWithdrawFeesInstructionDataDecoder(),\n );\n}\n\nexport type WithdrawFeesAsyncInput<\n TAccountJuror extends string = string,\n TAccountSubaccord extends string = string,\n TAccountJurorStake extends string = string,\n TAccountFeeToken extends string = string,\n TAccountJurorFeeTokenAccount extends string = string,\n TAccountFeeVault extends string = string,\n TAccountTokenProgram extends string = string,\n> = {\n juror: TransactionSigner<TAccountJuror>;\n subaccord: Address<TAccountSubaccord>;\n jurorStake?: Address<TAccountJurorStake>;\n feeToken: Address<TAccountFeeToken>;\n jurorFeeTokenAccount?: Address<TAccountJurorFeeTokenAccount>;\n feeVault?: Address<TAccountFeeVault>;\n tokenProgram?: Address<TAccountTokenProgram>;\n};\n\nexport async function getWithdrawFeesInstructionAsync<\n TAccountJuror extends string,\n TAccountSubaccord extends string,\n TAccountJurorStake extends string,\n TAccountFeeToken extends string,\n TAccountJurorFeeTokenAccount extends string,\n TAccountFeeVault extends string,\n TAccountTokenProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: WithdrawFeesAsyncInput<\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake,\n TAccountFeeToken,\n TAccountJurorFeeTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): Promise<\n WithdrawFeesInstruction<\n TProgramAddress,\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake,\n TAccountFeeToken,\n TAccountJurorFeeTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n >\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n juror: { value: input.juror ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n jurorStake: { value: input.jurorStake ?? null, isWritable: true },\n feeToken: { value: input.feeToken ?? null, isWritable: false },\n jurorFeeTokenAccount: {\n value: input.jurorFeeTokenAccount ?? null,\n isWritable: true,\n },\n feeVault: { value: input.feeVault ?? null, isWritable: true },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Resolve default values.\n if (!accounts.jurorStake.value) {\n accounts.jurorStake.value = await findJurorStakePda({\n subaccord: getAddressFromResolvedInstructionAccount(\n \"subaccord\",\n accounts.subaccord.value,\n ),\n juror: getAddressFromResolvedInstructionAccount(\n \"juror\",\n accounts.juror.value,\n ),\n });\n }\n if (!accounts.jurorFeeTokenAccount.value) {\n accounts.jurorFeeTokenAccount.value = await getProgramDerivedAddress({\n programAddress:\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\" as Address<\"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\">,\n seeds: [\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"juror\",\n accounts.juror.value,\n ),\n ),\n getBytesEncoder().encode(\n new Uint8Array([\n 6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206, 235,\n 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140, 245, 133,\n 126, 255, 0, 169,\n ]),\n ),\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"feeToken\",\n accounts.feeToken.value,\n ),\n ),\n ],\n });\n }\n if (!accounts.feeVault.value) {\n accounts.feeVault.value = await getProgramDerivedAddress({\n programAddress:\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\" as Address<\"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\">,\n seeds: [\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"subaccord\",\n accounts.subaccord.value,\n ),\n ),\n getBytesEncoder().encode(\n new Uint8Array([\n 6, 221, 246, 225, 215, 101, 161, 147, 217, 203, 225, 70, 206, 235,\n 121, 172, 28, 180, 133, 237, 95, 91, 55, 145, 58, 140, 245, 133,\n 126, 255, 0, 169,\n ]),\n ),\n getAddressEncoder().encode(\n getAddressFromResolvedInstructionAccount(\n \"feeToken\",\n accounts.feeToken.value,\n ),\n ),\n ],\n });\n }\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\" as Address<\"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"juror\", accounts.juror),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"jurorStake\", accounts.jurorStake),\n getAccountMeta(\"feeToken\", accounts.feeToken),\n getAccountMeta(\"jurorFeeTokenAccount\", accounts.jurorFeeTokenAccount),\n getAccountMeta(\"feeVault\", accounts.feeVault),\n getAccountMeta(\"tokenProgram\", accounts.tokenProgram),\n ],\n data: getWithdrawFeesInstructionDataEncoder().encode({}),\n programAddress,\n } as WithdrawFeesInstruction<\n TProgramAddress,\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake,\n TAccountFeeToken,\n TAccountJurorFeeTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n >);\n}\n\nexport type WithdrawFeesInput<\n TAccountJuror extends string = string,\n TAccountSubaccord extends string = string,\n TAccountJurorStake extends string = string,\n TAccountFeeToken extends string = string,\n TAccountJurorFeeTokenAccount extends string = string,\n TAccountFeeVault extends string = string,\n TAccountTokenProgram extends string = string,\n> = {\n juror: TransactionSigner<TAccountJuror>;\n subaccord: Address<TAccountSubaccord>;\n jurorStake: Address<TAccountJurorStake>;\n feeToken: Address<TAccountFeeToken>;\n jurorFeeTokenAccount: Address<TAccountJurorFeeTokenAccount>;\n feeVault: Address<TAccountFeeVault>;\n tokenProgram?: Address<TAccountTokenProgram>;\n};\n\nexport function getWithdrawFeesInstruction<\n TAccountJuror extends string,\n TAccountSubaccord extends string,\n TAccountJurorStake extends string,\n TAccountFeeToken extends string,\n TAccountJurorFeeTokenAccount extends string,\n TAccountFeeVault extends string,\n TAccountTokenProgram extends string,\n TProgramAddress extends Address = typeof ACCORD_PROGRAM_ADDRESS,\n>(\n input: WithdrawFeesInput<\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake,\n TAccountFeeToken,\n TAccountJurorFeeTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n >,\n config?: { programAddress?: TProgramAddress },\n): WithdrawFeesInstruction<\n TProgramAddress,\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake,\n TAccountFeeToken,\n TAccountJurorFeeTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n> {\n // Program address.\n const programAddress = config?.programAddress ?? ACCORD_PROGRAM_ADDRESS;\n\n // Original accounts.\n const originalAccounts = {\n juror: { value: input.juror ?? null, isWritable: true },\n subaccord: { value: input.subaccord ?? null, isWritable: true },\n jurorStake: { value: input.jurorStake ?? null, isWritable: true },\n feeToken: { value: input.feeToken ?? null, isWritable: false },\n jurorFeeTokenAccount: {\n value: input.jurorFeeTokenAccount ?? null,\n isWritable: true,\n },\n feeVault: { value: input.feeVault ?? null, isWritable: true },\n tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },\n };\n const accounts = originalAccounts as Record<\n keyof typeof originalAccounts,\n ResolvedInstructionAccount\n >;\n\n // Resolve default values.\n if (!accounts.tokenProgram.value) {\n accounts.tokenProgram.value =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\" as Address<\"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\">;\n }\n\n const getAccountMeta = getAccountMetaFactory(programAddress, \"programId\");\n return Object.freeze({\n accounts: [\n getAccountMeta(\"juror\", accounts.juror),\n getAccountMeta(\"subaccord\", accounts.subaccord),\n getAccountMeta(\"jurorStake\", accounts.jurorStake),\n getAccountMeta(\"feeToken\", accounts.feeToken),\n getAccountMeta(\"jurorFeeTokenAccount\", accounts.jurorFeeTokenAccount),\n getAccountMeta(\"feeVault\", accounts.feeVault),\n getAccountMeta(\"tokenProgram\", accounts.tokenProgram),\n ],\n data: getWithdrawFeesInstructionDataEncoder().encode({}),\n programAddress,\n } as WithdrawFeesInstruction<\n TProgramAddress,\n TAccountJuror,\n TAccountSubaccord,\n TAccountJurorStake,\n TAccountFeeToken,\n TAccountJurorFeeTokenAccount,\n TAccountFeeVault,\n TAccountTokenProgram\n >);\n}\n\nexport type ParsedWithdrawFeesInstruction<\n TProgram extends string = typeof ACCORD_PROGRAM_ADDRESS,\n TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],\n> = {\n programAddress: Address<TProgram>;\n accounts: {\n juror: TAccountMetas[0];\n subaccord: TAccountMetas[1];\n jurorStake: TAccountMetas[2];\n feeToken: TAccountMetas[3];\n jurorFeeTokenAccount: TAccountMetas[4];\n feeVault: TAccountMetas[5];\n tokenProgram: TAccountMetas[6];\n };\n data: WithdrawFeesInstructionData;\n};\n\nexport function parseWithdrawFeesInstruction<\n TProgram extends string,\n TAccountMetas extends readonly AccountMeta[],\n>(\n instruction: Instruction<TProgram> &\n InstructionWithAccounts<TAccountMetas> &\n InstructionWithData<ReadonlyUint8Array>,\n): ParsedWithdrawFeesInstruction<TProgram, TAccountMetas> {\n if (instruction.accounts.length < 7) {\n throw new SolanaError(\n SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,\n {\n actualAccountMetas: instruction.accounts.length,\n expectedAccountMetas: 7,\n },\n );\n }\n let accountIndex = 0;\n const getNextAccount = () => {\n const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;\n accountIndex += 1;\n return accountMeta;\n };\n return {\n programAddress: instruction.programAddress,\n accounts: {\n juror: getNextAccount(),\n subaccord: getNextAccount(),\n jurorStake: getNextAccount(),\n feeToken: getNextAccount(),\n jurorFeeTokenAccount: getNextAccount(),\n feeVault: getNextAccount(),\n tokenProgram: getNextAccount(),\n },\n data: getWithdrawFeesInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * Canonical PDA derivations for every Accord account.\n *\n * Seeds sourced from `programs/accord/src/state.rs` + `constants.rs`:\n * SEED_SUBACCORD = \"subaccord\" SEED_DISPUTE = \"dispute\"\n * SEED_JUROR_STAKE = \"stake\" SEED_ROUND = \"round\"\n * SEED_PENDING_UPDATE = \"update\" SEED_APPEAL_BOND = \"bond\"\n * SEED_ACCORD_STATE = \"state\"\n *\n * Five of seven PDAs are emitted by Codama into `./generated/pdas/` and\n * re-exported here unchanged. `Round` is hand-written because its on-chain seeds\n * reference `dispute.key()` (a runtime address, not a static field) — Codama\n * cannot encode that statically, so it omits it.\n *\n * ADR-0012: the `Snapshot` PDA is gone (snapshot layer deleted).\n *\n * Every function returns `ProgramDerivedAddress` = `{ address: Address; bump: number }`.\n *\n * @see ADR-0010\n */\n\nimport {\n getAddressEncoder,\n getBytesEncoder,\n getProgramDerivedAddress,\n getU32Encoder,\n type Address,\n type ProgramDerivedAddress,\n} from \"@solana/kit\";\n\n// --- Program identity -------------------------------------------------------\n\nexport const ACCORD_PROGRAM_ID =\n \"cordhVoshqRV6kzGBmM89A66wuusJGsDCvLMHPLyKed\" as Address<\"cordhVoshqRV6kzGBmM89A66wuusJGsDCvLMHPLyKed\">;\n\n// --- Re-exported generated PDA helpers (5/7) ---------------------------------\n\nexport {\n findAppealBondPda,\n type AppealBondSeeds,\n} from \"./generated/pdas/appealBond\";\nexport { findDisputePda, type DisputeSeeds } from \"./generated/pdas/dispute\";\nexport {\n findJurorStakePda,\n type JurorStakeSeeds,\n} from \"./generated/pdas/jurorStake\";\nexport { findAccordStatePda } from \"./generated/pdas/accordState\";\nexport {\n findPendingUpdatePda,\n type PendingUpdateSeeds,\n} from \"./generated/pdas/pendingUpdate\";\nexport {\n findSubaccordPda,\n type SubaccordSeeds,\n} from \"./generated/pdas/subaccord\";\nexport {\n findProgramIdentityPda,\n} from \"./generated/pdas/programIdentity\";\n\n// --- Hand-written PDA helper (1/7) ------------------------------------------\n// Round: seeds use `dispute.key()` (the account address), which Codama can't\n// statically encode. Same encoding pattern as AppealBond:\n// [seed_bytes, dispute_address, u32_le(round_idx)].\n\nconst ROUND_SEED = new Uint8Array([114, 111, 117, 110, 100]); // b\"round\"\n\nexport type RoundSeeds = {\n dispute: Address;\n roundIdx: number;\n};\n\nexport async function findRoundPda(\n seeds: RoundSeeds,\n config: { programAddress?: Address } = {},\n): Promise<ProgramDerivedAddress> {\n const { programAddress = ACCORD_PROGRAM_ID } = config;\n return await getProgramDerivedAddress({\n programAddress,\n seeds: [\n getBytesEncoder().encode(ROUND_SEED),\n getAddressEncoder().encode(seeds.dispute),\n getU32Encoder().encode(seeds.roundIdx),\n ],\n });\n}\n","/**\n * Concrete adapter — wires every `Accord*Client` seam (declared by the\n * `src/methods/*.ts` modules) to the Codama-generated Solana Kit client.\n *\n * The method modules stay pure orchestration over typed seams; this module is\n * the single implementor the {@link Accord} facade binds. Each seam method maps\n * 1:1 to a generated `getXxxInstruction` builder (sync, all-explicit accounts)\n * or to a generated account fetcher, so a drift in the IDL surfaces here as a\n * compile error — exactly the ADR-0010 guarantee.\n *\n * ADR-0012: the snapshot trio (post/challenge/finalize) and the one-shot `draw`\n * are gone; `stake`/`unstake` thread an accumulator `path`; `draw_seat` fills\n * the panel one seat per tx against `dispute.frozen_root`; `commit_vrf_callback`\n * (invoked by the oracle) freezes the root.\n *\n * Signing model: the facade's loaded wallet (`accord.signer`) is the\n * `TransactionSigner` for every instruction's signing account.\n *\n * @see ADR-0010, ADR-0012\n */\n\nimport {\n AccountRole,\n getAddressDecoder,\n getAddressEncoder,\n type AccountMeta,\n type Address,\n type Instruction,\n} from \"@solana/kit\";\n\nimport type { Accord } from \"./accord.js\";\n\nimport {\n getCreateDisputeInstruction,\n type CreateDisputeInstructionDataArgs,\n} from \"./generated/instructions/createDispute.js\";\nimport { getCreateSubaccordInstruction } from \"./generated/instructions/createSubaccord.js\";\nimport { getProposeSubaccordUpdateInstruction } from \"./generated/instructions/proposeSubaccordUpdate.js\";\nimport { getExecuteSubaccordUpdateInstruction } from \"./generated/instructions/executeSubaccordUpdate.js\";\nimport { getInitializePauseInstruction } from \"./generated/instructions/initializePause.js\";\nimport { getPauseInstruction } from \"./generated/instructions/pause.js\";\nimport { getProposeUnpauseInstruction } from \"./generated/instructions/proposeUnpause.js\";\nimport { getExecuteUnpauseInstruction } from \"./generated/instructions/executeUnpause.js\";\nimport { getStakeInstruction } from \"./generated/instructions/stake.js\";\nimport { getRequestWithdrawInstruction } from \"./generated/instructions/requestWithdraw.js\";\nimport { getWithdrawInstruction } from \"./generated/instructions/withdraw.js\";\nimport { getReconcileStakeInstruction } from \"./generated/instructions/reconcileStake.js\";\nimport { getReclaimSlotInstruction } from \"./generated/instructions/reclaimSlot.js\";\nimport { getWithdrawFeesInstruction } from \"./generated/instructions/withdrawFees.js\";\nimport { getSettleRoundInstruction } from \"./generated/instructions/settleRound.js\";\nimport { getCancelDisputeInstruction } from \"./generated/instructions/cancelDispute.js\";\nimport { getRequestVrfInstruction } from \"./generated/instructions/requestVrf.js\";\nimport { getDrawSeatInstruction } from \"./generated/instructions/drawSeat.js\";\nimport { getCommitInstruction } from \"./generated/instructions/commit.js\";\nimport { getRevealInstruction } from \"./generated/instructions/reveal.js\";\nimport { getFinalizeRoundInstruction } from \"./generated/instructions/finalizeRound.js\";\nimport { getFinalizeDisputeInstruction } from \"./generated/instructions/finalizeDispute.js\";\nimport { getRedrawInstruction } from \"./generated/instructions/redraw.js\";\nimport { getAppealInstruction } from \"./generated/instructions/appeal.js\";\nimport { getClaimAppealRefundInstruction } from \"./generated/instructions/claimAppealRefund.js\";\nimport { getClaimFilingBountyInstruction } from \"./generated/instructions/claimFilingBounty.js\";\nimport { getPruneJurorInstruction } from \"./generated/instructions/pruneJuror.js\";\n\nimport type {\n AccordAppealClient,\n AppealAccounts,\n ClaimRefundAccounts,\n} from \"./methods/appeal.js\";\nimport { NO_RULING } from \"./methods/dispute.js\";\nimport type {\n AccordDisputeClient,\n CreateDisputeAccounts,\n CreateDisputeArgs,\n DisputeRulingView,\n} from \"./methods/dispute.js\";\nimport type {\n AccordLifecycleClient,\n CreateSubaccordArgs,\n} from \"./methods/lifecycle.js\";\nimport type {\n AccordStakingClient,\n JurorStakeView,\n StakingAccounts,\n WithdrawFeesAccounts,\n} from \"./methods/staking.js\";\nimport type {\n AccordSettlementClient,\n CancelDisputeAccounts,\n SettleRoundAccounts,\n} from \"./methods/settlement.js\";\nimport type { MSTNode } from \"./methods/mst.js\";\nimport type { AccordVotingClient, VotingAccounts } from \"./methods/voting.js\";\nimport type {\n AccordVrfClient,\n SeatMembership,\n VrfDrawAccounts,\n} from \"./methods/vrf.js\";\n\n/** Union of every seam the adapter implements. */\nexport interface AccordAdapter\n extends\n AccordDisputeClient,\n AccordLifecycleClient,\n AccordStakingClient,\n AccordSettlementClient,\n AccordVrfClient,\n AccordVotingClient,\n AccordAppealClient {}\n\n/**\n * Build the concrete adapter bound to an {@link Accord} facade instance. The\n * returned object satisfies all six `Accord*Client` seams, so the pure\n * orchestration functions in `src/methods/*.ts` can drive the chain end-to-end.\n */\nexport function createAccordAdapter(accord: Accord): AccordAdapter {\n return {\n // ── dispute (Arbitrable CPI API) ────────────────────────────────────────\n buildCreateDispute(input) {\n const { accounts, args } = input;\n return getCreateDisputeInstruction(\n {\n filer: accord.signer,\n // Data-free rent payer (create_dispute.rs): the facade pins it to\n // its wallet signer, same as filer — wallet filers pay their own\n // rent; PDA filers CPI from their program with a crank caller.\n rentPayer: accord.signer,\n subaccord: accounts.subaccord,\n accordState: accounts.accordState,\n dispute: input.disputePda,\n feeToken: accounts.feeToken,\n filerTokenAccount: accounts.filerTokenAccount,\n feeVault: accounts.feeVault,\n options: args.options as CreateDisputeInstructionDataArgs[\"options\"],\n evidenceHash: args.evidenceHash,\n nonce: args.nonce,\n fee: args.fee,\n },\n { programAddress: input.programId },\n );\n },\n async fetchDispute(address): Promise<DisputeRulingView | null> {\n const m = await accord.client.accord.accounts.dispute.fetchMaybe(address);\n if (!m.exists) return null;\n const fr = m.data.finalRuling; // u64; u64::MAX sentinel = no ruling yet (ADR-0025)\n return { finalRuling: fr === NO_RULING ? null : fr };\n },\n\n // ── lifecycle (Subaccord + circuit breaker) ────────────────────────────\n buildCreateSubaccord(input) {\n return getCreateSubaccordInstruction(\n {\n creator: accord.signer,\n subaccord: input.subaccordPda,\n stakingToken: input.args.stakingToken,\n feeToken: input.args.feeToken,\n ...mapCreateSubaccordArgs(input.args),\n },\n { programAddress: input.programId },\n );\n },\n buildProposeSubaccordUpdate(input) {\n return getProposeSubaccordUpdateInstruction(\n {\n authority: accord.signer,\n // Data-free rent payer (propose_subaccord_update.rs, ADR-0028): the\n // facade pins it to its wallet signer, same as the authority —\n // wallet authorities pay their own rent; PDA authorities (e.g.\n // Canon's list PDA) CPI from their program with a crank caller.\n rentPayer: accord.signer,\n subaccord: input.subaccord,\n pendingUpdate: input.pendingUpdatePda,\n nonce: input.nonce,\n payload: input.payload,\n },\n { programAddress: input.programId },\n );\n },\n buildExecuteSubaccordUpdate(input) {\n return getExecuteSubaccordUpdateInstruction(\n {\n caller: accord.signer,\n subaccord: input.subaccord,\n pendingUpdate: input.pendingUpdate,\n },\n { programAddress: input.programId },\n );\n },\n buildInitializePause(input) {\n return getInitializePauseInstruction(\n {\n authority: accord.signer,\n accordState: input.accordStatePda,\n },\n { programAddress: input.programId },\n );\n },\n buildPause(input) {\n return getPauseInstruction(\n { authority: accord.signer, accordState: input.accordState },\n { programAddress: input.programId },\n );\n },\n buildProposeUnpause(input) {\n return getProposeUnpauseInstruction(\n { authority: accord.signer, accordState: input.accordState },\n { programAddress: input.programId },\n );\n },\n buildExecuteUnpause(input) {\n return getExecuteUnpauseInstruction(\n { caller: accord.signer, accordState: input.accordState },\n { programAddress: input.programId },\n );\n },\n async fetchPendingUpdateExecuteAfter(\n pendingUpdate,\n ): Promise<bigint | null> {\n const m =\n await accord.client.accord.accounts.pendingUpdate.fetchMaybe(\n pendingUpdate,\n );\n if (!m.exists) return null;\n return m.data.executeAfterSlot;\n },\n\n // ── staking (ADR-0012: path-verified accumulator update) ───────────────\n buildStake(input) {\n if (!input.accounts.accordState) {\n throw new Error(\n \"StakePausedStateMissing: stake requires the accordState PDA\",\n );\n }\n const ix = getStakeInstruction(\n {\n juror: accord.signer,\n subaccord: input.accounts.subaccord,\n accordState: input.accounts.accordState,\n jurorStake: input.accounts.jurorStake,\n stakingToken: input.accounts.stakingToken,\n jurorTokenAccount: input.accounts.jurorTokenAccount,\n stakeVault: input.accounts.stakeVault,\n amount: input.amount,\n path: mapPath(input.path),\n },\n { programAddress: input.programId },\n );\n // PROG-ATTESTATION: credential-gated Subaccords require the juror's SAS\n // attestation as remaining_accounts[0] (read-only). Omitted on stake-only\n // Subaccords — the on-chain gate no-ops.\n return input.attestation\n ? appendRemaining(ix, [{ address: input.attestation, isWritable: false }])\n : ix;\n },\n buildRequestWithdraw(input) {\n return getRequestWithdrawInstruction(\n {\n juror: accord.signer,\n subaccord: input.accounts.subaccord,\n jurorStake: input.accounts.jurorStake,\n amount: input.amount,\n path: mapPath(input.path),\n },\n { programAddress: input.programId },\n );\n },\n buildWithdraw(input) {\n const a = input.accounts;\n if (!a.stakingToken || !a.jurorTokenAccount || !a.stakeVault) {\n throw new Error(\n \"InvalidWithdrawAccounts: withdraw requires stakingToken, jurorTokenAccount, stakeVault\",\n );\n }\n return getWithdrawInstruction(\n {\n juror: accord.signer,\n subaccord: a.subaccord,\n jurorStake: a.jurorStake,\n stakingToken: a.stakingToken,\n jurorTokenAccount: a.jurorTokenAccount,\n stakeVault: a.stakeVault,\n },\n { programAddress: input.programId },\n );\n },\n buildReconcileStake(input) {\n return getReconcileStakeInstruction(\n {\n caller: accord.signer,\n subaccord: input.accounts.subaccord,\n jurorStake: input.accounts.jurorStake,\n path: mapPath(input.path),\n },\n { programAddress: input.programId },\n );\n },\n buildReclaimSlot(input) {\n return getReclaimSlotInstruction(\n {\n caller: accord.signer,\n subaccord: input.accounts.subaccord,\n jurorStake: input.accounts.jurorStake,\n path: mapPath(input.path),\n },\n { programAddress: input.programId },\n );\n },\n async fetchJurorStake(jurorStake): Promise<JurorStakeView | null> {\n const m =\n await accord.client.accord.accounts.jurorStake.fetchMaybe(jurorStake);\n if (!m.exists) return null;\n return {\n juror: m.data.juror,\n staked: m.data.staked,\n feesEarned: m.data.feesEarned,\n activeDraws: m.data.activeDraws,\n };\n },\n buildWithdrawFees(input) {\n return getWithdrawFeesInstruction(\n {\n juror: accord.signer,\n subaccord: input.accounts.subaccord,\n jurorStake: input.accounts.jurorStake,\n feeToken: input.accounts.feeToken,\n jurorFeeTokenAccount: input.accounts.jurorFeeTokenAccount,\n feeVault: input.accounts.feeVault,\n },\n { programAddress: input.programId },\n );\n },\n buildPruneJuror(input) {\n const ix = getPruneJurorInstruction(\n {\n caller: accord.signer,\n juror: input.accounts.juror,\n subaccord: input.accounts.subaccord,\n jurorStake: input.accounts.jurorStake,\n path: mapPath(input.path),\n },\n { programAddress: input.programId },\n );\n // remaining_accounts[0] = the expired juror's SAS attestation (read-only).\n return appendRemaining(ix, [\n { address: input.attestation, isWritable: false },\n ]);\n },\n\n // ── settlement (per-round crank + dispute cancellation) ───────────────\n buildSettleRound(input) {\n const ix = getSettleRoundInstruction(\n {\n caller: accord.signer,\n subaccord: input.accounts.subaccord,\n dispute: input.accounts.dispute,\n round: input.accounts.round,\n roundIdx: input.roundIdx,\n },\n { programAddress: input.programId },\n );\n return appendRemaining(ix, input.remainingAccounts);\n },\n buildCancelDispute(input) {\n const ix = getCancelDisputeInstruction(\n {\n caller: accord.signer,\n subaccord: input.accounts.subaccord,\n dispute: input.accounts.dispute,\n feeToken: input.accounts.feeToken,\n filerTokenAccount: input.accounts.filerTokenAccount,\n feeVault: input.accounts.feeVault,\n },\n { programAddress: input.programId },\n );\n return appendRemaining(ix, input.remainingAccounts);\n },\n\n // ── VRF + per-seat draw (ADR-0009/0012) ────────────────────────────────\n buildRequestVrf(input) {\n return getRequestVrfInstruction(\n {\n caller: accord.signer,\n subaccord: input.accounts.subaccord,\n dispute: input.accounts.dispute,\n oracleQueue: input.extras.oracleQueue,\n programIdentity: input.extras.programIdentity,\n },\n { programAddress: input.programId },\n );\n },\n buildDrawSeat(input) {\n const ix = getDrawSeatInstruction(\n {\n caller: accord.signer,\n dispute: input.accounts.dispute,\n subaccord: input.accounts.subaccord,\n round: input.roundPda,\n seat: input.seat,\n retries: input.retries,\n leaf: mapLeaf(input.leaf),\n proof: mapPath(input.proof),\n index: input.index,\n },\n { programAddress: input.programId },\n );\n // remaining_accounts[0] = the drawn juror's JurorStake PDA (writable).\n return appendRemaining(ix, [input.jurorStake]);\n },\n async fetchCommittedVrf(dispute): Promise<Uint8Array | null> {\n const m = await accord.client.accord.accounts.dispute.fetchMaybe(dispute);\n if (!m.exists) return null;\n const vrf = m.data.committedVrf;\n return vrf.__option === \"Some\" ? new Uint8Array(vrf.value) : null;\n },\n\n // ── voting ─────────────────────────────────────────────────────────────\n buildCommit(input) {\n return getCommitInstruction(\n {\n juror: accord.signer,\n subaccord: input.accounts.subaccord,\n dispute: input.accounts.dispute,\n round: input.accounts.round,\n commitment: input.commitment,\n },\n { programAddress: input.programId },\n );\n },\n buildReveal(input) {\n return getRevealInstruction(\n {\n juror: accord.signer,\n subaccord: input.accounts.subaccord,\n dispute: input.accounts.dispute,\n round: input.accounts.round,\n vote: input.vote,\n salt: input.salt,\n },\n { programAddress: input.programId },\n );\n },\n buildFinalizeRound(input) {\n // ADR-0029: finalize_round takes no remaining_accounts — fees settle\n // at settle_round/finalize_dispute against the final ruling.\n return getFinalizeRoundInstruction(\n {\n caller: accord.signer,\n subaccord: input.accounts.subaccord,\n dispute: input.accounts.dispute,\n round: input.accounts.round,\n },\n { programAddress: input.programId },\n );\n },\n buildFinalizeDispute(input) {\n const ix = getFinalizeDisputeInstruction(\n {\n caller: accord.signer,\n subaccord: input.accounts.subaccord,\n dispute: input.accounts.dispute,\n round: input.accounts.round,\n },\n { programAddress: input.programId },\n );\n return appendRemaining(ix, input.remainingAccounts);\n },\n buildRedraw(input) {\n const ix = getRedrawInstruction(\n {\n caller: accord.signer,\n subaccord: input.accounts.subaccord,\n dispute: input.accounts.dispute,\n round: input.accounts.round,\n feeToken: input.accounts.feeToken,\n filerTokenAccount: input.accounts.filerTokenAccount,\n feeVault: input.accounts.feeVault,\n tokenProgram: input.accounts.tokenProgram,\n },\n { programAddress: input.programId },\n );\n return appendRemaining(ix, input.remainingAccounts ?? []);\n },\n encodeAddress(address) {\n return new Uint8Array(getAddressEncoder().encode(address));\n },\n\n // ── appeal ─────────────────────────────────────────────────────────────\n buildAppeal(input) {\n return getAppealInstruction(\n {\n appellant: accord.signer,\n ...mapAppealAccounts(input.accounts),\n newEvidenceHash: input.newEvidenceHash,\n },\n { programAddress: input.programId },\n );\n },\n buildClaimAppealRefund(input) {\n return getClaimAppealRefundInstruction(\n {\n caller: accord.signer,\n subaccord: input.accounts.subaccord,\n dispute: input.accounts.dispute,\n appealBond: input.accounts.appealBond,\n feeToken: input.accounts.feeToken,\n claimantTokenAccount: input.accounts.claimantTokenAccount,\n feeVault: input.accounts.feeVault,\n roundIdx: input.roundIdx,\n },\n { programAddress: input.programId },\n );\n },\n buildClaimFilingBounty(input) {\n return getClaimFilingBountyInstruction(\n {\n caller: accord.signer,\n subaccord: input.accounts.subaccord,\n dispute: input.accounts.dispute,\n feeToken: input.accounts.feeToken,\n filerTokenAccount: input.accounts.filerTokenAccount,\n feeVault: input.accounts.feeVault,\n },\n { programAddress: input.programId },\n );\n },\n };\n}\n\n// ── helpers ─────────────────────────────────────────────────────────────────\n\n/** SDK `CreateSubaccordArgs` → generated instruction-data args. L-4: mints are\n * accounts (not instruction data) — extracted by the caller in\n * `buildCreateSubaccord`. */\nfunction mapCreateSubaccordArgs(\n args: CreateSubaccordArgs,\n): Omit<CreateSubaccordArgs, \"stakingToken\" | \"feeToken\" | \"jurorCredential\" | \"jurorSchema\"> & {\n jurorCredential: Address;\n jurorSchema: Address;\n} {\n return {\n domainRef: args.domainRef,\n evidenceSpec: args.evidenceSpec,\n minStake: args.minStake,\n alphaBps: args.alphaBps,\n reviewWindow: args.reviewWindow,\n commitWindow: args.commitWindow,\n revealWindow: args.revealWindow,\n appealWindow: args.appealWindow,\n maxAppeals: args.maxAppeals,\n minJurySize: args.minJurySize,\n aggregation: args.aggregation,\n feePerJuror: args.feePerJuror,\n revealThresholdBps: args.revealThresholdBps,\n shortfallPolicy: args.shortfallPolicy,\n maxDrawAttempts: args.maxDrawAttempts,\n coherenceTolBps: args.coherenceTolBps,\n authority: args.authority,\n evidenceOperator: args.evidenceOperator,\n depth: args.depth,\n // PROG-ATTESTTION: optional credential gate — default to the zero pubkey\n // (stake-only) when the caller omits them.\n jurorCredential:\n args.jurorCredential ??\n (\"11111111111111111111111111111111\" as Address),\n jurorSchema:\n args.jurorSchema ?? (\"11111111111111111111111111111111\" as Address),\n };\n}\n\n/** Map seam `AppealAccounts` → generated `appeal` instruction accounts. */\nfunction mapAppealAccounts(a: AppealAccounts) {\n return {\n subaccord: a.subaccord,\n accordState: a.accordState,\n dispute: a.dispute,\n round: a.round,\n appealBond: a.appealBond,\n feeToken: a.feeToken,\n appellantTokenAccount: a.appellantTokenAccount,\n feeVault: a.feeVault,\n };\n}\n\n/**\n * SDK MST `MSTNode` (byte-oriented) → generated args. `siblingHash` is a\n * `[u8;32]`; `siblingSum` is a u64. Shapes line up 1:1 — this wrapper keeps the\n * import boundary explicit.\n */\nfunction mapPath(\n path: MSTNode[],\n): { siblingHash: Uint8Array; siblingSum: number | bigint }[] {\n return path.map((p) => ({\n siblingHash: p.siblingHash,\n siblingSum: p.siblingSum,\n }));\n}\n\n/** SDK `LeafClaim` (byte-oriented juror) → generated args (`Address` juror). */\nfunction mapLeaf(leaf: { juror: Uint8Array; stake: bigint }): {\n juror: Address;\n stake: number | bigint;\n} {\n return {\n juror: getAddressDecoder().decode(leaf.juror),\n stake: leaf.stake,\n };\n}\n\n/**\n * Append `remaining_accounts` as non-signer metas. A bare {@link Address} is\n * WRITABLE (historical behavior — JurorStake/AppealBond PDAs the chain mutates:\n * slashes, refunds, `active_draws` bumps). Pass `{ address, isWritable: false }`\n * for read-only remaining accounts (PROG-ATTESTATION: the juror's SAS\n * attestation, which the handler only verifies, never mutates).\n */\ntype RemainingAccount = Address | { address: Address; isWritable?: boolean };\n\nfunction appendRemaining(\n ix: Instruction,\n extra: readonly RemainingAccount[],\n): Instruction {\n if (extra.length === 0) return ix;\n const metas: AccountMeta[] = extra.map((e) => {\n if (typeof e === \"string\") {\n return { address: e, role: AccountRole.WRITABLE };\n }\n return {\n address: e.address,\n role: e.isWritable === false ? AccountRole.READONLY : AccountRole.WRITABLE,\n };\n });\n return Object.freeze({\n ...ix,\n accounts: Object.freeze([...(ix.accounts ?? []), ...metas]),\n }) as Instruction;\n}\n\n// silence the unused-import lint for `VotingAccounts`/`VrfDrawAccounts`/etc.\n// which are referenced only in the seam composition above.\nexport type { SeatMembership, VrfDrawAccounts, VotingAccounts };\n","/**\n * dispute.ts — the PRIMARY external surface of @useaccord/sdk.\n *\n * Two methods every Arbitrable integrates against:\n * - {@link createDispute} — files a Dispute (CPI from an Arbitrable program,\n * - {@link getRuling} — lazy read of a dispute's `final_ruling`\n * (u64 with the `u64::MAX` no-ruling sentinel; `null` until the dispute\n * reaches `Final` — ADR-0025).\n *\n * Per ADR-0010 the SDK is two layers: a Codama-generated Kit client (drift-free\n * instruction builders + account codecs) and a thin hand-written facade that\n * owns domain logic. This module is the facade layer for dispute intake; it\n * stays orchestration-only and consumes the generated client through the\n * {@link AccordDisputeClient} seam, which the Foundation task wires to a real\n * adapter. The domain logic that is NOT generated — PDA derivation, fee math,\n * option validation — lives here and is unit-tested independently of the chain.\n *\n * Sources of truth:\n * - Instruction + accounts: programs/accord/src/lib.rs (create_dispute, get_ruling)\n * - Dispute struct + seeds: programs/accord/src/state.rs (Dispute, SEED_DISPUTE)\n * - v1 constants: programs/accord/src/constants.rs (MAX_OPTIONS)\n */\n\nimport {\n getAddressEncoder,\n getProgramDerivedAddress,\n type Address,\n type Instruction,\n} from \"@solana/kit\";\nimport { MAX_OPTIONS } from \"../constants.js\";\nimport { Aggregation } from \"../types.js\";\n\nexport { MAX_OPTIONS } from \"../constants.js\";\n\n/** Accord program id (declare_id! in programs/accord/src/lib.rs). */\nexport const ACCORD_PROGRAM_ID =\n \"RokLJyruq34Ubtaj8mFnQETKcZpNCbW6k6xsgrMoHEe\" as Address;\n\n/** u64 ceiling — guards fee math against overflow (lib.rs uses checked_mul). */\nconst U64_MAX = 0xffffffffffffffffn;\n\n/** Dispute PDA seed prefix, `b\"dispute\"` (state.rs: SEED_DISPUTE). */\nconst SEED_DISPUTE = new Uint8Array([100, 105, 115, 112, 117, 116, 101]);\n\n/**\n * A 32-byte option label hash (one row of `Dispute.options`). The Arbitrable\n * chooses these off-chain; the Accord only stores + tallies them.\n */\nexport type OptionHash = Uint8Array;\n\n/**\n * Args for `create_dispute` (lib.rs:254). All amounts in the Subaccord's\n * staking token.\n */\nexport interface CreateDisputeArgs {\n /**\n * Option label hashes, each 32 bytes. `Plurality`: 2..={@link MAX_OPTIONS}\n * (see {@link assertValidOptions}). `Median` (ADR-0025): file with none —\n * the vote is a u64 fixed-point scalar, not an index.\n */\n options: OptionHash[];\n /** ADR-0006 on-chain evidence commitment (`[u8; 32]`). */\n evidenceHash: Uint8Array;\n /** Filer-chosen nonce → private dispute namespace. Dispute PDA = `[\"dispute\", filer, nonce]`. */\n nonce: bigint;\n /** Total fee = `min_jury_size * fee_per_juror` (see {@link requiredFee}). Filer pays in full. */\n fee: bigint;\n /**\n * Aggregation rule of the Subaccord being filed against — gates\n * {@link CreateDisputeArgs.options} exactly like the on-chain handler\n * (instructions/create_dispute.rs). Omit for `Plurality` (v1 default).\n */\n aggregation?: Aggregation;\n}\n\n/** Signer + token accounts the filer brings to `create_dispute`. */\nexport interface CreateDisputeAccounts {\n /** The Arbitrable (a program signer via CPI) or any wallet. Fee source + signer. */\n filer: Address;\n /**\n * Data-free rent payer for the dispute `init` + fee_vault `init_if_needed`\n * (the system program rejects lamport transfers from data-carrying accounts,\n * so a PDA filer must not pay rent). Wallet filers pass themselves.\n */\n rentPayer: Address;\n /** The Subaccord this dispute is filed against (fee/panel source). */\n subaccord: Address;\n /** The Subaccord's staking_token mint (fee currency). */\n feeToken: Address;\n /** Filer's ATA of the fee token (fee source). */\n filerTokenAccount: Address;\n /** Subaccord PDA's fee_vault ATA (fee sink, ADR-0020). */\n feeVault: Address;\n /** Circuit-breaker singleton PDA (`[\"state\"]`); stake/create revert while paused. */\n accordState: Address;\n}\n\n/** Result of preparing a `create_dispute`: the derived Dispute PDA + its instruction. */\nexport interface CreateDisputeResult {\n /** The initialized Dispute PDA (`[\"dispute\", filer, nonce]`). */\n dispute: Address;\n /** Canonical bump stored on the account (state.rs: Dispute.bump). */\n bump: number;\n /** Unsigned instruction; the facade's wallet adapter signs + sends it. */\n instruction: Instruction;\n}\n\n/** Minimal decoded view `getRuling` consumes (avoids duplicating the full Dispute shape). */\nexport interface DisputeRulingView {\n /**\n * Winning value once `state == Final`: the option index for `Plurality`\n * disputes, the final median (settlement-mint base units) for `Median`\n * disputes (ADR-0025). `u64::MAX` ({@link NO_RULING}) → `null`.\n */\n finalRuling: bigint | null;\n}\n\n/**\n * Dispute `final_ruling` no-ruling sentinel — `u64::MAX`. ADR-0025 widened\n * the ruling from `Option<u8>` to a plain u64 (so `Median` disputes can carry\n * a scalar verdict); the old `u8::MAX` (255) sentinel is gone. Stored until\n * `finalize_dispute` writes the real value atomically with `state = Final`\n * (state.rs: `Dispute::ruling`). Same value as voting's `NO_VOTE`.\n */\nexport const NO_RULING = 0xffff_ffff_ffff_ffffn;\n\n/**\n * Seam to the Codama-generated Kit client + typed fetcher (ADR-0010). The\n * Foundation task provides a concrete adapter; dispute.ts stays pure\n * orchestration over this interface, so it is parallel-safe under fleet\n * dispatch and compile-verifiable before the generator lands.\n */\nexport interface AccordDisputeClient {\n /** Build the `create_dispute` instruction (Anchor discriminator + Borsh args). */\n buildCreateDispute(input: {\n programId: Address;\n accounts: CreateDisputeAccounts;\n args: CreateDisputeArgs;\n disputePda: Address;\n }): Instruction;\n /** Fetch + decode a Dispute account, or `null` if it does not exist yet. */\n fetchDispute(address: Address): Promise<DisputeRulingView | null>;\n}\n\n/**\n * Compute the required `create_dispute` tender (ADR-0030). The panel is the\n * Subaccord's `min_jury_size` (accord-9q3e; default 3), so the filer tenders\n * `(min_jury_size + 1) · fee_per_juror` — the round-1 juror pot plus ONE\n * flip-bounty unit (`fee_per_juror`, refundable if never appealed). Mirrors\n * lib.rs (`Subaccord::filing_fee`). Returns `null` on u64 overflow rather\n * than throwing — callers surface a typed error.\n */\nexport function requiredFee(\n feePerJuror: bigint,\n minJurySize: number = 3,\n): bigint | null {\n if (feePerJuror < 0n || !Number.isInteger(minJurySize) || minJurySize < 1) {\n return null;\n }\n const product = BigInt(minJurySize + 1) * feePerJuror;\n if (product < 0n || product > U64_MAX) return null;\n return product;\n}\n/**\n * Validate `create_dispute` options against the Subaccord's aggregation rule\n * (instructions/create_dispute.rs, ADR-0025). `Plurality` (default):\n * `2..=MAX_OPTIONS` hashes, each `[u8; 32]`. `Median`: none — the vote is a\n * u64 scalar, not an option index. Throws a typed `Error` on violation.\n * Pure — no chain access.\n */\nexport function assertValidOptions(\n options: OptionHash[],\n aggregation: Aggregation = Aggregation.Plurality,\n): void {\n if (aggregation === Aggregation.Median) {\n if (options.length !== 0) {\n throw new Error(\n `InvalidOptions: Median (scalar) disputes file without option hashes, got ${options.length}`,\n );\n }\n return;\n }\n if (options.length < 2 || options.length > MAX_OPTIONS) {\n throw new Error(\n `InvalidOptions: expected 2..=${MAX_OPTIONS} options, got ${options.length}`,\n );\n }\n for (let i = 0; i < options.length; i++) {\n const opt = options[i];\n if (opt === undefined || opt.length !== 32) {\n throw new Error(\n `InvalidOptions: option ${i} must be 32 bytes, got ${opt?.length ?? 0}`,\n );\n }\n }\n}\n\n/** Validate the evidence commitment is `[u8; 32]` (lib.rs:257 instruction arg). */\nexport function assertValidEvidenceHash(evidenceHash: Uint8Array): void {\n if (evidenceHash.length !== 32) {\n throw new Error(\n `InvalidEvidenceHash: expected 32 bytes, got ${evidenceHash.length}`,\n );\n }\n}\n\n/** Validate a `nonce` fits in a u64 (lib.rs:258 instruction arg). */\nexport function assertValidNonce(nonce: bigint): void {\n if (nonce < 0n || nonce > U64_MAX) {\n throw new Error(`InvalidNonce: expected u64, got ${nonce}`);\n }\n}\n\n/**\n * Build the Dispute PDA seed bytes (state.rs:1872):\n * `[\"dispute\", filer.key().as_ref(), &nonce.to_le_bytes()]`.\n *\n * `filerBytes` is the filer's 32-byte pubkey encoding (Kit's\n * `getAddressEncoder().encode(filer)`). Pure + deterministic — the unit-test\n * entry point; {@link findDisputePda} wraps it with Kit's resolver.\n */\nexport function disputeSeeds(\n filerBytes: Uint8Array,\n nonce: bigint,\n): Uint8Array[] {\n const nonceLe = new Uint8Array(8);\n new DataView(nonceLe.buffer).setBigUint64(0, nonce, true);\n return [SEED_DISPUTE, filerBytes, nonceLe];\n}\n\n/**\n * Derive the canonical Dispute PDA (`[\"dispute\", filer, nonce.to_le()]`).\n */\nexport async function findDisputePda(\n programAddress: Address,\n filer: Address,\n nonce: bigint,\n): Promise<{ address: Address; bump: number }> {\n // kit's encoder returns ReadonlyUint8Array (TS 5.7+ typed-array generics);\n // copy into a mutable Uint8Array for the seeds vector.\n const filerBytes = new Uint8Array(getAddressEncoder().encode(filer));\n const [address, bump] = await getProgramDerivedAddress({\n programAddress,\n seeds: disputeSeeds(filerBytes, nonce),\n });\n return { address, bump };\n}\n\n/**\n * Prepare a `create_dispute`: validate args, derive the Dispute PDA, and build\n * the instruction via the client seam. The caller (Accord facade) signs + sends\n * `result.instruction` with its wallet adapter.\n *\n * On success the Dispute PDA is `init`-ialized (instructions/create_dispute.rs)\n * and reads `state == Created`, `final_ruling == u64::MAX` ({@link NO_RULING}).\n */\nexport async function createDispute(\n client: AccordDisputeClient,\n accounts: CreateDisputeAccounts,\n args: CreateDisputeArgs,\n programId: Address = ACCORD_PROGRAM_ID,\n): Promise<CreateDisputeResult> {\n assertValidOptions(args.options, args.aggregation);\n assertValidEvidenceHash(args.evidenceHash);\n assertValidNonce(args.nonce);\n const { address, bump } = await findDisputePda(\n programId,\n accounts.filer,\n args.nonce,\n );\n const instruction = client.buildCreateDispute({\n programId,\n accounts,\n args,\n disputePda: address,\n });\n return { dispute: address, bump, instruction };\n}\n\n/**\n * Lazily read a dispute's final ruling. Returns the winning value once the\n * dispute reaches `Final` — the option index for `Plurality` disputes, the\n * final median in settlement-mint base units for `Median` disputes\n * (ADR-0025) — or `null` beforehand; on-chain `final_ruling` holds the\n * `u64::MAX` sentinel ({@link NO_RULING}) until then, and both the adapter\n * and {@link getRuling} fold it to `null` (matches the on-chain `get_ruling`\n * CPI entry, lib.rs:480 → `Dispute::ruling()`). Returns `null` if the\n * Dispute account does not exist yet.\n */\nexport async function getRuling(\n client: AccordDisputeClient,\n dispute: Address,\n): Promise<bigint | null> {\n const view = await client.fetchDispute(dispute);\n // Defense in depth: the adapter already folds the sentinel, but fold here\n // too so no seam implementor can leak it — same posture as on-chain\n // `Dispute::ruling()` (state.rs) checking the sentinel even though the\n // Final⟺ruling-written invariant makes it unreachable.\n const fr = view?.finalRuling ?? NO_RULING;\n return fr === NO_RULING ? null : fr;\n}\n","import type { Address } from \"@solana/kit\";\n\n/**\n * v1 protocol constants and defaults.\n *\n * Sourced from `programs/accord/src/constants.rs` and AGENTS.md \"v1 Defaults\".\n * Per-Subaccord params are configurable at creation; these are the milestone\n * defaults.\n */\n\n// --- Account-size bounds (constants.rs) ---\n\nexport const MAX_JURORS = 31;\nexport const MAX_APPEALS = 3;\nexport const MAX_OPTIONS = 8;\n\n/**\n * Maximum sortition retries per seat accepted by on-chain `draw_seat`\n * (constants.rs, L-5 review 2026-09-23). Bounded so one instruction fits the\n * 1.4M CU cap; chains beyond it are rejected with `MaxRetriesExceeded`.\n */\nexport const MAX_SORTITION_RETRIES = 128;\n\n// --- Timelocks (constants.rs, in slots @ ~400ms mainnet) ---\n\nexport const UPDATE_TIMELOCK_SLOTS = 432_000n; // 48h\nexport const UNPAUSE_TIMELOCK_SLOTS = 216_000n; // 24h\n\n// --- Windows (constants.rs, in seconds) ---\n\n/** Default appeal window (ADR-0022). Per-Subaccord now; this is the\n * `createSubaccord` default + the \"v1 default\" the docs cite — the runtime\n * value is `dispute.terms.appealWindow` (frozen at filing). 3 days. */\nexport const DEFAULT_APPEAL_WINDOW_SECS = 259_200n;\n/** Floor on the per-Subaccord appeal window (ADR-0022). 1 hour. */\nexport const MIN_APPEAL_WINDOW_SECS = 3_600n;\n\n// --- Accumulator (ADR-0012) ---\n\n/**\n * Maximum tree depth that fits a `stake`/`requestWithdraw`/`reconcileStake`\n * instruction within the 1232-byte serialized transaction limit when signed\n * via a browser wallet. The MST proof is `depth × 40` bytes of instruction\n * data; the `stake` ix has ~490 bytes of fixed overhead (7 accounts + headers\n * + discriminator + amount). `490 + depth×40 ≤ 1232` ⇒ depth ≤ 18, but we\n * cap at 16 (102-byte margin) for safety.\n */\nexport const MAX_SAFE_TREE_DEPTH = 16;\n\n/**\n * Default Merkle accumulator tree depth. 2^16 = 65,536 seats; per-Subaccord.\n * Capped at {@link MAX_SAFE_TREE_DEPTH} so browser-wallet signing works.\n */\nexport const DEFAULT_TREE_DEPTH = 16;\n\n// --- v1 default economics (per-Subaccord; AGENTS.md \"v1 Defaults\") ---\n\n/**\n * Round-1 juror panel size (ADR-0019). Fixed protocol constant — not\n * per-Subaccord configurable. The appeal ladder grows it via `2N+1`:\n * 3 → 7 → 15 → 31 (the last exactly fills `MAX_JURORS` at `max_appeals = 3`).\n */\nexport const INITIAL_NUM_JURORS = 3;\nexport const DEFAULT_ALPHA_BPS = 1_000; // 10%\nexport const DEFAULT_REVIEW_WINDOW_SECS = 604_800n; // 7 days\nexport const DEFAULT_COMMIT_WINDOW_SECS = 172_800n; // 2 days\nexport const DEFAULT_REVEAL_WINDOW_SECS = 172_800n; // 2 days\nexport const DEFAULT_MAX_APPEALS = 3;\n/**\n * Default reveal-quorum fraction in bps (ADR-0021): 6_666 = 2/3. A round is\n * authoritative only once `reveal_count >= ceil(panel × bps / 10_000)`.\n */\nexport const DEFAULT_REVEAL_THRESHOLD_BPS = 6_666;\n/** Program ceiling on per-round redraw attempts (bounds the redraw ladder). */\nexport const MAX_DRAW_ATTEMPTS = 10;\n/** Default same-size redraw cap per round before a dispute fails (ADR-0021). */\nexport const DEFAULT_MAX_DRAW_ATTEMPTS = 3;\n/**\n * Default `Median` coherence tolerance in bps (ADR-0025): a revealed vote is\n * coherent iff `|vote − ruling| · 10_000 ≤ ruling · coherence_tol_bps`. 100 =\n * a 1% band around the final median. Inert for `Plurality` (exact option\n * equality) — Plurality-only pools pass `0`.\n */\nexport const DEFAULT_COHERENCE_TOL_BPS = 100;\nexport const DEFAULT_MIN_STAKE = 1_000n;\nexport const DEFAULT_FEE_PER_JUROR = 0n; // set per-Subaccord\n\n// --- Panel ladder: round-1 = min_jury_size (per-Subaccord, accord-9q3e; default\n// INITIAL_NUM_JURORS); N_{k+1} = 2·N_k + 1, closed form (J+1)·2^k − 1,\n// capped at MAX_JURORS ---\n\n/**\n * Panel size for round `roundIdx`, seeded by `baseJurySize` (the Subaccord's\n * `min_jury_size`). Defaults to {@link INITIAL_NUM_JURORS} (=3) for backward\n * compatibility — pass the Subaccord's value explicitly for non-default pools.\n */\nexport function panelSizeForRound(\n roundIdx: number,\n baseJurySize: number = INITIAL_NUM_JURORS,\n): number | null {\n if (\n !Number.isInteger(roundIdx) ||\n roundIdx < 0 ||\n roundIdx >= 31 ||\n !Number.isInteger(baseJurySize) ||\n baseJurySize < 1\n ) {\n return null;\n }\n const factor = 1 << roundIdx;\n const panel = (baseJurySize + 1) * factor - 1;\n if (!Number.isSafeInteger(panel) || panel < 0) return null;\n return Math.min(panel, MAX_JURORS);\n}\n\n/**\n * Largest panel a Subaccord with `maxAppeals` appeals can reach, seeded by\n * `baseJurySize` (the Subaccord's `min_jury_size`). Defaults to\n * {@link INITIAL_NUM_JURORS} (=3).\n */\nexport function maxAppealPanelSize(\n maxAppeals: number,\n baseJurySize: number = INITIAL_NUM_JURORS,\n): number {\n const factor = 1 << maxAppeals;\n return Math.min((baseJurySize + 1) * factor - 1, MAX_JURORS);\n}\n\n// --- MagicBlock VRF oracle queues (ephemeral_rollups_sdk::vrf::consts) ---\n//\n// Every randomness request names an oracle queue. A delegated queue is writable\n// only from inside an ephemeral rollup; a non-delegated (base-layer) queue is\n// writable on L1. The cranker and Arbitrables run on L1, so they reference the\n// base-layer queue. Mainnet and devnet share the same addresses.\n//\n// @see https://docs.magicblock.dev\n\n/** Mainnet/devnet base-layer VRF oracle queue (`DEFAULT_QUEUE`). */\nexport const VRF_ORACLE_QUEUE =\n \"Cuj97ggrhhidhbu39TijNVqE74xvKJ69gDervRUXAxGh\" as Address;\n/** Mainnet/devnet delegated (ephemeral rollup) VRF oracle queue (`DEFAULT_EPHEMERAL_QUEUE`). */\nexport const VRF_ORACLE_EPHEMERAL_QUEUE =\n \"5hBR571xnXppuCPveTrctfTU7tJLSN94nq7kv7FRK5Tc\" as Address;\n/** Localnet base-layer test VRF oracle queue (`DEFAULT_TEST_QUEUE`). */\nexport const VRF_ORACLE_TEST_QUEUE =\n \"GKE6d7iv8kCBrsxr78W3xVdjGLLLJnxsGiuzrsZCGEvb\" as Address;\n/** Localnet delegated (ephemeral rollup) test VRF oracle queue (`DEFAULT_EPHEMERAL_TEST_QUEUE`). */\nexport const VRF_ORACLE_EPHEMERAL_TEST_QUEUE =\n \"Sc9MJUngNbQXSXGP3F67KvKwVnhaYn6kcioxXNVowYT\" as Address;\n","/**\n * lifecycle.ts — Subaccord lifecycle + circuit breaker (ADR-0005, ADR-0007).\n *\n * Seven instructions:\n * - {@link createSubaccord} permissionless pool creation.\n * - {@link proposeSubaccordUpdate} authority-gated; arms a 48h timelock.\n * - {@link executeSubaccordUpdate} permissionless crank; lands post-timelock.\n * - {@link initializePause} / {@link pause} / {@link proposeUnpause} /\n * {@link executeUnpause} the ADR-0007 circuit-breaker quartet.\n *\n * Client-side timelock awareness (ADR-0010 §4): `propose_subaccord_update`\n * writes `execute_after_slot = slot + UPDATE_TIMELOCK_SLOTS` on-chain. The SDK\n * cannot predict the exact landing slot, so the flow is: propose → read\n * `execute_after_slot` back from the PendingUpdate account → wait until\n * `canExecuteAt(executeAfterSlot, currentSlot)` → execute. The same shape backs\n * the unpause timelock (`UNPAUSE_TIMELOCK_SLOTS`).\n *\n * Same ADR-0010 facade pattern as the other method modules: pure orchestration\n * over a typed {@link AccordLifecycleClient} seam; Kit type-only; PDAs lazy.\n *\n * Sources of truth:\n * - instructions: programs/accord/src/lib.rs (146-397, 77-144)\n * - accounts/PDAs: programs/accord/src/lib.rs (1693-1845, 1640-1690)\n * - constants: programs/accord/src/constants.rs\n * - UpdatePayload: programs/accord/src/state.rs (254-266)\n */\nimport {\n getAddressEncoder,\n getProgramDerivedAddress,\n type Address,\n type Instruction,\n} from \"@solana/kit\";\nimport {\n MAX_APPEALS,\n MAX_DRAW_ATTEMPTS,\n MAX_JURORS,\n MIN_APPEAL_WINDOW_SECS,\n UPDATE_TIMELOCK_SLOTS,\n UNPAUSE_TIMELOCK_SLOTS,\n} from \"../constants.js\";\nimport type { Aggregation, ShortfallPolicy, UpdatePayload } from \"../types.js\";\n\nexport {\n MAX_APPEALS,\n MAX_DRAW_ATTEMPTS,\n MAX_JURORS,\n MIN_APPEAL_WINDOW_SECS,\n UPDATE_TIMELOCK_SLOTS,\n UNPAUSE_TIMELOCK_SLOTS,\n} from \"../constants.js\";\nexport { type ShortfallPolicy, type UpdatePayload } from \"../types.js\";\n\n// ---------------------------------------------------------------------------\n// PDA seed prefixes + local constants\n// ---------------------------------------------------------------------------\n\n/** Subaccord PDA seed prefix (state.rs: SEED_SUBACCORD = b\"subaccord\"). */\nconst SEED_SUBACCORD = new Uint8Array([\n 115, 117, 98, 97, 99, 99, 111, 114, 100,\n]);\n\n/** PendingUpdate PDA seed prefix (state.rs: SEED_PENDING_UPDATE = b\"update\"). */\nconst SEED_PENDING_UPDATE = new Uint8Array([117, 112, 100, 97, 116, 101]); // \"update\"\n\n/** AccordState PDA seed prefix (state.rs: SEED_ACCORD_STATE = b\"state\"). */\nconst SEED_ACCORD_STATE = new Uint8Array([115, 116, 97, 116, 101]); // \"state\"\n\nconst U64_MAX = 0xffffffffffffffffn;\n\n// ---------------------------------------------------------------------------\n// Domain types\n// ---------------------------------------------------------------------------\n\n/** Args for `create_subaccord` (lib.rs:146). `domain_ref`/`evidence_spec` immutable. */\nexport interface CreateSubaccordArgs {\n /** Immutable identity hash: the class of dispute this pool adjudicates. ≠ [0;32]. */\n domainRef: Uint8Array; // 32 bytes\n /** Immutable evidence-format spec hash (ADR-0006). */\n evidenceSpec: Uint8Array; // 32 bytes\n /** SPL mint juror capital is staked in (collateral, ADR-0002/0020). */\n stakingToken: Address;\n /** Compensation mint — fees + appeal bonds (ADR-0020). Distinct from stakingToken. */\n feeToken: Address;\n minStake: bigint;\n /** Slash factor in bps (10% = 1000). */\n alphaBps: number; // u16\n reviewWindow: bigint; // seconds\n commitWindow: bigint; // seconds\n revealWindow: bigint; // seconds\n /** Appeal window after a round resolves before finality (ADR-0022). Per-\n * Subaccord, frozen onto `CaseTerms` at filing. ≥ {@link MIN_APPEAL_WINDOW_SECS}. */\n appealWindow: bigint; // seconds\n /** ≤ {@link MAX_APPEALS}; bounds the appeal ladder depth. The round-1 panel\n * size is per-Subaccord via {@link CreateSubaccordArgs.minJurySize}\n * (accord-9q3e); each appeal doubles+1. */\n maxAppeals: number; // u8\n /** Round-1 juror panel size (accord-9q3e). Default 3 ({@link INITIAL_NUM_JURORS});\n * must be odd and the appeal ladder `(J+1)·2^maxAppeals − 1` must fit\n * {@link MAX_JURORS}. Set 1 + `maxAppeals = 0` for a single-juror pool.\n * Immutable on the Subaccord (not in {@link UpdatePayload}). */\n minJurySize: number; // u32, odd ≥ 1\n /** Per-Subaccord aggregation rule (ADR-0019). v1 = `Plurality`. */\n aggregation: Aggregation;\n feePerJuror: bigint;\n /**\n * Reveal-quorum fraction in bps (ADR-0021). A round is authoritative only if\n * `reveal_count >= ceil(panel × bps / 10_000)`. Default 6_666 (2/3); the\n * absolute commitment escalates per appeal for free via panel growth.\n */\n revealThresholdBps: number; // u16, 0..=10_000\n /** Shortfall policy (ADR-0021). v1 = `Redraw` (same-size redraw via `draw_attempt`). */\n shortfallPolicy: ShortfallPolicy;\n /**\n * Same-size redraw cap per round before the dispute fails (ADR-0021).\n * Orthogonal to {@link CreateSubaccordArgs.maxAppeals} (which bounds rounds).\n */\n maxDrawAttempts: number; // u8, 1..=MAX_DRAW_ATTEMPTS\n /**\n * Coherence tolerance for `Median` pools, in bps of the final median\n * (ADR-0025): a revealed vote is coherent iff\n * `|vote − ruling| · 10_000 ≤ ruling · coherence_tol_bps`. `0` = exact\n * match. Inert for `Plurality`. Immutable on the Subaccord (not in\n * `UpdatePayload`); frozen onto `CaseTerms` at filing. Docs default 100\n * (1% band) for `Median` pools; use `0` for `Plurality`-only pools.\n */\n coherenceTolBps: number; // u16, 0..=10_000\n /** `Pubkey::default()` => immutable Subaccord; else signs propose/execute. */\n authority: Address;\n /** ADR-0006 trusted re-encryption service. */\n evidenceOperator: Address;\n /**\n * Fixed accumulator tree depth (ADR-0012). Bounds the juror pool at\n * `2^depth`; the tree never grows a level during operation. Default 20.\n */\n depth: number; // u8\n /**\n * PROG-ATTESTTION: optional credential gate. Omit (or set both to the default\n * pubkey) ⇒ stake-only Subaccord (today's behaviour). Set both ⇒ jurors must\n * hold a valid SAS attestation to stake/draw. Both-or-neither.\n */\n jurorCredential?: Address;\n jurorSchema?: Address;\n}\n\n/**\n * Tagged Subaccord parameter update (state.rs:254-266). `domain_ref` and\n * `evidence_spec` are immutable and absent. Re-exported from\n * {@link ../types.js} (Codama-generated canonical shape).\n */\n\n// ---------------------------------------------------------------------------\n// Pure helpers (testable, no chain)\n// ---------------------------------------------------------------------------\n\n/** u64 → 8-byte little-endian. */\nfunction le8(v: bigint): Uint8Array {\n const b = new Uint8Array(8);\n new DataView(b.buffer).setBigUint64(0, v, true);\n return b;\n}\n\n/** Subaccord PDA seeds (state.rs:1697): `[\"subaccord\", creator, domain_ref]`. */\nexport function subaccordSeeds(\n creatorBytes: Uint8Array,\n domainRef: Uint8Array,\n): Uint8Array[] {\n assertValidRiskType(domainRef);\n if (creatorBytes.length !== 32)\n throw new Error(\"InvalidCreator: expected 32 bytes\");\n return [SEED_SUBACCORD, creatorBytes, domainRef];\n}\n\n/** PendingUpdate PDA seeds (state.rs:1816): `[\"update\", subaccord, nonce_le]`. */\nexport function pendingUpdateSeeds(\n subaccordBytes: Uint8Array,\n nonce: bigint,\n): Uint8Array[] {\n if (subaccordBytes.length !== 32)\n throw new Error(\"InvalidSubaccord: expected 32 bytes\");\n if (nonce < 0n || nonce > U64_MAX)\n throw new Error(`InvalidNonce: expected u64, got ${nonce}`);\n return [SEED_PENDING_UPDATE, subaccordBytes, le8(nonce)];\n}\n\n/** AccordState PDA seeds (state.rs: `[\"state\"]`). Singleton. */\nexport function accordStateSeeds(): Uint8Array[] {\n return [SEED_ACCORD_STATE];\n}\n\n/** Validate `max_appeals ≤ MAX_APPEALS` (lib.rs). With a configurable round-1\n * panel size (accord-9q3e), `maxAppeals` bounds the appeal ladder depth; the\n * ladder must also fit `MAX_JURORS` — see {@link assertValidMinJurySize}. */\nexport function assertValidMaxAppeals(maxAppeals: number): void {\n if (\n !Number.isInteger(maxAppeals) ||\n maxAppeals < 0 ||\n maxAppeals > MAX_APPEALS\n ) {\n throw new Error(\n `MaxAppealsLimitExceeded: expected 0..${MAX_APPEALS}, got ${maxAppeals}`,\n );\n }\n}\n\n/** Validate `min_jury_size` is odd and the appeal ladder fits `MAX_JURORS`\n * (lib.rs create_subaccord, accord-9q3e). The ladder top\n * `(J+1)·2^maxAppeals − 1` must not exceed {@link MAX_JURORS} or panel growth\n * would be silently truncated by the on-chain `.min()` cap. Throws on violation. */\nexport function assertValidMinJurySize(\n minJurySize: number,\n maxAppeals: number,\n): void {\n if (!Number.isInteger(minJurySize) || minJurySize < 1) {\n throw new Error(\n `InvalidMinJurySize: expected odd integer ≥ 1, got ${minJurySize}`,\n );\n }\n if (minJurySize % 2 !== 1) {\n throw new Error(\n `InvalidMinJurySize: must be odd (tie avoidance under plurality), got ${minJurySize}`,\n );\n }\n const ladderTop = (minJurySize + 1) * (1 << maxAppeals) - 1;\n if (ladderTop > MAX_JURORS) {\n throw new Error(\n `InvalidMinJurySize: appeal ladder top (${ladderTop}) exceeds MAX_JURORS (${MAX_JURORS})` +\n ` for min_jury_size=${minJurySize}, max_appeals=${maxAppeals}`,\n );\n }\n}\n\n/** Validate `appeal_window ≥ MIN_APPEAL_WINDOW_SECS` (lib.rs, ADR-0022). A pool\n * that wants no appeals sets `max_appeals == 0`; a 0 window is rejected. */\nexport function assertValidAppealWindow(appealWindow: bigint): void {\n if (appealWindow < MIN_APPEAL_WINDOW_SECS) {\n throw new Error(\n `AppealWindowTooShort: expected >= ${MIN_APPEAL_WINDOW_SECS}, got ${appealWindow}`,\n );\n }\n}\n\n/** Validate `reveal_threshold_bps ≤ 10_000` (lib.rs, ADR-0021). */\nexport function assertValidRevealThreshold(revealThresholdBps: number): void {\n if (\n !Number.isInteger(revealThresholdBps) ||\n revealThresholdBps < 0 ||\n revealThresholdBps > 10_000\n ) {\n throw new Error(\n `InvalidThreshold: expected 0..10000 bps, got ${revealThresholdBps}`,\n );\n }\n}\n\n/** Validate `1 ≤ max_draw_attempts ≤ MAX_DRAW_ATTEMPTS` (lib.rs, ADR-0021). */\nexport function assertValidMaxDrawAttempts(maxDrawAttempts: number): void {\n if (\n !Number.isInteger(maxDrawAttempts) ||\n maxDrawAttempts < 1 ||\n maxDrawAttempts > MAX_DRAW_ATTEMPTS\n ) {\n throw new Error(\n `MaxDrawAttemptsLimitExceeded: expected 1..${MAX_DRAW_ATTEMPTS}, got ${maxDrawAttempts}`,\n );\n }\n}\n\n/** Validate `coherence_tol_bps ≤ 10_000` (lib.rs create_subaccord, ADR-0025).\n * Mirrors the on-chain `InvalidThreshold` gate — same bound as\n * {@link assertValidRevealThreshold}. */\nexport function assertValidCoherenceTol(coherenceTolBps: number): void {\n if (\n !Number.isInteger(coherenceTolBps) ||\n coherenceTolBps < 0 ||\n coherenceTolBps > 10_000\n ) {\n throw new Error(\n `InvalidThreshold: expected 0..10000 bps, got ${coherenceTolBps}`,\n );\n }\n}\n\n/** Reject the degenerate zero domain_ref (lib.rs:164 namespace squat guard). */\nexport function assertValidRiskType(domainRef: Uint8Array): void {\n if (domainRef.length !== 32) {\n throw new Error(\n `InvalidRiskType: expected 32 bytes, got ${domainRef.length}`,\n );\n }\n let allZero = 1;\n for (let i = 0; i < 32; i++) allZero &= domainRef[i] === 0 ? 1 : 0;\n if (allZero) throw new Error(\"InvalidRiskType: zero hash is reserved\");\n}\n\n/** Timelock gate: may a pending update/unpause land at `currentSlot`? */\nexport function canExecuteAt(\n executeAfterSlot: bigint,\n currentSlot: bigint,\n): boolean {\n return currentSlot >= executeAfterSlot;\n}\n\n// ---------------------------------------------------------------------------\n// PDA derivations (Kit lazy-imported)\n// ---------------------------------------------------------------------------\n\nexport async function findSubaccordPda(\n programAddress: Address,\n creator: Address,\n domainRef: Uint8Array,\n): Promise<{ address: Address; bump: number }> {\n const creatorBytes = new Uint8Array(getAddressEncoder().encode(creator));\n const [address, bump] = await getProgramDerivedAddress({\n programAddress,\n seeds: subaccordSeeds(creatorBytes, domainRef),\n });\n return { address, bump };\n}\n\nexport async function findPendingUpdatePda(\n programAddress: Address,\n subaccord: Address,\n nonce: bigint,\n): Promise<{ address: Address; bump: number }> {\n const subBytes = new Uint8Array(getAddressEncoder().encode(subaccord));\n const [address, bump] = await getProgramDerivedAddress({\n programAddress,\n seeds: pendingUpdateSeeds(subBytes, nonce),\n });\n return { address, bump };\n}\n\nexport async function findAccordStatePdaWithBump(\n programAddress: Address,\n): Promise<{ address: Address; bump: number }> {\n const [address, bump] = await getProgramDerivedAddress({\n programAddress,\n seeds: accordStateSeeds(),\n });\n return { address, bump };\n}\n\n// ---------------------------------------------------------------------------\n// Seam (ADR-0010) + orchestration\n// ---------------------------------------------------------------------------\n\n/**\n * Seam to the Codama-generated Kit client + fetcher. Foundation wires the\n * concrete adapter; lifecycle.ts stays orchestration-only.\n */\nexport interface AccordLifecycleClient {\n buildCreateSubaccord(input: {\n programId: Address;\n creator: Address;\n subaccordPda: Address;\n args: CreateSubaccordArgs;\n }): Instruction;\n buildProposeSubaccordUpdate(input: {\n programId: Address;\n authority: Address;\n subaccord: Address;\n pendingUpdatePda: Address;\n nonce: bigint;\n payload: UpdatePayload;\n }): Instruction;\n buildExecuteSubaccordUpdate(input: {\n programId: Address;\n caller: Address;\n subaccord: Address;\n pendingUpdate: Address;\n }): Instruction;\n buildInitializePause(input: {\n programId: Address;\n authority: Address;\n accordStatePda: Address;\n }): Instruction;\n buildPause(input: {\n programId: Address;\n authority: Address;\n accordState: Address;\n }): Instruction;\n buildProposeUnpause(input: {\n programId: Address;\n authority: Address;\n accordState: Address;\n }): Instruction;\n buildExecuteUnpause(input: {\n programId: Address;\n caller: Address;\n accordState: Address;\n }): Instruction;\n /** Read `execute_after_slot` back from a PendingUpdate account (timelock flow). */\n fetchPendingUpdateExecuteAfter(\n pendingUpdate: Address,\n ): Promise<bigint | null>;\n}\n\n/** Build `create_subaccord` (lib.rs:146). Permissionless; creator owns the namespace. */\nexport async function createSubaccord(\n client: AccordLifecycleClient,\n programId: Address,\n creator: Address,\n args: CreateSubaccordArgs,\n): Promise<{ instruction: Instruction; subaccord: Address; bump: number }> {\n assertValidRiskType(args.domainRef);\n if (args.evidenceSpec.length !== 32)\n throw new Error(\"InvalidEvidenceSpec: expected 32 bytes\");\n assertValidMaxAppeals(args.maxAppeals);\n assertValidAppealWindow(args.appealWindow);\n assertValidRevealThreshold(args.revealThresholdBps);\n assertValidMaxDrawAttempts(args.maxDrawAttempts);\n assertValidCoherenceTol(args.coherenceTolBps);\n assertValidMinJurySize(args.minJurySize, args.maxAppeals);\n const { address, bump } = await findSubaccordPda(\n programId,\n creator,\n args.domainRef,\n );\n const instruction = client.buildCreateSubaccord({\n programId,\n creator,\n subaccordPda: address,\n args,\n });\n return { instruction, subaccord: address, bump };\n}\n\n/**\n * Build `propose_subaccord_update` (lib.rs:331). Authority-gated; arms a 48h\n * timelock. The adapter pins the data-free rent payer to its wallet signer\n * (ADR-0028) — wallet authorities pay their own PendingUpdate rent; a PDA\n * authority CPIs from its program with a crank caller as rent payer.\n * The exact `execute_after_slot` is set on-chain from the landing\n * slot — read it back via `fetchPendingUpdateExecuteAfter` and gate execution\n * with `canExecuteAt`. Returns the derived PendingUpdate PDA.\n */\nexport async function proposeSubaccordUpdate(\n client: AccordLifecycleClient,\n programId: Address,\n authority: Address,\n subaccord: Address,\n nonce: bigint,\n payload: UpdatePayload,\n): Promise<{ instruction: Instruction; pendingUpdate: Address }> {\n if (nonce < 0n || nonce > U64_MAX)\n throw new Error(`InvalidNonce: expected u64, got ${nonce}`);\n const { address } = await findPendingUpdatePda(programId, subaccord, nonce);\n const instruction = client.buildProposeSubaccordUpdate({\n programId,\n authority,\n subaccord,\n pendingUpdatePda: address,\n nonce,\n payload,\n });\n return { instruction, pendingUpdate: address };\n}\n\n/**\n * Resolve the timelock for a pending update: read `execute_after_slot` back\n * from the PendingUpdate account. Pair with {@link canExecuteAt}.\n */\nexport async function getUpdateExecuteAfterSlot(\n client: AccordLifecycleClient,\n pendingUpdate: Address,\n): Promise<bigint | null> {\n return client.fetchPendingUpdateExecuteAfter(pendingUpdate);\n}\n\n/** Build `execute_subaccord_update` (lib.rs:372). Permissionless; lands post-timelock. */\nexport function executeSubaccordUpdate(\n client: AccordLifecycleClient,\n programId: Address,\n caller: Address,\n subaccord: Address,\n pendingUpdate: Address,\n): Instruction {\n return client.buildExecuteSubaccordUpdate({\n programId,\n caller,\n subaccord,\n pendingUpdate,\n });\n}\n\n/** Build `initialize_pause` (lib.rs:77). One-time: sets the pause authority. */\nexport async function initializePause(\n client: AccordLifecycleClient,\n programId: Address,\n authority: Address,\n): Promise<{ instruction: Instruction; accordState: Address }> {\n const { address } = await findAccordStatePdaWithBump(programId);\n const instruction = client.buildInitializePause({\n programId,\n authority,\n accordStatePda: address,\n });\n return { instruction, accordState: address };\n}\n\n/** Build `pause` (lib.rs:86). Instant, authority-gated emergency freeze. */\nexport function pause(\n client: AccordLifecycleClient,\n programId: Address,\n authority: Address,\n accordState: Address,\n): Instruction {\n return client.buildPause({ programId, authority, accordState });\n}\n\n/** Build `propose_unpause` (lib.rs:102). Arms `UNPAUSE_TIMELOCK_SLOTS` notice. */\nexport function proposeUnpause(\n client: AccordLifecycleClient,\n programId: Address,\n authority: Address,\n accordState: Address,\n): Instruction {\n return client.buildProposeUnpause({ programId, authority, accordState });\n}\n\n/** Build `execute_unpause` (lib.rs:120). Permissionless; lands post-timelock. */\nexport function executeUnpause(\n client: AccordLifecycleClient,\n programId: Address,\n caller: Address,\n accordState: Address,\n): Instruction {\n return client.buildExecuteUnpause({ programId, caller, accordState });\n}\n","/**\n * staking.ts — Juror capital stake / unstake + the `active_draws` guard.\n *\n * `unstake` is blocked on-chain while a juror is drawn into any open dispute\n * (`JurorStake.active_draws > 0` → `StakeLocked`, lib.rs:272) — stake is frozen\n * until every drawn dispute settles (ADR-0003). The facade surfaces this as a\n * typed pre-check ({@link canUnstake} / {@link assertCanUnstake}) so a client\n * rejects the unstake BEFORE building or sending the transaction (matches the\n * on-chain error; test-matrix row 4).\n *\n * `stake` SPL-transfers `amount` of the Subaccord's staking token from the\n * juror's ATA into the Subaccord PDA's vault ATA (lazily created on first\n * stake). Reverts while the circuit breaker is paused (ADR-0007).\n *\n * Same ADR-0010 facade pattern: pure orchestration over a typed\n * {@link AccordStakingClient} seam; Kit type-only; PDA lazy.\n *\n * Sources of truth:\n * - stake / unstake handlers: programs/accord/src/lib.rs (206-324)\n * - Stake / Unstake accounts: programs/accord/src/lib.rs (1716-1798)\n * - JurorStake struct + seeds: programs/accord/src/state.rs (60-70)\n */\nimport {\n AccountRole,\n getAddressEncoder,\n getProgramDerivedAddress,\n type Address,\n type Instruction,\n} from \"@solana/kit\";\nimport type { MSTNode } from \"./mst.js\";\n\n/** JurorStake PDA seed prefix (state.rs: SEED_JUROR_STAKE = b\"stake\"). */\nconst SEED_JUROR_STAKE = new Uint8Array([115, 116, 97, 107, 101]); // \"stake\"\n\nconst U64_MAX = 0xffffffffffffffffn;\n\n/** The decoded JurorStake fields the guard + caller need. */\nexport interface JurorStakeView {\n juror: Address;\n /** Collateral (stake_token, ADR-0020). */\n staked: bigint;\n /** Aggregate earned fees (fee_token, ADR-0020). Withdrawable via `withdrawFees`. */\n feesEarned: bigint;\n /** Disputes this juror is currently drawn into; >0 blocks unstake. */\n activeDraws: number;\n}\n\n/**\n * Typed unstake guard result. `ok === false` ⇒ do not build the tx; the\n * `reason` matches the on-chain error class (StakeLocked / InvalidAmount /\n * InsufficientBalance).\n */\nexport interface UnstakeGuard {\n ok: boolean;\n reason?: \"StakeLocked\" | \"InvalidAmount\" | \"InsufficientBalance\";\n}\n\n/**\n * Pre-flight the `unstake` against the juror's live stake. Mirrors the three\n * on-chain requires (lib.rs:270-277): `amount > 0`, `active_draws == 0`,\n * `amount ≤ staked`. Pure — no chain access.\n */\nexport function canUnstake(\n stake: JurorStakeView,\n amount: bigint,\n): UnstakeGuard {\n if (amount <= 0n) return { ok: false, reason: \"InvalidAmount\" };\n if (stake.activeDraws > 0) return { ok: false, reason: \"StakeLocked\" };\n if (amount > stake.staked)\n return { ok: false, reason: \"InsufficientBalance\" };\n return { ok: true };\n}\n\n/** Throw a typed `Error` if the unstake would revert on-chain. */\nexport function assertCanUnstake(stake: JurorStakeView, amount: bigint): void {\n const g = canUnstake(stake, amount);\n if (!g.ok)\n throw new Error(\n `${g.reason}: cannot unstake ${amount} (staked=${stake.staked}, activeDraws=${stake.activeDraws})`,\n );\n}\n\n/** Validate a stake/unstake `amount` is a positive u64 (lib.rs:208 / 270). */\nexport function assertValidAmount(amount: bigint): void {\n if (amount <= 0n)\n throw new Error(`InvalidAmount: expected > 0, got ${amount}`);\n if (amount > U64_MAX)\n throw new Error(`InvalidAmount: exceeds u64, got ${amount}`);\n}\n\n/** u64 → 8-byte little-endian. */\nfunction le8(v: bigint): Uint8Array {\n const b = new Uint8Array(8);\n new DataView(b.buffer).setBigUint64(0, v, true);\n return b;\n}\n\n/** JurorStake PDA seeds (state.rs:1732): `[\"stake\", subaccord, juror]`. */\nexport function jurorStakeSeeds(\n subaccordBytes: Uint8Array,\n jurorBytes: Uint8Array,\n): Uint8Array[] {\n if (subaccordBytes.length !== 32)\n throw new Error(\"InvalidSubaccord: expected 32 bytes\");\n if (jurorBytes.length !== 32)\n throw new Error(\"InvalidJuror: expected 32 bytes\");\n return [SEED_JUROR_STAKE, subaccordBytes, jurorBytes];\n}\n\n/** Derive the canonical JurorStake PDA. */\nexport async function findJurorStakePda(\n programAddress: Address,\n subaccord: Address,\n juror: Address,\n): Promise<{ address: Address; bump: number }> {\n const enc = getAddressEncoder();\n const [address, bump] = await getProgramDerivedAddress({\n programAddress,\n seeds: jurorStakeSeeds(\n new Uint8Array(enc.encode(subaccord)),\n new Uint8Array(enc.encode(juror)),\n ),\n });\n return { address, bump };\n}\n\n/** Accounts shared by `stake` / `unstake` (the juror signs). */\nexport interface StakingAccounts {\n juror: Address;\n subaccord: Address;\n /** `stake` only — the ADR-0007 circuit breaker (unstake is never halted). */\n accordState?: Address;\n jurorStake: Address;\n stakingToken: Address;\n /** Juror's ATA of the staking token (source on stake, dest on unstake). */\n jurorTokenAccount: Address;\n /** Subaccord PDA's stake_vault ATA (dest on stake, source on unstake). */\n stakeVault: Address;\n}\n\n/**\n * Seam to the Codama-generated Kit client + JurorStake fetcher. Foundation\n * wires the concrete adapter; staking.ts stays orchestration-only.\n *\n * ADR-0012: `stake`/`unstake` take a client-supplied accumulator `path`\n * (sibling hash + sum per level). The chain verifies it against the stored\n * root and recomputes a new canonical root — O(log N). A wrong path reverts;\n * build it via `proofFor(tree, jurorIndex)` from `./mst.js`.\n */\nexport interface AccordStakingClient {\n buildStake(input: {\n programId: Address;\n accounts: StakingAccounts;\n amount: bigint;\n path: MSTNode[];\n attestation?: Address;\n }): Instruction;\n buildRequestWithdraw(input: {\n programId: Address;\n accounts: StakingAccounts;\n amount: bigint;\n path: MSTNode[];\n }): Instruction;\n buildWithdraw(input: {\n programId: Address;\n accounts: StakingAccounts;\n }): Instruction;\n buildReconcileStake(input: {\n programId: Address;\n accounts: StakingAccounts;\n path: MSTNode[];\n }): Instruction;\n buildReclaimSlot(input: {\n programId: Address;\n accounts: { subaccord: Address; jurorStake: Address };\n path: MSTNode[];\n }): Instruction;\n /** Fetch the decoded JurorStake fields the guard needs. */\n fetchJurorStake(jurorStake: Address): Promise<JurorStakeView | null>;\n /** Build `withdraw_fees` (ADR-0020). */\n buildWithdrawFees(input: {\n programId: Address;\n accounts: WithdrawFeesAccounts;\n }): Instruction;\n /**\n * Build `prune_juror` (PROG-ATTESTATION) — permissionless crank that evicts\n * an expired juror's stake from a credential-gated Subaccord. The cranker\n * signs; the expired `juror` does not. `attestation` is appended as\n * `remaining_accounts[0]` (read-only).\n */\n buildPruneJuror(input: {\n programId: Address;\n accounts: PruneJurorAccounts;\n path: MSTNode[];\n attestation: Address;\n }): Instruction;\n}\n\n/** Build `stake` (lib.rs). SPL-transfers `amount` into the vault.\n *\n * RECLAIM-LEAF free-list accounts (accord-b5v5 — the list is doubly linked;\n * neighbors are appended as remaining accounts after the optional\n * attestation, in list order):\n * - **New juror popping the head** (`is_new_leaf` + `freeHead != MAX`):\n * `freedSlotAccount` = the freed head node, `nextNeighborAccount` = the\n * new head (required when the freed node has a successor, so its\n * `prevFree` can be cleared).\n * - **Returning juror splicing their own reclaimed slot out** (any list\n * position): `freedSlotAccount` = the predecessor (required when the\n * juror's `prevFree != MAX`), `nextNeighborAccount` = the successor\n * (required when `nextFree != MAX`). Discover both off-chain from the\n * juror's own JurorStake pointers. */\nexport function stake(\n client: AccordStakingClient,\n programId: Address,\n accounts: StakingAccounts,\n amount: bigint,\n path: MSTNode[],\n /** PROG-ATTESTATION: juror SAS attestation (required on credential-gated Subaccords). */\n attestation?: Address,\n /** Free-list neighbor #1: the freed head (pop path) or the predecessor (splice path). */\n freedSlotAccount?: Address,\n /** Free-list neighbor #2: the new head (pop path) or the successor (splice path). */\n nextNeighborAccount?: Address,\n): Instruction {\n assertValidAmount(amount);\n // An empty `path` is the canonical proof for a depth-0 Subaccord (single\n // leaf = root). The on-chain verifier authenticates the path against the\n // stored root + depth; do not reject it here (REVIEW #13).\n const ix = client.buildStake({ programId, accounts, amount, path, attestation });\n // RECLAIM-LEAF: append the free-list neighbor PDAs as remaining accounts\n // (writable). The adapter placed the attestation (if any) at\n // remaining_accounts[0]; the neighbors follow at [1],[2] on gated pools, or\n // [0],[1] on stake-only pools — matching the on-chain gated-aware layout.\n const neighbors = [freedSlotAccount, nextNeighborAccount].filter(\n (a): a is Address => a !== undefined,\n );\n if (neighbors.length > 0) {\n return {\n ...ix,\n accounts: [\n ...(ix.accounts ?? []),\n ...neighbors.map((address) => ({\n address,\n role: AccountRole.WRITABLE,\n })),\n ],\n };\n }\n return ix;\n}\n\n/**\n * Build `request_withdraw` (lib.rs) — phase 1 of the two-phase withdraw\n * (REVIEW #5). Ledger-only: subtracts `amount` from `JurorStake.amount`, banks\n * it in `pending_withdrawal`, and recomputes the accumulator root. No tokens\n * move; no `active_draws` gate (the lock is enforced at `withdraw`). Allowed\n * while paused. `path` is the juror's accumulator proof (ADR-0012).\n *\n * Precondition: `settlementDelta == 0` — call `reconcileStake` first when the\n * juror has a pending reward/slash. DRY with `reconcileStake` (the delta fold\n * lives in one place); withdraw only ever reads the canonical `amount`.\n */\nexport function requestWithdraw(\n client: AccordStakingClient,\n programId: Address,\n accounts: StakingAccounts,\n amount: bigint,\n path: MSTNode[],\n): Instruction {\n assertValidAmount(amount);\n // Empty `path` is valid for depth-0 Subaccords (REVIEW #13).\n return client.buildRequestWithdraw({ programId, accounts, amount, path });\n}\n\n/**\n * Build `withdraw` (lib.rs:407) — phase 2 of the two-phase withdraw. Moves the\n * banked `pending_withdrawal` from the vault to the juror's ATA. On-chain gates:\n * `WITHDRAWAL_DELAY` elapsed since `request_withdraw` AND `active_draws == 0`.\n * No args — reads `pending_withdrawal` from `JurorStake`.\n */\nexport function withdraw(\n client: AccordStakingClient,\n programId: Address,\n accounts: StakingAccounts,\n): Instruction {\n if (\n !accounts.stakingToken ||\n !accounts.jurorTokenAccount ||\n !accounts.stakeVault\n ) {\n throw new Error(\n \"InvalidWithdrawAccounts: withdraw requires stakingToken, jurorTokenAccount, stakeVault\",\n );\n }\n return client.buildWithdraw({ programId, accounts });\n}\n\n/**\n * Build `reconcile_stake` (lib.rs:460) — permissionless crank (REVIEW #4) that\n * folds a juror's `settlement_delta` into their canonical `amount` and updates\n * the accumulator root via a Merkle proof. After reconcile, the ledger and the\n * accumulator agree again. No tokens move; any caller may trigger it. `path` is\n * the juror's accumulator proof (ADR-0012).\n */\nexport function reconcileStake(\n client: AccordStakingClient,\n programId: Address,\n accounts: StakingAccounts,\n path: MSTNode[],\n): Instruction {\n // Empty `path` is valid for depth-0 Subaccords (REVIEW #13).\n return client.buildReconcileStake({ programId, accounts, path });\n}\n\n/**\n * Build `reclaim_slot` (RECLAIM-LEAF) — permissionless crank that pushes a\n * fully-drained JurorStake's `tree_index` onto the free list, blanking the\n * leaf identity to `(default, 0)`. This recycles the tree slot for reuse by a\n * new staker. No tokens move; any caller may trigger it. `path` is the juror's\n * accumulator proof (ADR-0012).\n *\n * Preconditions: the juror must be fully drained (`staked == 0`,\n * `active_draws == 0`, `stake_delta == 0`, `fees_earned == 0`).\n *\n * accord-b5v5: the free list is doubly linked — when the list is non-empty\n * (`subaccord.freeHead != MAX`), `headSlotAccount` (the CURRENT head's\n * JurorStake PDA) is required so its `prevFree` can be rewired to the pushed\n * index. Omit it only when the list is empty.\n */\nexport function reclaimSlot(\n client: AccordStakingClient,\n programId: Address,\n accounts: { subaccord: Address; jurorStake: Address },\n path: MSTNode[],\n headSlotAccount?: Address,\n): Instruction {\n const ix = client.buildReclaimSlot({ programId, accounts, path });\n if (headSlotAccount) {\n return {\n ...ix,\n accounts: [\n ...(ix.accounts ?? []),\n { address: headSlotAccount, role: AccountRole.WRITABLE },\n ],\n };\n }\n return ix;\n}\n\n/** Accounts for `withdraw_fees` (ADR-0020). */\nexport interface WithdrawFeesAccounts {\n juror: Address;\n subaccord: Address;\n jurorStake: Address;\n feeToken: Address;\n /** Juror's ATA of the fee token (withdraw destination). */\n jurorFeeTokenAccount: Address;\n /** Subaccord PDA's fee_vault ATA (withdraw source). */\n feeVault: Address;\n}\n\n/**\n * Accounts for `prune_juror` (PROG-ATTESTATION). `caller` is the cranker\n * (signer = the adapter's wallet); `juror` is the EXPIRED juror being pruned\n * (NOT a signer — read-only on chain). Mirrors the on-chain `PruneJuror` struct\n * (lib.rs).\n */\nexport interface PruneJurorAccounts {\n caller: Address;\n juror: Address;\n subaccord: Address;\n jurorStake: Address;\n}\n\n/**\n * Build `withdraw_fees` (ADR-0020). Per-juror: pulls aggregate `fees_earned`\n * from the Subaccord's `fee_vault` → the juror's `fee_token` ATA. No\n * `active_draws` gate, no timelock — earned fees are not at-risk capital.\n */\nexport function withdrawFees(\n client: AccordStakingClient,\n programId: Address,\n accounts: WithdrawFeesAccounts,\n): Instruction {\n return client.buildWithdrawFees({ programId, accounts });\n}\n\n/**\n * Build `prune_juror` (PROG-ATTESTATION) — permissionless crank. Evicts an\n * expired juror's `JurorStake` from a credential-gated Subaccord and recomputes\n * the accumulator root via `path`. The cranker (`caller`) signs; the expired\n * `juror` does NOT. `attestation` is the expired juror's SAS attestation,\n * passed as `remaining_accounts[0]` (read-only) so the handler can revoke it.\n */\nexport function pruneJuror(\n client: AccordStakingClient,\n programId: Address,\n accounts: PruneJurorAccounts,\n path: MSTNode[],\n attestation: Address,\n): Instruction {\n if (!attestation) {\n throw new Error(\n \"PruneJurorMissingAttestation: pruneJuror requires the expired juror's SAS attestation\",\n );\n }\n return client.buildPruneJuror({ programId, accounts, path, attestation });\n}\n","/**\n * settlement.ts — per-round settlement crank + dispute cancellation.\n *\n * `settle_round` is the permissionless per-round crank that settles a single\n * round's economics (slashing incoherent jurors + redistributing the pool) once\n * revealed. `cancel_dispute` refunds the filer's fee when a round fails to\n * reach a ruling within its timeout window — a permissionless timeout exit.\n *\n * Same ADR-0010 facade pattern: pure orchestration over a typed\n * {@link AccordSettlementClient} seam; Kit type-only; `remainingAccounts`\n * carry the JurorStake / Round / AppealBond PDAs the handlers mutate.\n *\n * Sources of truth:\n * - settle_round: programs/accord/src/lib.rs (1291)\n * - cancel_dispute: programs/accord/src/lib.rs (1539)\n */\nimport type { Address, Instruction } from \"@solana/kit\";\n\n/** Accounts for `settle_round`. */\nexport interface SettleRoundAccounts {\n /** Any caller (permissionless crank). Signer. */\n caller: Address;\n subaccord: Address;\n dispute: Address;\n round: Address;\n}\n\nexport interface CancelDisputeAccounts {\n /** Any caller (permissionless crank). Signer. */\n caller: Address;\n subaccord: Address;\n dispute: Address;\n feeToken: Address;\n /** Filer's ATA — refund destination (owner checked on-chain). */\n filerTokenAccount: Address;\n feeVault: Address;\n}\n\n/** Accounts for `claim_filing_bounty` (ADR-0030). */\nexport interface ClaimFilingBountyAccounts {\n /** Any caller (permissionless crank). Signer. */\n caller: Address;\n subaccord: Address;\n dispute: Address;\n feeToken: Address;\n /** Filer's ATA — sweep destination (pinned to `dispute.filer` on-chain). */\n filerTokenAccount: Address;\n feeVault: Address;\n}\n\n/**\n * Seam to the Codama-generated Kit client (ADR-0010). Foundation wires the\n * concrete adapter; settlement.ts stays orchestration-only.\n */\nexport interface AccordSettlementClient {\n buildSettleRound(input: {\n programId: Address;\n accounts: SettleRoundAccounts;\n roundIdx: number;\n /** remaining_accounts: drawn JurorStake PDAs the crank mutates. */\n remainingAccounts: Address[];\n }): Instruction;\n buildCancelDispute(input: {\n programId: Address;\n accounts: CancelDisputeAccounts;\n /** remaining_accounts: Round + JurorStake + AppealBond PDAs. */\n remainingAccounts: Address[];\n }): Instruction;\n buildClaimFilingBounty(input: {\n programId: Address;\n accounts: ClaimFilingBountyAccounts;\n }): Instruction;\n}\n\n/**\n * Build the permissionless `settle_round` crank (lib.rs:1291). Settles one\n * round's economics after reveal — slashing incoherent jurors, redistributing\n * the pool. `roundIdx` selects the round; `remainingAccounts` are the drawn\n * JurorStake PDAs for that round (writable, mutated for slashes/rewards).\n */\nexport function settleRound(\n client: AccordSettlementClient,\n programId: Address,\n accounts: SettleRoundAccounts,\n roundIdx: number,\n remainingAccounts: Address[],\n): Instruction {\n if (!Number.isInteger(roundIdx) || roundIdx < 0 || roundIdx > 0xffffffff) {\n throw new Error(`InvalidRoundIdx: expected u32, got ${roundIdx}`);\n }\n return client.buildSettleRound({\n programId,\n accounts,\n roundIdx,\n remainingAccounts,\n });\n}\n\n/**\n * Build the permissionless `cancel_dispute` crank (lib.rs:1539). Refunds the\n * filer's fee when a round times out without a ruling. `remainingAccounts`\n * carries the Round + JurorStake + AppealBond PDAs the handler closes/refunds.\n */\nexport function cancelDispute(\n client: AccordSettlementClient,\n programId: Address,\n accounts: CancelDisputeAccounts,\n remainingAccounts: Address[],\n): Instruction {\n return client.buildCancelDispute({\n programId,\n accounts,\n remainingAccounts,\n });\n}\n\n/**\n * Build the permissionless `claim_filing_bounty` crank (ADR-0030). Sweeps the\n * flip-bounty pool back to the filer when a dispute finalized WITHOUT ever\n * being appealed (`current_round == 0` at Final) — the filer's filing-time\n * `+1 · fee_per_juror` unit. Every other terminal shape disposes of the pool\n * elsewhere (finalize_dispute / the Failed transitions). Idempotent\n * on-chain (the pool is zeroed on payout).\n */\nexport function claimFilingBounty(\n client: AccordSettlementClient,\n programId: Address,\n accounts: ClaimFilingBountyAccounts,\n): Instruction {\n return client.buildClaimFilingBounty({ programId, accounts });\n}\n","/**\n * mst.ts — subtree-sum stake accumulator builder (ADR-0012).\n *\n * Replaces the ADR-0009 cumulative-from-left snapshot MST. The on-chain\n * program maintains only the root (`Subaccord.root_hash` + `total_stake`);\n * the full tree lives off-chain (indexers). This module is the byte-exact\n * reference the chain verifies against:\n *\n * leaf = H(juror[32] ‖ stake_le[8])\n * node = H(left_hash[32] ‖ left_sum_le[8] ‖ right_hash[32] ‖ right_sum_le[8])\n * node.sum = left_sum + right_sum\n *\n * Sums are bound into node hashes, so stake-weighted ranges are\n * cryptographically authenticated (CONCEPT-REVIEW Bad 5, fixed by\n * construction). A one-leaf change touches only that leaf's ancestors →\n * O(log N) updates via {@link proofFor}.\n *\n * Sortition uses the cumulative-from-left prefix (sum of left-sibling subtree\n * sums on right-branch levels), reconstructed from the authenticated path:\n * the selected leaf's range is `[prefix, prefix + stake)`.\n *\n * Sources of truth:\n * - on-chain helpers: programs/accord/src/lib.rs (mst_leaf_hash, mst_node_hash,\n * empty_tree_root, verify_and_recompute, verify_membership_and_prefix)\n * - state: LeafClaim / MSTNode in programs/accord/src/state.rs\n *\n * @see ADR-0012\n */\n\n// ---------------------------------------------------------------------------\n// Types (byte-oriented; the generated Address-typed variants are used at the\n// instruction boundary in adapter.ts)\n// ---------------------------------------------------------------------------\n\n/** A subtree-sum proof element: the sibling subtree's hash + total stake. */\nexport interface MSTNode {\n siblingHash: Uint8Array; // 32 bytes\n siblingSum: bigint; // u64\n}\n\n/** A leaf of the accumulator: `(juror, stake)`. */\nexport interface LeafClaim {\n juror: Uint8Array; // 32 bytes\n stake: bigint; // u64\n}\n\n/**\n * Internal cache of all hash/sum levels. `levels[0]` = leaf hashes,\n * `levels[d]` = root. Stored so `proofFor` is O(log N) instead of O(N).\n */\ninterface LevelCache {\n hashes: Uint8Array[][];\n sums: bigint[][];\n}\n\n/** A built accumulator: leaves + the canonical root. */\nexport interface MerkleAccumulator {\n /** Fixed tree depth (bounds the pool at 2^depth). */\n depth: number;\n /** Index → leaf. Empty slots hold the all-zero leaf `(default, 0)`. */\n leaves: LeafClaim[];\n rootHash: Uint8Array; // 32 bytes\n rootSum: bigint; // == total stake\n /** Opaque cache — don't inspect; use {@link proofFor}. */\n _levels?: LevelCache;\n}\n\n/** Maximum depth the SDK accepts. The on-chain program allows up to 31, but\n * `buildAccumulator` hashes `2^depth` leaves — impractical beyond 20 in a\n * browser. Deeper pools should use a dedicated indexer for proofs. */\nexport const MAX_SDK_DEPTH = 20;\n\n// ---------------------------------------------------------------------------\n// Hashing — must match solana_program::hash::hashv (SHA-256 over concat).\n// ---------------------------------------------------------------------------\n\nasync function sha256(...parts: Uint8Array[]): Promise<Uint8Array> {\n let len = 0;\n for (const p of parts) len += p.length;\n const buf = new Uint8Array(len);\n let off = 0;\n for (const p of parts) {\n buf.set(p, off);\n off += p.length;\n }\n return new Uint8Array(await globalThis.crypto.subtle.digest(\"SHA-256\", buf));\n}\n\nfunction le8(v: bigint): Uint8Array {\n const b = new Uint8Array(8);\n new DataView(b.buffer).setBigUint64(0, v, true);\n return b;\n}\n\n/** Leaf hash `H(juror ‖ stake_le)` (lib.rs mst_leaf_hash). */\nexport async function leafHash(\n juror: Uint8Array,\n stake: bigint,\n): Promise<Uint8Array> {\n if (juror.length !== 32) throw new Error(\"InvalidJuror: expected 32 bytes\");\n return sha256(juror, le8(stake));\n}\n\n/** Node hash `H(left_hash ‖ left_sum ‖ right_hash ‖ right_sum)` (lib.rs mst_node_hash). */\nasync function nodeHash(\n leftHash: Uint8Array,\n leftSum: bigint,\n rightHash: Uint8Array,\n rightSum: bigint,\n): Promise<Uint8Array> {\n return sha256(leftHash, le8(leftSum), rightHash, le8(rightSum));\n}\n\n/** Root hash of an all-zero tree at `depth` (lib.rs empty_tree_root). */\nexport async function emptyRoot(depth: number): Promise<Uint8Array> {\n let h = await leafHash(new Uint8Array(32), 0n);\n for (let i = 0; i < depth; i++) {\n h = await nodeHash(h, 0n, h, 0n);\n }\n return h;\n}\n\n// ---------------------------------------------------------------------------\n// Builder\n// ---------------------------------------------------------------------------\n\n/**\n * Build a depth-`depth` accumulator from `leaves` (index = position), padding\n * the remaining `2^depth` slots with zero leaves. Returns the canonical root\n * the on-chain program would hold after these stakes (the audit property: an\n * off-chain rebuild from `JurorStake` via `getProgramAccounts` reproduces it).\n *\n * Caches all intermediate hash levels so {@link proofFor} is O(log N).\n */\nexport async function buildAccumulator(\n leaves: LeafClaim[],\n depth: number,\n): Promise<MerkleAccumulator> {\n if (!Number.isInteger(depth) || depth < 0 || depth > MAX_SDK_DEPTH) {\n throw new Error(`InvalidDepth: expected 0..${MAX_SDK_DEPTH}, got ${depth}`);\n }\n const size = 2 ** depth;\n if (leaves.length > size) {\n throw new Error(\n `TreeFull: ${leaves.length} leaves exceed 2^depth(${depth})=${size}`,\n );\n }\n const padded: LeafClaim[] = new Array(size);\n for (let i = 0; i < size; i++) {\n padded[i] =\n i < leaves.length ? leaves[i]! : { juror: new Uint8Array(32), stake: 0n };\n }\n\n const levelHashes: Uint8Array[][] = [];\n const levelSums: bigint[][] = [];\n\n levelHashes.push(\n await Promise.all(padded.map((l) => leafHash(l.juror, l.stake))),\n );\n levelSums.push(padded.map((l) => l.stake));\n\n let hashes = levelHashes[0]!;\n let sums = levelSums[0]!;\n for (let level = 0; level < depth; level++) {\n const nextH: Uint8Array[] = [];\n const nextS: bigint[] = [];\n for (let k = 0; k < hashes.length; k += 2) {\n nextH.push(\n await nodeHash(hashes[k]!, sums[k]!, hashes[k + 1]!, sums[k + 1]!),\n );\n nextS.push(sums[k]! + sums[k + 1]!);\n }\n levelHashes.push(nextH);\n levelSums.push(nextS);\n hashes = nextH;\n sums = nextS;\n }\n\n return {\n depth,\n leaves: padded,\n rootHash: hashes[0]!,\n rootSum: sums[0]!,\n _levels: { hashes: levelHashes, sums: levelSums },\n };\n}\n\n// ---------------------------------------------------------------------------\n// Proofs + verification\n// ---------------------------------------------------------------------------\n\n/**\n * The client-supplied Merkle path for `index` (sibling hash + sum per level,\n * leaf → root). Used by `stake`/`requestWithdraw`/`reconcileStake`\n * (verify-and-recompute) and by `draw_seat` (membership + sortition prefix).\n *\n * O(log N) — reads siblings from the cached levels built by\n * {@link buildAccumulator}. Falls back to O(N) rehash if the cache is absent\n * (e.g. the accumulator was constructed by hand without `_levels`).\n */\nexport async function proofFor(\n tree: MerkleAccumulator,\n index: number,\n): Promise<MSTNode[]> {\n const size = 2 ** tree.depth;\n if (!Number.isInteger(index) || index < 0 || index >= size) {\n throw new Error(`InvalidIndex: expected 0..<${size}, got ${index}`);\n }\n\n // Fast path: read siblings from cached levels.\n if (tree._levels) {\n const path: MSTNode[] = [];\n let idx = index;\n for (let level = 0; level < tree.depth; level++) {\n const sib = idx % 2 === 0 ? idx + 1 : idx - 1;\n path.push({\n siblingHash: tree._levels.hashes[level]![sib]!,\n siblingSum: tree._levels.sums[level]![sib]!,\n });\n idx = Math.floor(idx / 2);\n }\n return path;\n }\n\n // Slow fallback: rebuild all levels (for hand-constructed accumulators).\n let hashes = await Promise.all(\n tree.leaves.map((l) => leafHash(l.juror, l.stake)),\n );\n let sums = tree.leaves.map((l) => l.stake);\n const path: MSTNode[] = [];\n let idx = index;\n for (let level = 0; level < tree.depth; level++) {\n const sib = idx % 2 === 0 ? idx + 1 : idx - 1;\n path.push({ siblingHash: hashes[sib]!, siblingSum: sums[sib]! });\n const nextH: Uint8Array[] = [];\n const nextS: bigint[] = [];\n for (let k = 0; k < hashes.length; k += 2) {\n nextH.push(\n await nodeHash(hashes[k]!, sums[k]!, hashes[k + 1]!, sums[k + 1]!),\n );\n nextS.push(sums[k]! + sums[k + 1]!);\n }\n hashes = nextH;\n sums = nextS;\n idx = Math.floor(idx / 2);\n }\n return path;\n}\n\n/** Reconstruct the path root from a leaf (for off-chain audit / debugging). */\nexport async function recomputeRoot(\n leaf: LeafClaim,\n index: number,\n path: MSTNode[],\n): Promise<{ hash: Uint8Array; sum: bigint }> {\n let h = await leafHash(leaf.juror, leaf.stake);\n let s = leaf.stake;\n let idx = index;\n for (const node of path) {\n const leafIsLeft = (idx & 1) === 0;\n if (leafIsLeft) {\n h = await nodeHash(h, s, node.siblingHash, node.siblingSum);\n } else {\n h = await nodeHash(node.siblingHash, node.siblingSum, h, s);\n }\n s = s + node.siblingSum;\n idx = Math.floor(idx / 2);\n }\n return { hash: h, sum: s };\n}\n\n/**\n * Verify `leaf` at `index` authenticates against `(rootHash, rootSum)` and\n * return the cumulative-from-left prefix (lib.rs verify_membership_and_prefix).\n * The leaf's sortition range is `[prefix, prefix + stake)`.\n */\nexport async function verifyMembership(\n leaf: LeafClaim,\n index: number,\n path: MSTNode[],\n rootHash: Uint8Array,\n rootSum: bigint,\n): Promise<{ ok: boolean; prefix: bigint }> {\n const { hash, sum } = await recomputeRoot(leaf, index, path);\n // prefix = sum of left-sibling subtree sums on levels where the leaf is the\n // right child (bit `level` of `index` is 1).\n let prefix = 0n;\n let idx = index;\n for (const node of path) {\n if ((idx & 1) === 1) prefix += node.siblingSum;\n idx = Math.floor(idx / 2);\n }\n const ok = eq(hash, rootHash) && sum === rootSum;\n return { ok, prefix };\n}\n\nfunction eq(a: Uint8Array, b: Uint8Array): boolean {\n if (a.length !== b.length) return false;\n let diff = 0;\n for (let i = 0; i < a.length; i++) diff |= a[i]! ^ b[i]!;\n return diff === 0;\n}\n","/**\n * vrf.ts — VRF request + per-seat draw choreography (ADR-0009 §2 + ADR-0012).\n *\n * 1. request_vrf — CPI into the magicblock VRF oracle (one-shot).\n * 2. commit_vrf_callback — oracle calls back; sets `dispute.committed_vrf`\n * AND atomically freezes `dispute.frozen_root`.\n * 3. draw_seat(seat, mem) — submit one seat's membership against the frozen\n * root. One tx per seat (1232B can't hold N proofs).\n *\n * The VRF result is committed ONCE and immutable. The frozen root is the live\n * accumulator root captured atomically at callback time — all N draw_seat txs\n * (and every appeal round) select against the SAME root.\n *\n * The chain is a dumb verifier: per seat `i`, it derives\n * vrf_seed = sha256(committed_vrf ‖ dispute ‖ round_idx_le4 ‖ draw_attempt_le4)\n * r_i = u64_le(sha256(vrf_seed ‖ seat_le4 ‖ retry_le4)[0..8]) % frozen_total_stake\n * and checks the submitted leaf's reconstructed prefix ranges contains `r_i`.\n * `draw_attempt` (ADR-0021) is orthogonal to `round_idx`: a shortfall redraw\n * increments it to re-seed the panel at the same size (no appeal consumed).\n * Deterministic collision re-roll (sampling without replacement) is computed\n * client-side to match the chain — bean accord-tzo0.\n *\n * Sources of truth:\n * - request_vrf / commit_vrf_callback / draw_seat: lib.rs\n * - sortition criterion: ADR-0009 §2 (subtree-sum form, ADR-0012)\n */\nimport type { Address, Instruction } from \"@solana/kit\";\nimport { MAX_SORTITION_RETRIES } from \"../constants.js\";\nimport {\n type LeafClaim,\n type MSTNode,\n type MerkleAccumulator,\n proofFor,\n verifyMembership,\n} from \"./mst.js\";\n\n// ---------------------------------------------------------------------------\n// Pure crypto helpers (sha256 via Web Crypto; le encoders)\n// ---------------------------------------------------------------------------\n\nasync function sha256(...parts: Uint8Array[]): Promise<Uint8Array> {\n let len = 0;\n for (const p of parts) len += p.length;\n const buf = new Uint8Array(len);\n let off = 0;\n for (const p of parts) {\n buf.set(p, off);\n off += p.length;\n }\n return new Uint8Array(await globalThis.crypto.subtle.digest(\"SHA-256\", buf));\n}\n\nfunction le4(v: number): Uint8Array {\n const b = new Uint8Array(4);\n new DataView(b.buffer).setUint32(0, v, true);\n return b;\n}\n\n/** First 8 bytes of a hash, read little-endian as a u64. */\nfunction leU64At(b: Uint8Array, off = 0): bigint {\n return new DataView(b.buffer, b.byteOffset, b.byteLength).getBigUint64(\n off,\n true,\n );\n}\n\n// ---------------------------------------------------------------------------\n// Sortition slot derivation (lib.rs draw_seat) — pure, deterministic\n// ---------------------------------------------------------------------------\n\n/**\n * `vrf_seed = sha256(committed_vrf ‖ dispute ‖ round_idx_le4 ‖ draw_attempt_le4)`\n * (lib.rs draw_seat, ADR-0021). Binds the committed VRF to this dispute + round\n * + redraw attempt. `drawAttempt` defaults to 0 (the initial draw); a shortfall\n * redraw bumps it so the same panel size yields fresh seats.\n */\nexport async function vrfSeed(\n committedVrf: Uint8Array,\n disputeBytes: Uint8Array,\n roundIdx: number,\n drawAttempt: number = 0,\n): Promise<Uint8Array> {\n if (committedVrf.length !== 32)\n throw new Error(\"InvalidVrf: expected 32 bytes\");\n if (disputeBytes.length !== 32)\n throw new Error(\"InvalidDispute: expected 32 bytes\");\n if (!Number.isInteger(roundIdx) || roundIdx < 0 || roundIdx > 0xffffffff)\n throw new Error(`InvalidRoundIdx: expected u32, got ${roundIdx}`);\n if (\n !Number.isInteger(drawAttempt) ||\n drawAttempt < 0 ||\n drawAttempt > 0xffffffff\n )\n throw new Error(`InvalidDrawAttempt: expected u32, got ${drawAttempt}`);\n return sha256(committedVrf, disputeBytes, le4(roundIdx), le4(drawAttempt));\n}\n\n/**\n * Derive the sortition point for a single seat at a given retry:\n * `r_i = u64_le(sha256(vrf_seed ‖ seat_le4 ‖ retry_le4)[0..8]) % frozen_total_stake`.\n * `retry` defaults to 0 (the common case — no collision). The on-chain\n * `draw_seat` includes the same retry counter in its sortition hash and verifies\n * that every prior retry (0..retries) genuinely collided with an already-drawn\n * juror (bean accord-tzo0).\n */\nexport async function seatSlot(\n committedVrf: Uint8Array,\n disputeBytes: Uint8Array,\n roundIdx: number,\n seat: number,\n frozenTotalStake: bigint,\n retry: number = 0,\n drawAttempt: number = 0,\n): Promise<bigint> {\n if (frozenTotalStake <= 0n) throw new Error(\"InvalidTotalStake: must be > 0\");\n if (!Number.isInteger(seat) || seat < 0 || seat > 0xffffffff)\n throw new Error(`InvalidSeat: expected u32, got ${seat}`);\n if (!Number.isInteger(retry) || retry < 0)\n throw new Error(\n `InvalidRetry: expected non-negative integer, got ${retry}`,\n );\n const seed = await vrfSeed(committedVrf, disputeBytes, roundIdx, drawAttempt);\n const rHash = await sha256(seed, le4(seat), le4(retry));\n return leU64At(rHash, 0) % frozenTotalStake;\n}\n\n/**\n * Find the leaf in `tree` whose sortition range `[prefix, prefix+stake)`\n * contains `slot`, and return it with its index + proof. Returns `null` if the\n * slot lands in a zero-stake gap (no eligible leaf).\n */\nexport async function findLeafForSlot(\n tree: MerkleAccumulator,\n slot: bigint,\n): Promise<{ leaf: LeafClaim; index: number; proof: MSTNode[] } | null> {\n let running = 0n;\n for (let i = 0; i < tree.leaves.length; i++) {\n const leaf = tree.leaves[i]!;\n if (leaf.stake > 0n && slot >= running && slot - running < leaf.stake) {\n const proof = await proofFor(tree, i);\n return { leaf, index: i, proof };\n }\n running += leaf.stake;\n }\n return null;\n}\n\n/**\n * Resolve a single seat using the deterministic collision re-roll algorithm\n * (bean accord-tzo0). Iterates `retry = 0, 1, 2, …` computing\n * `r_i = sha256(seed ‖ seat ‖ retry) % total_stake`; the first retry whose\n * selected leaf is NOT in `alreadyDrawn` is the terminal. Returns the leaf,\n * proof, and the `retries` count the cranker must submit to `draw_seat`.\n *\n * The on-chain verifier independently confirms every prior retry collided — so\n * there is exactly one valid (leaf, retries) pair per seat. No caller choice.\n */\nexport async function resolveSeat(\n committedVrf: Uint8Array,\n disputeBytes: Uint8Array,\n roundIdx: number,\n seat: number,\n tree: MerkleAccumulator,\n alreadyDrawn: Uint8Array[],\n maxRetries: number = MAX_SORTITION_RETRIES,\n drawAttempt: number = 0,\n): Promise<{\n leaf: LeafClaim;\n index: number;\n proof: MSTNode[];\n retries: number;\n}> {\n const total = tree.rootSum;\n if (total <= 0n) throw new Error(\"InvalidTotalStake: must be > 0\");\n const drawnHex = new Set(alreadyDrawn.map((j) => hex(j)));\n for (let retry = 0; retry <= maxRetries; retry++) {\n const slot = await seatSlot(\n committedVrf,\n disputeBytes,\n roundIdx,\n seat,\n total,\n retry,\n drawAttempt,\n );\n const found = await findLeafForSlot(tree, slot);\n if (found && !drawnHex.has(hex(found.leaf.juror))) {\n return { ...found, retries: retry };\n }\n // else: collision (already drawn) or zero-stake gap → re-roll\n }\n throw new Error(\n `MaxRetriesExceeded: seat ${seat} could not resolve in ${maxRetries} retries`,\n );\n}\n\nfunction hex(b: Uint8Array): string {\n let s = \"\";\n for (const x of b) s += x.toString(16).padStart(2, \"0\");\n return s;\n}\n\n/** Verify a seat's membership reconstructs to the frozen root (client-side precheck). */\nexport async function verifySeat(\n leaf: LeafClaim,\n index: number,\n proof: MSTNode[],\n frozenRoot: Uint8Array,\n frozenTotalStake: bigint,\n): Promise<boolean> {\n const { ok } = await verifyMembership(\n leaf,\n index,\n proof,\n frozenRoot,\n frozenTotalStake,\n );\n return ok;\n}\n\n// ---------------------------------------------------------------------------\n// Seam (ADR-0010) + instruction orchestration\n// ---------------------------------------------------------------------------\n\n/** Accounts for `request_vrf` / `draw_seat` (the cranker signs). */\nexport interface VrfDrawAccounts {\n caller: Address;\n subaccord: Address;\n dispute: Address;\n}\n\n/** Extra accounts `request_vrf` needs for the VRF oracle CPI. */\nexport interface RequestVrfExtras {\n /** magicblock VRF oracle queue account. */\n oracleQueue: Address;\n /** Accord program-identity PDA (CPI authority for the VRF oracle). */\n programIdentity: Address;\n}\n\n/**\n * One seat's resolved membership: the leaf `(juror, stake)` at `index` plus its\n * accumulator proof, the juror's `JurorStake` PDA (remaining_accounts[0]), and\n * the deterministic collision re-roll count (bean accord-tzo0).\n */\nexport interface SeatMembership {\n leaf: LeafClaim;\n index: number;\n proof: MSTNode[];\n jurorStake: Address;\n /** Number of sortition retries (collisions) before this leaf was selected. */\n retries: number;\n}\n\n/**\n * Seam to the Codama-generated Kit client + Dispute fetcher. Foundation wires\n * the concrete adapter; vrf.ts stays orchestration-only.\n */\nexport interface AccordVrfClient {\n buildRequestVrf(input: {\n programId: Address;\n accounts: VrfDrawAccounts;\n extras: RequestVrfExtras;\n }): Instruction;\n buildDrawSeat(input: {\n programId: Address;\n accounts: VrfDrawAccounts;\n /** Round PDA — `init_if_needed` by draw_seat (`[\"round\", dispute, current_round]`). */\n roundPda: Address;\n seat: number;\n /** Sortition collision re-roll count (bean accord-tzo0). */\n retries: number;\n leaf: LeafClaim;\n proof: MSTNode[];\n index: number;\n jurorStake: Address;\n }): Instruction;\n /** Read `committed_vrf` from a Dispute; `null` until the oracle callback lands. */\n fetchCommittedVrf(dispute: Address): Promise<Uint8Array | null>;\n}\n\n/** Build `request_vrf`. One-shot; triggers the oracle callback (freezes the root). */\nexport function requestVrf(\n client: AccordVrfClient,\n programId: Address,\n accounts: VrfDrawAccounts,\n extras: RequestVrfExtras,\n): Instruction {\n return client.buildRequestVrf({ programId, accounts, extras });\n}\n\n/**\n * Poll a Dispute's `committed_vrf` until the oracle callback lands (or\n * `timeoutMs` elapses). Returns the 32-byte randomness. Use between\n * {@link requestVrf} and {@link drawSeat}.\n */\nexport async function awaitCommittedVrf(\n client: AccordVrfClient,\n dispute: Address,\n opts: { pollIntervalMs?: number; timeoutMs?: number } = {},\n): Promise<Uint8Array> {\n const interval = opts.pollIntervalMs ?? 400;\n const deadline = Date.now() + (opts.timeoutMs ?? 30_000);\n while (Date.now() < deadline) {\n const vrf = await client.fetchCommittedVrf(dispute);\n if (vrf && vrf.length === 32) return vrf;\n await sleep(interval);\n }\n throw new Error(`VrfTimeout: committed_vrf not set on ${dispute}`);\n}\n\nfunction sleep(ms: number): Promise<void> {\n return new Promise((r) => setTimeout(r, ms));\n}\n\n/**\n * Build `draw_seat` for one seat (lib.rs). Pass the pre-resolved `seat` +\n * membership (from {@link resolveSeat}) and the juror's `JurorStake` PDA. The\n * round is `init_if_needed` on-chain and persists across the N seat txs.\n * `membership.retries` carries the deterministic collision re-roll count.\n */\nexport function drawSeat(\n client: AccordVrfClient,\n programId: Address,\n accounts: VrfDrawAccounts,\n roundPda: Address,\n seat: number,\n membership: SeatMembership,\n): Instruction {\n return client.buildDrawSeat({\n programId,\n accounts,\n roundPda,\n seat,\n retries: membership.retries,\n leaf: membership.leaf,\n proof: membership.proof,\n index: membership.index,\n jurorStake: membership.jurorStake,\n });\n}\n","/**\n * voting.ts — commit-reveal voting + finalization cranks (ADR-0010) with\n * scalar u64 votes (ADR-0025).\n *\n * The load-bearing client-side cryptography lives here: the commit hash\n * `sha256(vote_le[8] ‖ salt[32] ‖ juror_pubkey[32])`\n * where `vote_le` is the vote's 8-byte little-endian encoding — votes are\n * `u64` on the wire (option index for `Plurality`, fixed-point scalar in\n * settlement-mint base units for `Median`). The on-chain `reveal`\n * recomputes this via `solana_program::hash::hashv` (instructions/reveal.rs:\n * `hashv(&[&vote.to_le_bytes(), &salt, juror_key.as_ref()])`) and checks it\n * against the stored commitment. Mismatching the byte order or lengths here\n * silently breaks every dispute, so `commitHash` is unit-tested against a\n * hardcoded digest vector.\n *\n * Four instructions are orchestrated:\n * - {@link commit} juror commits `hash(vote, salt, juror)`.\n * - {@link reveal} juror reveals `{vote, salt}` (chain re-derives hash).\n * - {@link finalizeRound} permissionless crank: tally (plurality or median) → RoundResolved.\n * - {@link finalizeDispute} permissionless crank: settles economics, writes ruling.\n *\n * As in dispute.ts, the module is pure facade orchestration over a typed\n * {@link AccordVotingClient} seam that Foundation wires to the Codama-generated\n * Kit client. Kit is imported type-only (erased at runtime); the PDA helper\n * lazy-imports Kit so the unit tests load zero runtime deps.\n *\n * Sources of truth:\n * - commit/reveal/finalize_*: programs/accord/src/instructions/{commit,reveal,finalize_round,finalize_dispute}.rs\n * - Round struct + seeds: programs/accord/src/state.rs (Round, SEED_ROUND)\n */\nimport type { Address, Instruction } from \"@solana/kit\";\n\n/**\n * No-reveal sentinel: `u64::MAX` marks \"not revealed\" in `Round.reveals` and\n * \"not set\" in `Round.result` (ADR-0025; was `u8::MAX` before scalar votes).\n * Both aggregation modes reject it as an actual vote on-chain.\n */\nexport const NO_VOTE = 0xffff_ffff_ffff_ffffn;\n\n/** Round PDA seed prefix, `b\"round\"` (state.rs: SEED_ROUND). */\nconst SEED_ROUND = new Uint8Array([114, 111, 117, 110, 100]); // \"round\"\n\n/** Commit-hash preimage length: 8 vote bytes (u64 LE) + 32 salt + 32 juror pubkey. */\nconst COMMIT_PREIMAGE_LEN = 8 + 32 + 32;\n\n/**\n * Shared accounts every voting instruction takes (juror or cranker signs).\n *\n * `commit`/`reveal`/`finalizeRound`/`finalizeDispute` use only the first four.\n * The `stakingToken`/`jurorTokenAccount`/`vault` fields are vestigial: pre\n * ADR-0020 `reveal` paid a fee on reveal; under ADR-0029 no fee moves until\n * settlement. The adapter ignores them and the chain doesn't ask.\n * `tokenProgram` is a fixed constant.\n */\nexport interface VotingAccounts {\n /** Commit/reveal: the drawn juror. finalize_*: any cranker. Always a signer. */\n signer: Address;\n subaccord: Address;\n dispute: Address;\n round: Address;\n /** @deprecated vestigial — reveal no longer moves tokens (ADR-0020). */\n stakingToken?: Address;\n /** @deprecated vestigial — reveal no longer moves tokens (ADR-0020). */\n jurorTokenAccount?: Address;\n /** @deprecated vestigial — reveal no longer moves tokens (ADR-0020). */\n vault?: Address;\n}\n\n/** A juror's vote + salt (the reveal preimage). */\nexport interface VoteArgs {\n /**\n * The vote, `u64` on the wire (ADR-0025): an option index for `Plurality`\n * disputes or a scaled scalar for `Median` (see {@link encodeScalarVote}).\n */\n vote: bigint;\n /** 32-byte random salt — secret until reveal. */\n salt: Uint8Array;\n}\n\n/**\n * Compute the commit hash `sha256(vote_le[8] ‖ salt[32] ‖ juror_pubkey[32])`.\n *\n * Bit-for-bit compatible with the on-chain `reveal` check\n * (instructions/reveal.rs): `hashv(&[&vote.to_le_bytes(), &salt,\n * juror_key.as_ref()]).to_bytes()` — the vote is hashed as 8-byte\n * little-endian (ADR-0025), so the preimage is 72 bytes.\n *\n * Uses the Web Crypto API (`globalThis.crypto.subtle`): zero-dependency,\n * available in Node ≥ 18 and all browsers. `jurorBytes` is the juror's 32-byte\n * pubkey encoding (Kit's `getAddressEncoder().encode(juror)`).\n */\nexport async function commitHash(\n vote: bigint,\n salt: Uint8Array,\n jurorBytes: Uint8Array,\n): Promise<Uint8Array> {\n if (typeof vote !== \"bigint\" || vote < 0n || vote > NO_VOTE) {\n throw new Error(`InvalidVote: vote must fit a u64 bigint, got ${vote}`);\n }\n if (salt.length !== 32) {\n throw new Error(`InvalidSalt: expected 32 bytes, got ${salt.length}`);\n }\n if (jurorBytes.length !== 32) {\n throw new Error(\n `InvalidJuror: expected 32-byte pubkey, got ${jurorBytes.length}`,\n );\n }\n const preimage = new Uint8Array(COMMIT_PREIMAGE_LEN);\n new DataView(preimage.buffer).setBigUint64(0, vote, true); // vote LE\n preimage.set(salt, 8);\n preimage.set(jurorBytes, 40);\n const digest = await globalThis.crypto.subtle.digest(\"SHA-256\", preimage);\n return new Uint8Array(digest);\n}\n\n/**\n * Validate an option-index vote for `Plurality` disputes: `vote <\n * num_options` (instructions/reveal.rs). `Median` scalars carry no\n * client-side range beyond the u64 fit checked in {@link commitHash} and the\n * facades. Pure.\n */\nexport function assertValidVote(vote: bigint, numOptions: number): void {\n if (vote < 0n || vote >= BigInt(numOptions)) {\n throw new Error(`InvalidVote: expected 0..${numOptions}, got ${vote}`);\n }\n}\n\n/** Validate the salt is 32 bytes. Pure. */\nexport function assertValidSalt(salt: Uint8Array): void {\n if (salt.length !== 32) {\n throw new Error(`InvalidSalt: expected 32 bytes, got ${salt.length}`);\n }\n}\n\n/**\n * Client-side mirror of the vote gates common to both aggregation modes\n * (instructions/reveal.rs): the vote must be a u64 and must not be the\n * no-reveal sentinel — `Plurality` bounds it further to a real option index\n * ({@link assertValidVote}); `Median` only excludes the sentinel.\n */\nfunction assertVotable(vote: bigint): void {\n if (typeof vote !== \"bigint\" || vote < 0n || vote >= NO_VOTE) {\n throw new Error(\n `InvalidVote: expected a u64 below the no-reveal sentinel, got ${vote}`,\n );\n }\n}\n\n/**\n * Encode a human-readable scalar vote (ADR-0025 `Median` disputes) as the\n * u64 base-unit bigint the wire takes: `input · 10^decimals`. Accepts plain\n * decimal strings (`\"123\"`, `\"123.45\"`); rejects anything else (sign,\n * exponent, separators, empty string) and fractions longer than `decimals`.\n * The `u64` fit is enforced downstream ({@link commitHash} / the facades).\n * Inverse of {@link decodeScalarVote}.\n */\nexport function encodeScalarVote(input: string, decimals = 6): bigint {\n const m = /^([0-9]+)(?:\\.([0-9]+))?$/.exec(input);\n if (!m) {\n throw new Error(\n `InvalidScalarVote: expected a plain decimal string like \"123\" or \"123.45\", got ${JSON.stringify(input)}`,\n );\n }\n const frac = m[2] ?? \"\";\n if (frac.length > decimals) {\n throw new Error(\n `InvalidScalarVote: ${frac.length} fraction digits exceed decimals=${decimals}: ${JSON.stringify(input)}`,\n );\n }\n return BigInt(m[1]! + frac.padEnd(decimals, \"0\"));\n}\n\n/**\n * Decode a u64 base-unit vote back to a plain decimal string (inverse of\n * {@link encodeScalarVote}): `123450000n` → `\"123.45\"` at the default 6\n * decimals. Trailing fraction zeros are trimmed; a zero fraction collapses\n * to the integer form. Pure.\n */\nexport function decodeScalarVote(vote: bigint, decimals = 6): string {\n if (vote < 0n) {\n throw new Error(\n `InvalidScalarVote: expected a non-negative u64, got ${vote}`,\n );\n }\n if (decimals === 0) return vote.toString();\n const padded = vote.toString().padStart(decimals + 1, \"0\");\n const whole = padded.slice(0, -decimals);\n const frac = padded.slice(-decimals).replace(/0+$/, \"\");\n return frac ? `${whole}.${frac}` : whole;\n}\n\n/**\n * Build the Round PDA seed bytes (state.rs:2124):\n * `[\"round\", dispute.key(), ¤t_round.to_le_bytes()]`.\n *\n * `roundIdx` is `u32` little-endian (4 bytes). Pure + deterministic.\n */\nexport function roundSeeds(\n disputeBytes: Uint8Array,\n roundIdx: number,\n): Uint8Array[] {\n if (!Number.isInteger(roundIdx) || roundIdx < 0 || roundIdx > 0xffffffff) {\n throw new Error(`InvalidRoundIdx: expected u32, got ${roundIdx}`);\n }\n const le = new Uint8Array(4);\n new DataView(le.buffer).setUint32(0, roundIdx, true);\n return [SEED_ROUND, disputeBytes, le];\n}\n\n/** Derive the canonical Round PDA. Kit lazy-imported. */\nexport async function findRoundPda(\n programAddress: Address,\n dispute: Address,\n roundIdx: number,\n): Promise<{ address: Address; bump: number }> {\n const { getAddressEncoder, getProgramDerivedAddress } =\n await import(\"@solana/kit\");\n const disputeBytes = new Uint8Array(getAddressEncoder().encode(dispute));\n const [address, bump] = await getProgramDerivedAddress({\n programAddress,\n seeds: roundSeeds(disputeBytes, roundIdx),\n });\n return { address, bump };\n}\n\n/**\n * Seam to the Codama-generated Kit client (ADR-0010). Foundation provides the\n * concrete adapter; voting.ts stays orchestration-only, so it is parallel-safe\n * under fleet dispatch and compile-verifiable before the generator lands.\n */\nexport interface AccordVotingClient {\n buildCommit(input: {\n programId: Address;\n accounts: VotingAccounts;\n commitment: Uint8Array; // [u8; 32]\n }): Instruction;\n buildReveal(input: {\n programId: Address;\n accounts: VotingAccounts;\n vote: bigint;\n salt: Uint8Array;\n }): Instruction;\n buildFinalizeRound(input: {\n programId: Address;\n accounts: VotingAccounts;\n }): Instruction;\n buildFinalizeDispute(input: {\n programId: Address;\n accounts: VotingAccounts;\n /** remaining_accounts: drawn JurorStake PDAs (+ AppealBond PDAs). */\n remainingAccounts: Address[];\n }): Instruction;\n /** `redraw` (ADR-0021) — see {@link redraw}. */\n buildRedraw(input: {\n programId: Address;\n accounts: RedrawAccounts;\n remainingAccounts?: Address[];\n }): Instruction;\n /** Encode a juror Address to its 32-byte pubkey (Kit `getAddressEncoder`). */\n encodeAddress(address: Address): Uint8Array;\n}\n\n/**\n * Build a `commit` instruction: compute `commitHash(vote, salt, juror)` and\n * hand the 32-byte commitment to the chain (instructions/commit.rs). The\n * juror must be drawn into the round and inside the commit window; those\n * gates are enforced on-chain. Returns the instruction + the computed\n * commitment (for local bookkeeping / indexing).\n */\nexport async function commit(\n client: AccordVotingClient,\n programId: Address,\n accounts: VotingAccounts,\n args: VoteArgs,\n): Promise<{ instruction: Instruction; commitment: Uint8Array }> {\n assertValidSalt(args.salt);\n assertVotable(args.vote);\n const jurorBytes = client.encodeAddress(accounts.signer);\n const commitment = await commitHash(args.vote, args.salt, jurorBytes);\n const instruction = client.buildCommit({\n programId,\n accounts,\n commitment,\n });\n return { instruction, commitment };\n}\n\n/**\n * Build a `reveal` instruction with `{vote, salt}` (instructions/reveal.rs).\n * The chain recomputes `hash(vote_le ‖ salt ‖ juror)` and checks it equals\n * the stored commitment — so `args` MUST be the exact pair used in\n * {@link commit}.\n */\nexport function reveal(\n client: AccordVotingClient,\n programId: Address,\n accounts: VotingAccounts,\n args: VoteArgs,\n): Instruction {\n assertVotable(args.vote);\n assertValidSalt(args.salt);\n // ponytail: ADR-0020 moved reveal's fee credit to finalize_round — on-chain\n // Reveal (instructions/reveal.rs) takes only juror/subaccord/dispute/round.\n // The optional token fields on VotingAccounts are vestigial; the adapter\n // ignores them.\n return client.buildReveal({\n programId,\n accounts,\n vote: args.vote,\n salt: args.salt,\n });\n}\n\n/**\n * Build the permissionless `finalize_round` crank\n * (instructions/finalize_round.rs). After the reveal window elapses, anyone\n * can advance the dispute to `RoundResolved` with the tally winner written\n * to `round.result` (plurality option or median scalar, ADR-0025).\n * ADR-0029: credits nothing — the round's entire fee pot settles at\n * `settleRound`/`finalizeDispute` against the FINAL ruling. No\n * remaining_accounts.\n */\nexport function finalizeRound(\n client: AccordVotingClient,\n programId: Address,\n accounts: VotingAccounts,\n): Instruction {\n return client.buildFinalizeRound({ programId, accounts });\n}\n\n/**\n * Build the permissionless `finalize_dispute` crank\n * (instructions/finalize_dispute.rs). After the appeal window elapses,\n * anyone can settle the final round: slash incoherent\n * jurors, redistribute the pool, decrement `active_draws`, and write\n * `final_ruling` (transition to `Final`).\n *\n * `remainingAccounts` = the drawn `JurorStake` PDAs (panel), followed by one\n * `AppealBond` PDA per prior appeal (`current_round` of them). With no appeals\n * this collapses to just the juror stakes.\n */\nexport function finalizeDispute(\n client: AccordVotingClient,\n programId: Address,\n accounts: VotingAccounts,\n remainingAccounts: Address[],\n): Instruction {\n return client.buildFinalizeDispute({\n programId,\n accounts,\n remainingAccounts,\n });\n}\n\n// --- Shortfall redraw (ADR-0021) -------------------------------------------\n\n/**\n * Accounts for `redraw` (lib.rs). The Fail branch refunds the filer from\n * `feeVault`, so it carries the filer's `feeToken` ATA + the vault (validated\n * but unused on the Redraw branch).\n */\nexport interface RedrawAccounts {\n /** Permissionless cranker. */\n caller: Address;\n subaccord: Address;\n dispute: Address;\n /** The shortfall round (`dispute.current_round`). */\n round: Address;\n feeToken: Address;\n /** Filer's `feeToken` ATA — refund destination on exhaustion. */\n filerTokenAccount: Address;\n feeVault: Address;\n tokenProgram: Address;\n}\n\n/**\n * Build the permissionless `redraw` crank (lib.rs, ADR-0021). Only callable\n * from `RedrawEligible`. Slashes no-shows into `stake_delta`, bumps\n * `round.draw_attempt` (orthogonal to `round_idx` — same panel size, no appeal\n * consumed), clears the round → `Created`; on `draw_attempt + 1 ≥\n * max_draw_attempts` → `Failed` (filer `fee_paid` refunded, slashes stand).\n *\n * `remainingAccounts` = the round's drawn `JurorStake` PDAs (panel); on the Fail\n * branch additionally prior-round `Round` PDAs + their `JurorStake` PDAs + the\n * dispute's `AppealBond` PDAs (same layout as `cancel_dispute`).\n */\nexport function redraw(\n client: AccordVotingClient,\n programId: Address,\n accounts: RedrawAccounts,\n remainingAccounts: Address[] = [],\n): Instruction {\n return client.buildRedraw({ programId, accounts, remainingAccounts });\n}\n","/**\n * appeal.ts — dispute appeal + bond refund (ADR-0004).\n *\n * `appeal` is permissionless: any appellant pays the new (larger) round's fee\n * plus an equal bond, opening round `current_round + 1` with a `2N+1` panel\n * and resetting the dispute to `Created` so snapshot→draw→vote reruns. The\n * bond is custodied in a per-appeal `AppealBond` PDA keyed by the round it\n * opened.\n *\n * `claim_appeal_refund` returns a FLIPPED bond to its appellant after\n * `finalize_dispute` (no-flip bonds are folded into the coherent pool there).\n * Idempotent: zeroing the bond on payout makes re-invocation a no-op.\n *\n * Client-side helpers mirror the on-chain appeal ladder (`panel_size_for_round`,\n * lib.rs:2555) and cost math so the facade can quote a panel + fee before\n * sending. Same ADR-0010 facade pattern: Kit type-only, PDA lazy.\n *\n * Sources of truth:\n * - appeal / claim_appeal_refund: lib.rs:1643 (appeal), :1772 (claim_appeal_refund)\n * - Appeal / ClaimAppealRefund accounts: lib.rs:3422 (Appeal), :3486 (ClaimAppealRefund)\n * - AppealBond struct + seeds: state.rs (174-193) `[\"bond\", dispute, round_idx]`\n * - appeal ladder: lib.rs:2553-2570, ADR-0004\n */\nimport {\n getAddressEncoder,\n getProgramDerivedAddress,\n type Address,\n type Instruction,\n} from \"@solana/kit\";\nimport { MAX_JURORS, panelSizeForRound } from \"../constants.js\";\n\nexport {\n MAX_JURORS,\n DEFAULT_APPEAL_WINDOW_SECS,\n panelSizeForRound,\n} from \"../constants.js\";\n\n/** AppealBond PDA seed prefix (state.rs: SEED_APPEAL_BOND = b\"bond\"). */\nconst SEED_APPEAL_BOND = new Uint8Array([98, 111, 110, 100]); // \"bond\"\n\n// ---------------------------------------------------------------------------\n// Pure helpers (mirror on-chain math, testable)\n// ---------------------------------------------------------------------------\n\n/** u32 → 4-byte little-endian. */\nfunction le4(v: number): Uint8Array {\n const b = new Uint8Array(4);\n new DataView(b.buffer).setUint32(0, v, true);\n return b;\n}\n\n/**\n * Required panel size for round `roundIdx` — the appeal ladder\n * `N_{k+1} = 2·N_k + 1` (closed form `(J+1)·2^k − 1`), capped at\n * {@link MAX_JURORS}. Direct port of `panel_size_for_round` (lib.rs:2555).\n * Returns `null` on overflow (round_idx ≥ 31).\n *\n * Re-exported from {@link ../constants.js} for module-internal use.\n */\n\n/** Appeal cost breakdown for opening round `currentRound + 1` (lib.rs:1688-1695). */\nexport interface AppealCost {\n newRound: number;\n panel: number;\n /** New-round fee = panel · fee_per_juror. */\n fee: bigint;\n /** Bond == new-round fee (forfeited if no flip, returned if flipped). */\n bond: bigint;\n /** Flip-bounty unit = fee_per_juror (ADR-0030) — joins the dispute pool. */\n bounty: bigint;\n /** Appellant pays fee + bond + bounty unit up front. */\n total: bigint;\n}\n\n/**\n * Quote the panel + fee + bond + bounty unit for an appeal from\n * `currentRound`. Mirrors lib.rs:1688-1695 (`panel_new =\n * panel_size_for_round(J, current+1)`, `fee_new = panel_new · fee_per_juror`,\n * `bond = fee_new`, `bounty = fee_per_juror` (ADR-0030),\n * `total = fee_new + bond + bounty`). Returns `null` if the panel math\n * overflows.\n */\nexport function appealCost(\n currentRound: number,\n feePerJuror: bigint,\n minJurySize: number = 3,\n): AppealCost | null {\n const newRound = currentRound + 1;\n const panel = panelSizeForRound(newRound, minJurySize);\n if (panel === null) return null;\n const fee = BigInt(panel) * feePerJuror;\n const bond = fee;\n const bounty = feePerJuror;\n return { newRound, panel, fee, bond, bounty, total: fee + bond + bounty };\n}\n\n/** Gate: a fresh appeal requires `currentRound < maxAppeals` (lib.rs:1660). */\nexport function canAppeal(currentRound: number, maxAppeals: number): boolean {\n return currentRound < maxAppeals;\n}\n\n/** AppealBond PDA seeds (state.rs:2286): `[\"bond\", dispute, round_idx_le4]`. */\nexport function appealBondSeeds(\n disputeBytes: Uint8Array,\n roundIdx: number,\n): Uint8Array[] {\n if (disputeBytes.length !== 32)\n throw new Error(\"InvalidDispute: expected 32 bytes\");\n if (!Number.isInteger(roundIdx) || roundIdx < 0 || roundIdx > 0xffffffff) {\n throw new Error(`InvalidRoundIdx: expected u32, got ${roundIdx}`);\n }\n return [SEED_APPEAL_BOND, disputeBytes, le4(roundIdx)];\n}\n\n// ---------------------------------------------------------------------------\n// PDA derivation (Kit lazy-imported)\n// ---------------------------------------------------------------------------\n\nexport async function findAppealBondPda(\n programAddress: Address,\n dispute: Address,\n roundIdx: number,\n): Promise<{ address: Address; bump: number }> {\n const disputeBytes = new Uint8Array(getAddressEncoder().encode(dispute));\n const [address, bump] = await getProgramDerivedAddress({\n programAddress,\n seeds: appealBondSeeds(disputeBytes, roundIdx),\n });\n return { address, bump };\n}\n\n// ---------------------------------------------------------------------------\n// Seam (ADR-0010) + orchestration\n// ---------------------------------------------------------------------------\n\n/** Accounts for `appeal`. */\nexport interface AppealAccounts {\n /** Any appellant (permissionless). Fee + bond payer. Signer. */\n appellant: Address;\n subaccord: Address;\n accordState: Address;\n dispute: Address;\n /** The just-resolved round (`current_round`) — read for `prior_result`. */\n round: Address;\n /** AppealBond PDA for the NEW round (`[\"bond\", dispute, current_round+1]`). */\n appealBond: Address;\n feeToken: Address;\n appellantTokenAccount: Address;\n feeVault: Address;\n}\n\n/** Accounts for `claim_appeal_refund`. */\nexport interface ClaimRefundAccounts {\n /** Any caller (permissionless crank). Signer. */\n caller: Address;\n subaccord: Address;\n dispute: Address;\n /** AppealBond PDA for `roundIdx` (the round the appeal opened). */\n appealBond: Address;\n feeToken: Address;\n /** Appellant's ATA — sweep destination (owner checked on-chain). */\n claimantTokenAccount: Address;\n feeVault: Address;\n}\n\n/**\n * Seam to the Codama-generated Kit client. Foundation wires the concrete\n * adapter; appeal.ts stays orchestration-only.\n */\nexport interface AccordAppealClient {\n buildAppeal(input: {\n programId: Address;\n accounts: AppealAccounts;\n newEvidenceHash: Uint8Array;\n }): Instruction;\n buildClaimAppealRefund(input: {\n programId: Address;\n accounts: ClaimRefundAccounts;\n roundIdx: number;\n }): Instruction;\n}\n\n/**\n * Validate a per-round evidence commitment is `[u8; 32]` (lib.rs appeal arg).\n * The `[0u8; 32]` sentinel (no new evidence this round) is a legal value, so\n * only the length is checked. Mirrors {@link assertValidEvidenceHash} in\n * dispute.ts but is duplicated here to keep appeal.ts self-contained.\n */\nexport function assertValidNewEvidenceHash(newEvidenceHash: Uint8Array): void {\n if (newEvidenceHash.length !== 32) {\n throw new Error(\n `InvalidNewEvidenceHash: expected 32 bytes, got ${newEvidenceHash.length}`,\n );\n }\n}\n\n/**\n * Build `appeal` (lib.rs:1643). Opens `current_round + 1` with a `2N+1` panel;\n * the appellant pays `fee_new + bond` (bond == fee_new). The AppealBond PDA is\n * keyed by the round BEING appealed (`current_round`, pre-increment) — derive it\n * via {@link findAppealBondPda} with `currentRound`.\n *\n * `newEvidenceHash` optionally introduces fresh evidence for the new round\n * (stored at `evidence_hashes[current_round + 1]`); pass the `[0u8; 32]`\n * sentinel (milestone accord-qp7c) to carry forward prior rounds' evidence\n * without adding any.\n */\nexport function appeal(\n client: AccordAppealClient,\n programId: Address,\n accounts: AppealAccounts,\n newEvidenceHash: Uint8Array,\n): Instruction {\n assertValidNewEvidenceHash(newEvidenceHash);\n return client.buildAppeal({ programId, accounts, newEvidenceHash });\n}\n\n/**\n * Build `claim_appeal_refund` (lib.rs:1772) for a specific appeal's bond.\n * `roundIdx` is the round that was appealed (`current_round` at appeal time —\n * the AppealBond PDA seed, pre-increment), selecting which bond to claim.\n * Idempotent\n * on-chain (the bond is zeroed on payout).\n */\nexport function claimAppealRefund(\n client: AccordAppealClient,\n programId: Address,\n accounts: ClaimRefundAccounts,\n roundIdx: number,\n): Instruction {\n if (!Number.isInteger(roundIdx) || roundIdx < 0 || roundIdx > 0xffffffff) {\n throw new Error(`InvalidRoundIdx: expected u32, got ${roundIdx}`);\n }\n return client.buildClaimAppealRefund({ programId, accounts, roundIdx });\n}\n","/**\n * Bound orchestration namespace — the eight Accord method groups, pre-bound to\n * a concrete {@link AccordAdapter} + the canonical program id.\n *\n * Each entry forwards to the pure orchestration function in `src/methods/*.ts`,\n * injecting the adapter as the `client` argument. The pure crypto helpers\n * (`buildMst`, `resolvePanel`, `commitHash`, `appealCost`, …) are NOT bound\n * here — they take no client, so import them directly from `@useaccord/sdk`.\n *\n * @see ADR-0010\n */\n\nimport type { Address, Instruction, TransactionSigner } from \"@solana/kit\";\n\nimport {\n createDispute as pureCreateDispute,\n getRuling as pureGetRuling,\n type CreateDisputeAccounts,\n type CreateDisputeArgs,\n} from \"./methods/dispute.js\";\nimport {\n createSubaccord as pureCreateSubaccord,\n executeSubaccordUpdate as pureExecuteSubaccordUpdate,\n executeUnpause as pureExecuteUnpause,\n getUpdateExecuteAfterSlot as pureGetUpdateExecuteAfterSlot,\n initializePause as pureInitializePause,\n pause as purePause,\n proposeSubaccordUpdate as pureProposeSubaccordUpdate,\n proposeUnpause as pureProposeUnpause,\n type CreateSubaccordArgs,\n type UpdatePayload,\n} from \"./methods/lifecycle.js\";\nimport type { MSTNode } from \"./methods/mst.js\";\nimport {\n stake as pureStake,\n requestWithdraw as pureRequestWithdraw,\n withdraw as pureWithdraw,\n reconcileStake as pureReconcileStake,\n withdrawFees as pureWithdrawFees,\n pruneJuror as purePruneJuror,\n type StakingAccounts,\n type WithdrawFeesAccounts,\n type PruneJurorAccounts,\n} from \"./methods/staking.js\";\nimport {\n settleRound as pureSettleRound,\n cancelDispute as pureCancelDispute,\n claimFilingBounty as pureClaimFilingBounty,\n type CancelDisputeAccounts,\n type ClaimFilingBountyAccounts,\n type SettleRoundAccounts,\n} from \"./methods/settlement.js\";\nimport {\n awaitCommittedVrf as pureAwaitCommittedVrf,\n drawSeat as pureDrawSeat,\n requestVrf as pureRequestVrf,\n type SeatMembership,\n type RequestVrfExtras,\n type VrfDrawAccounts,\n} from \"./methods/vrf.js\";\nimport {\n commit as pureCommit,\n finalizeDispute as pureFinalizeDispute,\n finalizeRound as pureFinalizeRound,\n redraw as pureRedraw,\n reveal as pureReveal,\n type RedrawAccounts,\n type VoteArgs,\n type VotingAccounts,\n} from \"./methods/voting.js\";\nimport {\n appeal as pureAppeal,\n claimAppealRefund as pureClaimAppealRefund,\n type AppealAccounts,\n type ClaimRefundAccounts,\n} from \"./methods/appeal.js\";\n\nimport type { AccordAdapter } from \"./adapter.js\";\nimport { ACCORD_PROGRAM_ID } from \"./pda.js\";\n\n/** Bound method groups returned by `accord.methods`. */\nexport interface AccordMethods {\n // dispute (Arbitrable CPI API)\n createDispute(\n accounts: CreateDisputeAccounts,\n args: CreateDisputeArgs,\n ): Promise<{ instruction: Instruction; dispute: Address; bump: number }>;\n getRuling(dispute: Address): Promise<bigint | null>;\n\n // lifecycle\n createSubaccord(\n creator: Address,\n args: CreateSubaccordArgs,\n ): Promise<{ instruction: Instruction; subaccord: Address; bump: number }>;\n proposeSubaccordUpdate(\n authority: Address,\n subaccord: Address,\n nonce: bigint,\n payload: UpdatePayload,\n ): Promise<{ instruction: Instruction; pendingUpdate: Address }>;\n getUpdateExecuteAfterSlot(pendingUpdate: Address): Promise<bigint | null>;\n executeSubaccordUpdate(\n caller: Address,\n subaccord: Address,\n pendingUpdate: Address,\n ): Instruction;\n initializePause(\n authority: Address,\n ): Promise<{ instruction: Instruction; accordState: Address }>;\n pause(authority: Address, accordState: Address): Instruction;\n proposeUnpause(authority: Address, accordState: Address): Instruction;\n executeUnpause(caller: Address, accordState: Address): Instruction;\n\n // staking (ADR-0012: path-verified accumulator update)\n stake(\n accounts: StakingAccounts,\n amount: bigint,\n path: MSTNode[],\n attestation?: Address,\n ): Instruction;\n requestWithdraw(\n accounts: StakingAccounts,\n amount: bigint,\n path: MSTNode[],\n ): Instruction;\n withdraw(accounts: StakingAccounts): Instruction;\n reconcileStake(accounts: StakingAccounts, path: MSTNode[]): Instruction;\n withdrawFees(accounts: WithdrawFeesAccounts): Instruction;\n pruneJuror(\n accounts: PruneJurorAccounts,\n path: MSTNode[],\n attestation: Address,\n ): Instruction;\n\n // settlement (per-round crank + dispute cancellation + filing bounty)\n settleRound(\n accounts: SettleRoundAccounts,\n roundIdx: number,\n remainingAccounts: Address[],\n ): Instruction;\n cancelDispute(\n accounts: CancelDisputeAccounts,\n remainingAccounts: Address[],\n ): Instruction;\n claimFilingBounty(accounts: ClaimFilingBountyAccounts): Instruction;\n\n // vrf + per-seat draw (ADR-0009/0012)\n requestVrf(accounts: VrfDrawAccounts, extras: RequestVrfExtras): Instruction;\n awaitCommittedVrf(\n dispute: Address,\n opts?: { pollIntervalMs?: number; timeoutMs?: number },\n ): Promise<Uint8Array>;\n drawSeat(\n accounts: VrfDrawAccounts,\n roundPda: Address,\n seat: number,\n membership: SeatMembership,\n ): Instruction;\n\n // voting\n commit(\n accounts: VotingAccounts,\n args: VoteArgs,\n ): Promise<{ instruction: Instruction; commitment: Uint8Array }>;\n reveal(accounts: VotingAccounts, args: VoteArgs): Instruction;\n finalizeRound(accounts: VotingAccounts): Instruction;\n finalizeDispute(\n accounts: VotingAccounts,\n remainingAccounts: Address[],\n ): Instruction;\n redraw(\n accounts: RedrawAccounts,\n remainingAccounts?: Address[],\n ): Instruction;\n\n // appeal\n appeal(accounts: AppealAccounts, newEvidenceHash: Uint8Array): Instruction;\n claimAppealRefund(\n accounts: ClaimRefundAccounts,\n roundIdx: number,\n ): Instruction;\n}\n\n/**\n * Build the bound method namespace. `signer` is accepted so future per-call\n * signer overrides can route through the facade; today the adapter uses the\n * facade's wallet.\n */\nexport function createAccordMethods(\n adapter: AccordAdapter,\n programId: Address = ACCORD_PROGRAM_ID,\n // ponytail: reserved for per-call signer routing; the adapter currently uses\n // the facade wallet. Kept on the signature so the public type is stable.\n _signer?: TransactionSigner,\n): AccordMethods {\n return {\n // dispute\n createDispute: (accounts, args) =>\n pureCreateDispute(adapter, accounts, args, programId),\n getRuling: (dispute) => pureGetRuling(adapter, dispute),\n\n // lifecycle\n createSubaccord: (creator, args) =>\n pureCreateSubaccord(adapter, programId, creator, args),\n proposeSubaccordUpdate: (authority, subaccord, nonce, payload) =>\n pureProposeSubaccordUpdate(\n adapter,\n programId,\n authority,\n subaccord,\n nonce,\n payload,\n ),\n getUpdateExecuteAfterSlot: (pendingUpdate) =>\n pureGetUpdateExecuteAfterSlot(adapter, pendingUpdate),\n executeSubaccordUpdate: (caller, subaccord, pendingUpdate) =>\n pureExecuteSubaccordUpdate(\n adapter,\n programId,\n caller,\n subaccord,\n pendingUpdate,\n ),\n initializePause: (authority) =>\n pureInitializePause(adapter, programId, authority),\n pause: (authority, accordState) =>\n purePause(adapter, programId, authority, accordState),\n proposeUnpause: (authority, accordState) =>\n pureProposeUnpause(adapter, programId, authority, accordState),\n executeUnpause: (caller, accordState) =>\n pureExecuteUnpause(adapter, programId, caller, accordState),\n\n // staking\n stake: (accounts, amount, path, attestation) =>\n pureStake(adapter, programId, accounts, amount, path, attestation),\n requestWithdraw: (accounts, amount, path) =>\n pureRequestWithdraw(adapter, programId, accounts, amount, path),\n withdraw: (accounts) => pureWithdraw(adapter, programId, accounts),\n reconcileStake: (accounts, path) =>\n pureReconcileStake(adapter, programId, accounts, path),\n withdrawFees: (accounts) => pureWithdrawFees(adapter, programId, accounts),\n pruneJuror: (accounts, path, attestation) =>\n purePruneJuror(adapter, programId, accounts, path, attestation),\n\n // settlement\n settleRound: (accounts, roundIdx, remainingAccounts) =>\n pureSettleRound(\n adapter,\n programId,\n accounts,\n roundIdx,\n remainingAccounts,\n ),\n cancelDispute: (accounts, remainingAccounts) =>\n pureCancelDispute(adapter, programId, accounts, remainingAccounts),\n claimFilingBounty: (accounts) =>\n pureClaimFilingBounty(adapter, programId, accounts),\n\n // vrf + per-seat draw\n requestVrf: (accounts, extras) =>\n pureRequestVrf(adapter, programId, accounts, extras),\n awaitCommittedVrf: (dispute, opts) =>\n pureAwaitCommittedVrf(adapter, dispute, opts),\n drawSeat: (accounts, roundPda, seat, membership) =>\n pureDrawSeat(adapter, programId, accounts, roundPda, seat, membership),\n\n // voting\n commit: (accounts, args) => pureCommit(adapter, programId, accounts, args),\n reveal: (accounts, args) => pureReveal(adapter, programId, accounts, args),\n finalizeRound: (accounts) => pureFinalizeRound(adapter, programId, accounts),\n finalizeDispute: (accounts, remainingAccounts) =>\n pureFinalizeDispute(adapter, programId, accounts, remainingAccounts),\n redraw: (accounts, remainingAccounts = []) =>\n pureRedraw(adapter, programId, accounts, remainingAccounts),\n\n // appeal\n appeal: (accounts, newEvidenceHash) =>\n pureAppeal(adapter, programId, accounts, newEvidenceHash),\n claimAppealRefund: (accounts, roundIdx) =>\n pureClaimAppealRefund(adapter, programId, accounts, roundIdx),\n };\n}\n","/**\n * Wallet adapter: Keypair bytes | IWallet → Kit TransactionSigner.\n *\n * Kit's `KeyPairSigner` already implements `TransactionSigner`, so the keypair\n * path is a direct factory. External wallets (browser extensions, hardware)\n * implement `IWallet`; `signerFromWallet` adapts them into a Kit\n * `TransactionPartialSigner` (which satisfies `TransactionSigner`).\n */\n\nimport {\n createKeyPairSignerFromBytes,\n type Address,\n type KeyPairSigner,\n type SignatureDictionary,\n type Transaction,\n type TransactionPartialSigner,\n type TransactionSigner,\n} from \"@solana/kit\";\n\nexport type AccordSigner = TransactionSigner;\n\n/**\n * Minimal external-wallet interface. Compatible with @solana/wallet-adapter\n * wallets that expose `signMessage`, or any custom signing provider.\n */\nexport interface IWallet {\n readonly publicKey: Address;\n signMessage(message: Uint8Array): Promise<Uint8Array>;\n}\n\n/**\n * Create a Kit `KeyPairSigner` from raw 64-byte keypair bytes (e.g. a\n * Solana keypair JSON file). The resulting signer is a full `TransactionSigner`.\n */\nexport async function signerFromKeypairBytes(\n bytes: Uint8Array,\n): Promise<KeyPairSigner> {\n return createKeyPairSignerFromBytes(bytes);\n}\n\n/**\n * Adapt an external `IWallet` into a Kit `TransactionPartialSigner` for use\n * with the Accord facade. Signs each transaction's compiled message bytes\n * via the wallet's `signMessage` and returns a per-transaction signature map.\n */\nexport function signerFromWallet(wallet: IWallet): TransactionPartialSigner {\n return Object.freeze({\n address: wallet.publicKey,\n async signTransactions(\n transactions: readonly Transaction[],\n ): Promise<SignatureDictionary[]> {\n return Promise.all(\n transactions.map(async (tx) => {\n const signature = await wallet.signMessage(\n new Uint8Array(tx.messageBytes),\n );\n return { [wallet.publicKey]: signature } as SignatureDictionary;\n }),\n );\n },\n });\n}\n","/**\n * SPL Token + Associated Token Account (ATA) derivation.\n *\n * Single source of truth for the canonical ATA address used across fee and\n * collateral flows (ADR-0020). `@solana/kit` v7 does not export the SPL\n * program ids, so they live here. Hand-rolled (no `@solana/spl-token`\n * dependency) to keep the jest e2e suite free of the web3.js v1 `uuid` break —\n * matches the on-chain `create_associated_token_account` layout:\n * `ATA_PROGRAM ‖ [owner, TOKEN_PROGRAM, mint]`.\n *\n * @see ADR-0020\n */\nimport {\n getAddressEncoder,\n getProgramDerivedAddress,\n type Address,\n} from \"@solana/kit\";\n\n/** SPL Token program id (not exported by @solana/kit v7). */\nexport const TOKEN_PROGRAM_ADDRESS =\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\" as Address;\n\n/** SPL Associated Token Account program id (not exported by @solana/kit v7). */\nexport const ASSOCIATED_TOKEN_PROGRAM_ADDRESS =\n \"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL\" as Address;\n\n/**\n * Derive the canonical Associated Token Account (ATA) address for `mint`\n * owned by `owner`. Argument order follows `@solana/spl-token`'s\n * `getAssociatedTokenAddress(mint, owner, …)`.\n */\nexport async function findAssociatedTokenAddress(\n mint: Address,\n owner: Address,\n): Promise<Address> {\n const enc = getAddressEncoder();\n const [ata] = await getProgramDerivedAddress({\n programAddress: ASSOCIATED_TOKEN_PROGRAM_ADDRESS,\n seeds: [enc.encode(owner), enc.encode(TOKEN_PROGRAM_ADDRESS), enc.encode(mint)],\n });\n return ata;\n}\n","/**\n * Typed `getProgramAccounts` wrappers — bulk reads that hide discriminator +\n * memcmp-offset construction from the caller. Each function returns fully\n * decoded `Account<T>[]`; no raw bytes, no memcmp offsets, no decoders leak.\n *\n * Filters match the 8-byte Anchor discriminator at offset 0 plus an optional\n * 32-byte `Address` field. Offsets below are fixed by the generated struct\n * layouts (see `./generated/accounts/*.ts`); the round-trip in `query.test.ts`\n * fails if they ever drift.\n *\n * Accepts a raw Kit `Rpc<GetProgramAccountsApi>` — the same `rpc` the facade\n * (`Accord.rpc`) or a bare `createSolanaRpc(...)` exposes.\n *\n * @see ADR-0010\n */\n\nimport {\n getAddressEncoder,\n getBase58Decoder,\n getBase64Encoder,\n type Account,\n type Address,\n type Base58EncodedBytes,\n type GetProgramAccountsApi,\n type GetProgramAccountsMemcmpFilter,\n type ReadonlyUint8Array,\n type Rpc,\n} from \"@solana/kit\";\n\nimport { ACCORD_PROGRAM_ID } from \"./pda.js\";\nimport {\n DISPUTE_DISCRIMINATOR,\n JUROR_STAKE_DISCRIMINATOR,\n SUBACCORD_DISCRIMINATOR,\n getDisputeDecoder,\n getJurorStakeDecoder,\n getSubaccordDecoder,\n type Dispute,\n type JurorStake,\n type Subaccord,\n} from \"./generated/accounts/index.js\";\n\n// --- internal filter builders ----------------------------------------------\n\nconst base58 = getBase58Decoder();\nconst addressEncoder = getAddressEncoder();\n\n/** Anchor account discriminator sits at offset 0 (8 bytes). */\nfunction discriminatorFilter(\n discriminator: ReadonlyUint8Array,\n): GetProgramAccountsMemcmpFilter {\n return {\n memcmp: {\n offset: 0n,\n // Kit's base58 decoder yields plain `string`; brand it for the filter.\n bytes: base58.decode(discriminator) as Base58EncodedBytes,\n encoding: \"base58\",\n },\n };\n}\n\n/** A 32-byte `Address` field at a fixed byte offset (base58-encoded). */\nfunction addressFilter(\n offset: bigint,\n address: Address,\n): GetProgramAccountsMemcmpFilter {\n return {\n memcmp: {\n offset,\n bytes: base58.decode(\n addressEncoder.encode(address),\n ) as Base58EncodedBytes,\n encoding: \"base58\",\n },\n };\n}\n\n// --- byte offsets (from the generated struct layouts) ----------------------\n// Field order per `./generated/accounts/*.ts` encoders:\n// JurorStake: disc(8) | subaccord(32) | juror(32) | ...\n// Dispute: disc(8) | subaccord(32) | filer(32) | ...\n// Discriminator = 8 bytes; the first Address field follows at 8, the next at 40.\nconst OFFSET_FIRST_ADDRESS = 8n;\nconst OFFSET_SECOND_ADDRESS = 40n;\n\n// --- core GPA + decode ------------------------------------------------------\n\nasync function fetchDecodedAccounts<T extends object>(\n rpc: Rpc<GetProgramAccountsApi>,\n filters: GetProgramAccountsMemcmpFilter[],\n decode: (bytes: ReadonlyUint8Array | Uint8Array) => T,\n programAddress: Address = ACCORD_PROGRAM_ID,\n): Promise<Account<T>[]> {\n const accountInfos = await rpc\n .getProgramAccounts(programAddress, { encoding: \"base64\", filters })\n .send();\n const base64 = getBase64Encoder();\n return accountInfos.map((info) => {\n const [data] = info.account.data;\n return {\n ...info.account,\n address: info.pubkey,\n programAddress,\n data: decode(base64.encode(data)),\n } as Account<T>;\n });\n}\n\n// --- public typed wrappers --------------------------------------------------\n\n/** All Subaccords on the Accord program (discriminator-only filter). */\nexport function findAllSubaccords(\n rpc: Rpc<GetProgramAccountsApi>,\n): Promise<Account<Subaccord>[]> {\n return fetchDecodedAccounts(\n rpc,\n [discriminatorFilter(SUBACCORD_DISCRIMINATOR)],\n (b) => getSubaccordDecoder().decode(b),\n );\n}\n\n/** Every JurorStake on the Accord program (global browse / aggregation). */\nexport function findAllJurorStakes(\n rpc: Rpc<GetProgramAccountsApi>,\n): Promise<Account<JurorStake>[]> {\n return fetchDecodedAccounts(\n rpc,\n [discriminatorFilter(JUROR_STAKE_DISCRIMINATOR)],\n (b) => getJurorStakeDecoder().decode(b),\n );\n}\n\n/** Every JurorStake for a Subaccord (draw pool / accumulator rebuild). */\nexport function findJurorStakesBySubaccord(\n rpc: Rpc<GetProgramAccountsApi>,\n subaccord: Address,\n): Promise<Account<JurorStake>[]> {\n return fetchDecodedAccounts(\n rpc,\n [\n discriminatorFilter(JUROR_STAKE_DISCRIMINATOR),\n addressFilter(OFFSET_FIRST_ADDRESS, subaccord),\n ],\n (b) => getJurorStakeDecoder().decode(b),\n );\n}\n\n/** Every JurorStake owned by a juror across all Subaccords. */\nexport function findJurorStakesByJuror(\n rpc: Rpc<GetProgramAccountsApi>,\n juror: Address,\n): Promise<Account<JurorStake>[]> {\n return fetchDecodedAccounts(\n rpc,\n [\n discriminatorFilter(JUROR_STAKE_DISCRIMINATOR),\n addressFilter(OFFSET_SECOND_ADDRESS, juror),\n ],\n (b) => getJurorStakeDecoder().decode(b),\n );\n}\n\n/** Every Dispute filed under a Subaccord. */\nexport function findDisputesBySubaccord(\n rpc: Rpc<GetProgramAccountsApi>,\n subaccord: Address,\n): Promise<Account<Dispute>[]> {\n return fetchDecodedAccounts(\n rpc,\n [\n discriminatorFilter(DISPUTE_DISCRIMINATOR),\n addressFilter(OFFSET_FIRST_ADDRESS, subaccord),\n ],\n (b) => getDisputeDecoder().decode(b),\n );\n}\n\n/** Every Dispute filed by a given filer. */\nexport function findDisputesByFiler(\n rpc: Rpc<GetProgramAccountsApi>,\n filer: Address,\n): Promise<Account<Dispute>[]> {\n return fetchDecodedAccounts(\n rpc,\n [\n discriminatorFilter(DISPUTE_DISCRIMINATOR),\n addressFilter(OFFSET_SECOND_ADDRESS, filer),\n ],\n (b) => getDisputeDecoder().decode(b),\n );\n}\n","/**\n * Typed mapping of AccordError codes.\n *\n * Anchor assigns sequential codes starting at 6000 (the `ERROR_CODE_OFFSET`).\n * The order matches the `#[error_code]` enum declaration in\n * `programs/accord/src/errors.rs`.\n */\n\nexport const ACCORD_ERROR_CODE_OFFSET = 6000;\n\nexport type AccordErrorCode = {\n readonly code: number;\n readonly name: string;\n readonly message: string;\n};\n\nfunction err(code: number, name: string, message: string): AccordErrorCode {\n return { code, name, message } as const;\n}\n\nconst BASE = ACCORD_ERROR_CODE_OFFSET;\n\nexport const AccordErrors = {\n // --- authority / timelock (ADR-0005) ---\n Unauthorized: err(\n BASE + 0,\n \"Unauthorized\",\n \"Signer is not the Subaccord authority.\",\n ),\n ImmutableSubaccord: err(\n BASE + 1,\n \"ImmutableSubaccord\",\n \"Subaccord is immutable (authority == default).\",\n ),\n TimelockNotElapsed: err(\n BASE + 2,\n \"TimelockNotElapsed\",\n \"Timelock has not elapsed yet.\",\n ),\n NoPendingUpdate: err(\n BASE + 3,\n \"NoPendingUpdate\",\n \"No pending update to execute.\",\n ),\n\n // --- circuit breaker (ADR-0007) ---\n NotPauseAuthority: err(\n BASE + 4,\n \"NotPauseAuthority\",\n \"Signer is not the pause authority.\",\n ),\n AlreadyPaused: err(BASE + 5, \"AlreadyPaused\", \"Program is already paused.\"),\n NotPaused: err(BASE + 6, \"NotPaused\", \"Program is not paused.\"),\n NoPendingUnpause: err(\n BASE + 7,\n \"NoPendingUnpause\",\n \"No pending unpause to execute.\",\n ),\n UnpauseTimelockNotElapsed: err(\n BASE + 8,\n \"UnpauseTimelockNotElapsed\",\n \"Unpause timelock has not elapsed yet.\",\n ),\n ProgramPaused: err(\n BASE + 9,\n \"ProgramPaused\",\n \"Program is paused; this instruction is halted.\",\n ),\n\n // --- staking ---\n InsufficientStake: err(\n BASE + 10,\n \"InsufficientStake\",\n \"Staked amount is below the Subaccord minimum.\",\n ),\n StakeLocked: err(\n BASE + 11,\n \"StakeLocked\",\n \"Cannot unstake while active_draws > 0 (stake is frozen until drawn disputes settle).\",\n ),\n InvalidAmount: err(\n BASE + 12,\n \"InvalidAmount\",\n \"Amount must be greater than zero.\",\n ),\n InsufficientBalance: err(\n BASE + 13,\n \"InsufficientBalance\",\n \"Withdrawal exceeds the Juror's staked balance.\",\n ),\n\n // --- dispute intake ---\n InsufficientJurors: err(\n BASE + 14,\n \"InsufficientJurors\",\n \"Subaccord has fewer active distinct stakers than the required panel size.\",\n ),\n InvalidOptions: err(\n BASE + 15,\n \"InvalidOptions\",\n \"Dispute options are invalid (need 2..=MAX_OPTIONS).\",\n ),\n InvalidState: err(\n BASE + 16,\n \"InvalidState\",\n \"Dispute is not in the required state for this instruction.\",\n ),\n FeeMismatch: err(\n BASE + 17,\n \"FeeMismatch\",\n \"Tendered fee does not match the required round-1 dispute fee (min_jury_size * fee_per_juror).\",\n ),\n\n // --- accumulator (ADR-0012) ---\n InvalidMerklePath: err(\n BASE + 18,\n \"InvalidMerklePath\",\n \"Accumulator Merkle path does not authenticate against the stored root.\",\n ),\n TreeFull: err(\n BASE + 19,\n \"TreeFull\",\n \"Accumulator tree is full (no free leaf within the configured depth).\",\n ),\n\n // --- draw ---\n DuplicateJuror: err(\n BASE + 20,\n \"DuplicateJuror\",\n \"Draw selected a duplicate Juror.\",\n ),\n InvalidMembershipProof: err(\n BASE + 21,\n \"InvalidMembershipProof\",\n \"Juror Merkle membership/weight proof is invalid.\",\n ),\n InvalidPanelSize: err(\n BASE + 22,\n \"InvalidPanelSize\",\n \"Number of juror memberships does not match the required panel size.\",\n ),\n InflatedStake: err(\n BASE + 23,\n \"InflatedStake\",\n \"Drawn juror's live stake is below the accumulator leaf's claim (inflation guard, ADR-0012).\",\n ),\n SortitionMismatch: err(\n BASE + 24,\n \"SortitionMismatch\",\n \"Submitted membership does not match the VRF-derived sortition selection (ADR-0009).\",\n ),\n VrfAlreadyCommitted: err(\n BASE + 25,\n \"VrfAlreadyCommitted\",\n \"VRF result already committed for this dispute.\",\n ),\n VrfNotCommitted: err(\n BASE + 26,\n \"VrfNotCommitted\",\n \"No VRF result committed for this dispute; the root is not yet frozen.\",\n ),\n\n // --- voting ---\n CommitAlreadyExists: err(\n BASE + 27,\n \"CommitAlreadyExists\",\n \"Juror has already committed.\",\n ),\n CommitMissing: err(\n BASE + 28,\n \"CommitMissing\",\n \"No commit to reveal for this Juror.\",\n ),\n RevealMismatch: err(\n BASE + 29,\n \"RevealMismatch\",\n \"Reveal does not match the committed hash.\",\n ),\n CommitWindowClosed: err(\n BASE + 30,\n \"CommitWindowClosed\",\n \"Commit window is closed.\",\n ),\n RevealWindowClosed: err(\n BASE + 31,\n \"RevealWindowClosed\",\n \"Reveal window is closed.\",\n ),\n NotDrawnJuror: err(\n BASE + 32,\n \"NotDrawnJuror\",\n \"Signer is not a drawn Juror for this round.\",\n ),\n InvalidVote: err(\n BASE + 33,\n \"InvalidVote\",\n \"Revealed vote index is out of range.\",\n ),\n AlreadyRevealed: err(\n BASE + 34,\n \"AlreadyRevealed\",\n \"Juror has already revealed.\",\n ),\n\n // --- finalization ---\n AppealWindowOpen: err(\n BASE + 35,\n \"AppealWindowOpen\",\n \"Appeal window has not elapsed yet.\",\n ),\n\n // --- appeals (ADR-0004) ---\n MaxAppealsReached: err(\n BASE + 36,\n \"MaxAppealsReached\",\n \"Maximum appeals reached for this dispute.\",\n ),\n MaxAppealsLimitExceeded: err(\n BASE + 37,\n \"MaxAppealsLimitExceeded\",\n \"Subaccord max_appeals exceeds the program ceiling.\",\n ),\n AppealWindowClosed: err(\n BASE + 38,\n \"AppealWindowClosed\",\n \"Appeal window has closed; the dispute can only be finalized.\",\n ),\n\n // --- finalization ---\n RoundNotFinalizable: err(\n BASE + 39,\n \"RoundNotFinalizable\",\n \"Round cannot be finalized yet (window not elapsed).\",\n ),\n DisputeNotFinal: err(\n BASE + 40,\n \"DisputeNotFinal\",\n \"Dispute is not in a finalizable state.\",\n ),\n\n // --- arithmetic ---\n ArithmeticOverflow: err(\n BASE + 41,\n \"ArithmeticOverflow\",\n \"Arithmetic overflow.\",\n ),\n\n // --- multi-round settlement (CONCEPT-REVIEW Ugly 5 / accord-r6ti) ---\n RoundAlreadySettled: err(\n BASE + 42,\n \"RoundAlreadySettled\",\n \"Round has already been settled.\",\n ),\n RoundNotSettlable: err(\n BASE + 43,\n \"RoundNotSettlable\",\n \"Round index out of range for settlement (must be < current_round).\",\n ),\n\n // --- cancel / Failed state (Ugly 4) ---\n DisputeFailed: err(\n BASE + 44,\n \"DisputeFailed\",\n \"Dispute is in terminal Failed state.\",\n ),\n CancelTooEarly: err(\n BASE + 45,\n \"CancelTooEarly\",\n \"Dispute has not exceeded its stage timeout; cancel_dispute is not yet available.\",\n ),\n\n // --- draw (bean accord-tzo0) ---\n MaxRetriesExceeded: err(\n BASE + 46,\n \"MaxRetriesExceeded\",\n \"Sortition retries exceeded the on-chain bound; the pool may be too concentrated.\",\n ),\n} as const;\n\nexport type AccordErrorName = keyof typeof AccordErrors;\n","/**\n * stakeFlow.ts — MST accumulator proof orchestration for stake / unstake.\n *\n * This is the domain logic the `/juror/stake` route executes after fetching\n * a Subaccord + all its JurorStake accounts:\n *\n * 1. Sort JurorStake leaves by `treeIndex` (canonical append-only order).\n * 2. Build `LeafClaim[]` at each juror's canonical position.\n * 3. `buildAccumulator(leafClaims, depth)` — rebuild the canonical tree.\n * 4. Verify `accumulator.rootHash === subaccord.rootHash` — a mismatch\n * means the local data is stale (race with a concurrent stake/unstake).\n * 5. Determine the juror's leaf index:\n * - Existing staker → their assigned `treeIndex`.\n * - New staker → `subaccord.nextIndex` (the next free leaf).\n * 6. `proofFor(accumulator, index)` — the Merkle path passed to `stake` /\n * `requestWithdraw` / `reconcileStake`.\n *\n * Pure — no chain access. Takes already-fetched typed data so it's testable\n * without a validator.\n *\n * Sources of truth:\n * - on-chain stake/requestWithdraw: programs/accord/src/lib.rs\n * - accumulator builder: ./mst.ts (ADR-0012)\n * - e2e flow reference: tests/src/staking.spec.ts (TreeTracker)\n */\n\nimport { getAddressEncoder, type Address } from \"@solana/kit\";\nimport {\n buildAccumulator,\n proofFor,\n type LeafClaim,\n type MerkleAccumulator,\n type MSTNode,\n} from \"./mst.js\";\n\n/** The Subaccord fields the proof builder needs. */\nexport interface SubaccordAccumulatorView {\n /** On-chain accumulator root (state.rs `root_hash`). */\n rootHash: Uint8Array;\n /** Next free leaf index (state.rs `next_index`). */\n nextIndex: number;\n /** Fixed tree depth (state.rs `depth`). */\n depth: number;\n}\n\n/** A JurorStake leaf needed for the accumulator. */\nexport interface JurorStakeLeaf {\n juror: Address;\n /** Canonical collateral (`staked`, not `staked + stakeDelta`). */\n staked: bigint;\n /** Leaf position assigned at first stake (state.rs `tree_index`). */\n treeIndex: number;\n}\n\n/** Result of proof computation for stake / unstake. */\nexport interface StakeProofResult {\n /** The Merkle path to pass to `stake` / `requestWithdraw` / `reconcileStake`. */\n path: MSTNode[];\n /** The leaf index the proof authenticates. */\n index: number;\n /** The root-verified accumulator (for audit / sortition prefix). */\n accumulator: MerkleAccumulator;\n /** `true` if this juror has never staked (proof for `nextIndex`). */\n isNewStaker: boolean;\n}\n\n/** Address → 32 raw bytes (the leaf's `juror` field). */\nfunction addrBytes(addr: Address): Uint8Array {\n return new Uint8Array(getAddressEncoder().encode(addr));\n}\n\n/**\n * Build the MST accumulator proof for a stake or unstake operation.\n *\n * @param subaccord The on-chain accumulator state (rootHash, nextIndex, depth).\n * @param jurorStakes All JurorStake accounts for this Subaccord (any order).\n * @param juror The staking juror's address.\n * @throws if the rebuilt root does not match the on-chain root (stale data).\n */\nexport async function prepareStakeProof(\n subaccord: SubaccordAccumulatorView,\n jurorStakes: readonly JurorStakeLeaf[],\n juror: Address,\n): Promise<StakeProofResult> {\n // 1) Sort by treeIndex (canonical leaf order in the append-only tree).\n const sorted = [...jurorStakes].sort((a, b) => a.treeIndex - b.treeIndex);\n\n // 2) Place each leaf at its canonical position; fill gaps with zero leaves.\n const size = 2 ** subaccord.depth;\n const leaves: LeafClaim[] = new Array(size);\n for (let i = 0; i < size; i++) {\n leaves[i] = { juror: new Uint8Array(32), stake: 0n };\n }\n for (const js of sorted) {\n if (js.treeIndex < 0 || js.treeIndex >= size) {\n throw new Error(\n `InvalidTreeIndex: ${js.treeIndex} out of range for depth ${subaccord.depth}`,\n );\n }\n leaves[js.treeIndex] = {\n juror: addrBytes(js.juror),\n stake: js.staked,\n };\n }\n\n // 3) Build the accumulator and verify the root matches on-chain state.\n const accumulator = await buildAccumulator(leaves, subaccord.depth);\n if (!bytesEqual(accumulator.rootHash, subaccord.rootHash)) {\n throw new Error(\n \"AccumulatorRootMismatch: local rebuild does not match on-chain root. \" +\n \"Data may be stale — retry with fresh JurorStake accounts.\",\n );\n }\n\n // 4) Determine the juror's leaf index.\n const existing = sorted.find((js) => js.juror === juror);\n const isNewStaker = !existing;\n const index = isNewStaker ? subaccord.nextIndex : existing.treeIndex;\n\n if (index < 0 || index >= size) {\n throw new Error(\n `TreeFull: index ${index} out of range for depth ${subaccord.depth} ` +\n `(pool at capacity — all ${size} leaves taken)`,\n );\n }\n\n // 5) Compute the Merkle proof for that index.\n const path = await proofFor(accumulator, index);\n\n return { path, index, accumulator, isNewStaker };\n}\n\n/** Constant-time byte comparison. */\nfunction bytesEqual(a: Uint8Array, b: Uint8Array): boolean {\n if (a.length !== b.length) return false;\n let diff = 0;\n for (let i = 0; i < a.length; i++) diff |= a[i]! ^ b[i]!;\n return diff === 0;\n}\n","/**\n * disputePhase.ts — dispute phase label + countdown for the juror dashboard.\n *\n * The juror dashboard (`/juror`) shows each active draw's current phase\n * (Review / Commit / Reveal) with a countdown timer. The phase is derived\n * from the Dispute's `state` enum + the Round's window deadlines\n * (`reviewEnd`, `commitEnd`, `revealEnd`).\n *\n * Pure — no chain access. Takes already-fetched typed data.\n */\n\nimport { DisputeState } from \"../generated/types/disputeState.js\";\n\n/** The Round window deadlines the phase computation needs. */\nexport interface RoundPhaseWindows {\n reviewEnd: bigint;\n commitEnd: bigint;\n revealEnd: bigint;\n}\n\n/** Human-readable phase + remaining seconds (null = no active countdown). */\nexport interface PhaseInfo {\n phase: string;\n /** Seconds remaining in the current window. `null` when past the deadline\n * or the state has no countdown. Negative = overdue (crank pending). */\n countdownSecs: bigint | null;\n}\n\n/**\n * Derive the juror-facing phase label + countdown for a dispute.\n *\n * @param state The Dispute's `state` field.\n * @param now Current Unix timestamp (seconds).\n * @param round The current Round's window deadlines (required for\n * Review/Commit/Reveal; pass `undefined` if not yet drawn).\n */\nexport function disputePhase(\n state: DisputeState,\n now: bigint,\n round?: RoundPhaseWindows,\n): PhaseInfo {\n switch (state) {\n case DisputeState.Created:\n case DisputeState.Drawn:\n return { phase: \"Pending draw\", countdownSecs: null };\n\n case DisputeState.Review:\n return {\n phase: \"Review\",\n countdownSecs: round ? round.reviewEnd - now : null,\n };\n\n case DisputeState.Commit:\n return {\n phase: \"Commit\",\n countdownSecs: round ? round.commitEnd - now : null,\n };\n\n case DisputeState.Reveal:\n return {\n phase: \"Reveal\",\n countdownSecs: round ? round.revealEnd - now : null,\n };\n\n case DisputeState.RoundResolved:\n return { phase: \"Awaiting appeal\", countdownSecs: null };\n\n case DisputeState.RedrawEligible:\n return { phase: \"Redraw eligible\", countdownSecs: null };\n\n case DisputeState.Final:\n return { phase: \"Finalized\", countdownSecs: null };\n\n case DisputeState.Closed:\n return { phase: \"Closed\", countdownSecs: null };\n\n case DisputeState.Failed:\n return { phase: \"Failed\", countdownSecs: null };\n\n default:\n return { phase: \"Unknown\", countdownSecs: null };\n }\n}\n","/**\n * Typed `getProgramAccounts` query wrappers.\n *\n * Each function encapsulates the discriminator + memcmp construction so the\n * caller never touches raw bytes. Returns typed `Account<T>[]` with the\n * account address preserved (needed for deep links, PDA navigation, etc.).\n *\n * @see ADR-0010\n */\n\nimport {\n type Account,\n type Address,\n type Base64EncodedBytes,\n type Commitment,\n type GetProgramAccountsApi,\n parseBase64RpcAccount,\n type ReadonlyUint8Array,\n type Rpc,\n} from \"@solana/kit\";\n\nimport {\n DISPUTE_DISCRIMINATOR,\n decodeDispute,\n type Dispute,\n} from \"./generated/accounts/dispute.js\";\nimport {\n PENDING_UPDATE_DISCRIMINATOR,\n decodePendingUpdate,\n type PendingUpdate,\n} from \"./generated/accounts/pendingUpdate.js\";\nimport { ACCORD_PROGRAM_ID } from \"./pda.js\";\n\nexport type QueryConfig = {\n commitment?: Commitment;\n abortSignal?: AbortSignal;\n};\n\nfunction discriminatorToBase64(d: ReadonlyUint8Array): Base64EncodedBytes {\n // ponytail: btoa for 8-byte discriminator — no perf concern\n return btoa(String.fromCharCode(...d)) as Base64EncodedBytes;\n}\n\n/**\n * Fetch every Dispute account on-chain, decoded and typed.\n * Filters by the 8-byte account discriminator at offset 0.\n */\nexport async function findAllDisputes(\n rpc: Rpc<GetProgramAccountsApi>,\n config?: QueryConfig,\n): Promise<Account<Dispute>[]> {\n const results = await rpc\n .getProgramAccounts(ACCORD_PROGRAM_ID, {\n encoding: \"base64\",\n filters: [\n {\n memcmp: {\n offset: 0n,\n bytes: discriminatorToBase64(DISPUTE_DISCRIMINATOR),\n encoding: \"base64\",\n },\n },\n ],\n commitment: config?.commitment,\n })\n .send();\n\n return results.map(({ pubkey, account }) =>\n decodeDispute(parseBase64RpcAccount(pubkey as Address, account)),\n );\n}\n\n/**\n * Fetch every PendingUpdate account on-chain, decoded and typed.\n * Filters by the 8-byte account discriminator at offset 0.\n */\nexport async function findAllPendingUpdates(\n rpc: Rpc<GetProgramAccountsApi>,\n config?: QueryConfig,\n): Promise<Account<PendingUpdate>[]> {\n const results = await rpc\n .getProgramAccounts(ACCORD_PROGRAM_ID, {\n encoding: \"base64\",\n filters: [\n {\n memcmp: {\n offset: 0n,\n bytes: discriminatorToBase64(PENDING_UPDATE_DISCRIMINATOR),\n encoding: \"base64\",\n },\n },\n ],\n commitment: config?.commitment,\n })\n .send();\n\n return results.map(({ pubkey, account }) =>\n decodePendingUpdate(parseBase64RpcAccount(pubkey as Address, account)),\n );\n}\n","/**\n * domain.ts — domain document convention (ADR-0027, milestone accord-lgof).\n *\n * Canon defines a Subaccord's 32-byte `domain_ref` / a CanonList's\n * `rules_hash` as `sha256(rules_doc)` where `rules_doc` is the raw file bytes\n * (YAML frontmatter included). This module is the convention's single home:\n * hashing, frontmatter parsing (zero deps), verification against the on-chain\n * field, and the daemon fetch pipeline (`GET /domains/{hash}` → verify →\n * parse). The daemon itself is a format-blind CAS — it never parses; this\n * module does.\n *\n * Recommended format: markdown with optional YAML frontmatter carrying\n * `title` / `description`; the body is the rules. There is no `version`\n * key: the doc is content-addressed and immutable, so the hash IS the\n * version (ADR-0027 amendment). Any other bytes are valid opaque content —\n * hash-verified, `body`-only.\n */\nimport { sha256 } from \"@noble/hashes/sha256\";\nimport { bytesToHex } from \"@noble/hashes/utils\";\n\n/** Parsed domain document: optional frontmatter metadata + the body. */\nexport interface ParsedDomainDoc {\n title?: string;\n description?: string;\n body: string;\n}\n\n/** Result of fetching a domain doc from the daemon: verified bytes + parse. */\nexport interface FetchedDomainDoc {\n bytes: Uint8Array;\n contentType: string;\n doc: ParsedDomainDoc;\n}\n\n/** Options for {@link putDomainDoc} (ADR-0027 amendment — chain-anchored PUT). */\nexport interface PutDomainDocOptions {\n /**\n * Anchor Subaccord address (`?subaccord=`): the daemon resolves it\n * on-chain and requires its `domain_ref` to equal the doc hash\n * (create-first — publish only after the create-tx confirms).\n */\n subaccord: string;\n /** Content-Type for the PUT; defaults to `text/markdown`. */\n contentType?: string;\n}\n\n/** Success result of {@link putDomainDoc}: 201 created / 200 idempotent no-op. */\nexport interface PutDomainDocResult {\n status: 200 | 201;\n /** The doc's canonical 64-hex sha256 — the on-chain `domain_ref` value. */\n hash: string;\n}\n\n/**\n * Typed failure of {@link putDomainDoc}: the daemon rejected the publish.\n * `status` mirrors the daemon's HTTP status (400 hash/anchor mismatch /\n * missing param, 404 anchor not found, 409 collision alarm, 413 over cap,\n * 5xx transport); `body` carries the raw response body for the message.\n */\nexport class DomainPublishError extends Error {\n readonly status: number;\n readonly body: string;\n\n constructor(status: number, body: string) {\n super(`domain daemon rejected publish with ${status}: ${body}`);\n this.name = \"DomainPublishError\";\n this.status = status;\n this.body = body;\n }\n}\n\nconst FRONTMATTER_DELIM = \"---\";\nconst HEX64 = /^[0-9a-fA-F]{64}$/;\n\n/** `sha256(bytes)` as lowercase 64-hex — the canonical `domain_ref` string form. */\nexport function hashDomainDoc(bytes: Uint8Array): string {\n return bytesToHex(sha256(bytes));\n}\n\n/**\n * Verify raw doc bytes against an on-chain `domain_ref` — either the 32 raw\n * bytes or its 64-hex string form. False on any mismatch or wrong ref shape.\n */\nexport function verifyDomainDoc(\n bytes: Uint8Array,\n domainRef: Uint8Array | string,\n): boolean {\n const digest = sha256(bytes);\n if (typeof domainRef === \"string\") {\n return (\n HEX64.test(domainRef) && domainRef.toLowerCase() === bytesToHex(digest)\n );\n }\n if (domainRef.length !== 32) return false;\n return domainRef.every((b, i) => b === digest[i]);\n}\n\n/**\n * Parse a domain doc: optional `---`-delimited frontmatter with `title` /\n * `description` (single-line `key: value`, surrounding quotes stripped),\n * everything after the closing delimiter is `body`. Absent or unterminated\n * frontmatter ⇒ the whole text is `body`. Unknown keys (including any\n * `version`) are ignored.\n */\nexport function parseDomainDoc(bytes: Uint8Array): ParsedDomainDoc {\n const text = new TextDecoder().decode(bytes);\n const split = splitFrontmatter(text);\n if (!split) return { body: text };\n const meta = parseFrontmatter(split.frontmatter);\n return { ...meta, body: split.body };\n}\n\n/**\n * Fetch a domain doc from the evidence daemon (`GET {daemonUrl}/domains/{hash}`),\n * verify `sha256(bytes) === hash`, and parse it. Throws on non-200 responses\n * and on verification failure (tampered or mismatched bytes).\n */\nexport async function fetchDomainDoc(\n daemonUrl: string,\n hash: string,\n): Promise<FetchedDomainDoc> {\n const res = await fetch(`${daemonUrl.replace(/\\/+$/, \"\")}/domains/${hash}`);\n if (!res.ok) {\n throw new Error(`domain daemon returned ${res.status} for ${hash}`);\n }\n const bytes = new Uint8Array(await res.arrayBuffer());\n if (!verifyDomainDoc(bytes, hash)) {\n throw new Error(`domain doc ${hash} failed sha256 verification`);\n }\n return {\n bytes,\n contentType: res.headers.get(\"content-type\") ?? \"text/markdown\",\n doc: parseDomainDoc(bytes),\n };\n}\n\n/**\n * Publish a domain doc to the evidence daemon's public CAS\n * (`PUT {daemonUrl}/domains/{sha256(bytes)}?subaccord=<addr>`) — the single\n * publish implementation; the CLI and both dApps consume this (ADR-0027\n * amendment, bean accord-uecf). Create-first: call only after the create-tx\n * with `domain_ref = hash` has confirmed — the daemon anchor-verifies.\n * Resolves `{ status, hash }` on 201 (created) / 200 (identical bytes already\n * stored — idempotent no-op); throws {@link DomainPublishError} on any other\n * status, carrying `status` + raw body.\n */\nexport async function putDomainDoc(\n daemonUrl: string,\n bytes: Uint8Array,\n options: PutDomainDocOptions,\n): Promise<PutDomainDocResult> {\n const hash = hashDomainDoc(bytes);\n const res = await fetch(\n `${daemonUrl.replace(/\\/+$/, \"\")}/domains/${hash}?subaccord=${encodeURIComponent(options.subaccord)}`,\n {\n method: \"PUT\",\n headers: { \"content-type\": options.contentType ?? \"text/markdown\" },\n // ponytail: cast — base lib.dom's BodyInit predates generic\n // Uint8Array<ArrayBufferLike>; no copy needed for a valid body.\n body: bytes as unknown as BodyInit,\n },\n );\n if (res.status === 200 || res.status === 201) {\n return { status: res.status, hash };\n }\n throw new DomainPublishError(res.status, await res.text());\n}\n\n/** Split `---\\n…\\n---\\n<body>`; null when there is no (well-formed) frontmatter. */\nfunction splitFrontmatter(\n text: string,\n): { frontmatter: string; body: string } | null {\n if (!text.startsWith(FRONTMATTER_DELIM)) return null;\n let rest = text.slice(FRONTMATTER_DELIM.length);\n if (rest.startsWith(\"\\r\\n\")) rest = rest.slice(2);\n else if (rest.startsWith(\"\\n\")) rest = rest.slice(1);\n else return null; // `---` is body content (e.g. a thematic break), not a delimiter\n const lines = rest.split(\"\\n\");\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i]!;\n const bare = line.endsWith(\"\\r\") ? line.slice(0, -1) : line;\n if (bare === FRONTMATTER_DELIM) {\n return {\n frontmatter: lines.slice(0, i).join(\"\\n\"),\n body: lines.slice(i + 1).join(\"\\n\"),\n };\n }\n }\n return null; // unterminated frontmatter — treat whole text as body\n}\n\n/** Line-based `key: value` scan of the frontmatter block (title/description only). */\nfunction parseFrontmatter(text: string): Partial<ParsedDomainDoc> {\n const out: Partial<ParsedDomainDoc> = {};\n for (const line of text.split(\"\\n\")) {\n const bare = line.endsWith(\"\\r\") ? line.slice(0, -1) : line;\n const idx = bare.indexOf(\":\");\n if (idx <= 0) continue;\n const key = bare.slice(0, idx).trim();\n const value = unquote(bare.slice(idx + 1).trim());\n if (!value) continue;\n if (key === \"title\") out.title = value;\n else if (key === \"description\") out.description = value;\n }\n return out;\n}\n\nfunction unquote(s: string): string {\n if (\n s.length >= 2 &&\n ((s[0] === '\"' && s.endsWith('\"')) || (s[0] === \"'\" && s.endsWith(\"'\")))\n ) {\n return s.slice(1, -1);\n }\n return s;\n}\n","/**\n * @useaccord/sdk — TypeScript SDK for the VeriDAO Accord program on Solana.\n *\n * Public surface:\n * - `Accord` — facade class (primary entry point)\n * - `wallet` — signer adapter (Keypair | IWallet → Kit TransactionSigner)\n * - `pda` — canonical PDA derivations (all 8 accounts)\n * - `constants` — v1 protocol defaults and bounds\n * - `errors` — typed AccordError code map\n * - `types` — domain enums and structs (re-exported from generated)\n * - `generated` — raw Codama output (codecs, Ix builders, account fetchers)\n * - `methods/*` — per-instruction facades (dispute, voting, snapshot,\n * lifecycle, vrf, staking, appeal) over the Kit client\n *\n * @see ADR-0010\n */\n\nexport { Accord, type AccordClient, type AccordConfig } from \"./accord\";\nexport { createAccordAdapter, type AccordAdapter } from \"./adapter\";\nexport { createAccordMethods, type AccordMethods } from \"./methods\";\nexport {\n type AccordSigner,\n type IWallet,\n signerFromKeypairBytes,\n signerFromWallet,\n} from \"./wallet\";\nexport {\n ACCORD_PROGRAM_ID,\n findAppealBondPda,\n findDisputePda,\n findJurorStakePda,\n findAccordStatePda,\n findPendingUpdatePda,\n findProgramIdentityPda,\n findRoundPda,\n findSubaccordPda,\n} from \"./pda\";\n// Generated program address — the single source the facade `ACCORD_PROGRAM_ID`\n// aliases. Exposed so Arbitrable SDKs (e.g. @useaccord/canon) can source the\n// Accord program identity from generated code instead of hard-coding it.\nexport { ACCORD_PROGRAM_ADDRESS } from \"./generated/programs/accord.js\";\nexport {\n ASSOCIATED_TOKEN_PROGRAM_ADDRESS,\n TOKEN_PROGRAM_ADDRESS,\n findAssociatedTokenAddress,\n} from \"./token\";\nexport * from \"./constants\";\nexport {\n fetchAppealBond,\n fetchAppealBondMaybe,\n fetchDispute,\n fetchDisputeMaybe,\n fetchJurorStake,\n fetchJurorStakeMaybe,\n fetchAccordState,\n fetchAccordStateMaybe,\n fetchPendingUpdate,\n fetchPendingUpdateMaybe,\n fetchRound,\n fetchRoundMaybe,\n fetchSubaccord,\n fetchSubaccordMaybe,\n} from \"./fetch\";\nexport {\n findAllJurorStakes,\n findAllSubaccords,\n findDisputesByFiler,\n findDisputesBySubaccord,\n findJurorStakesByJuror,\n findJurorStakesBySubaccord,\n} from \"./query\";\nexport {\n AccordErrors,\n ACCORD_ERROR_CODE_OFFSET,\n type AccordErrorCode,\n type AccordErrorName,\n} from \"./errors\";\nexport * from \"./types\";\n\nexport const SDK_NAME = \"@useaccord/sdk\";\nexport const SDK_VERSION = \"0.1.0\";\n\n// Arbitrable CPI API — the primary external surface (ADR-0010, bean veridao-50qy).\nexport * from \"./methods/dispute.js\";\n\n// Commit-reveal voting + finalization cranks + the commit-hash helper\n// (ADR-0010, bean veridao-a0mc).\nexport * from \"./methods/voting.js\";\n\n// Stake accumulator (ADR-0012): subtree-sum MST builder + proofs — the\n// byte-exact reference the on-chain verifier matches. Used by `stake`/\n// `requestWithdraw`/`reconcileStake` (path) and `draw_seat` (membership +\n// sortition prefix).\nexport {\n type MerkleAccumulator,\n type MSTNode,\n type LeafClaim,\n leafHash,\n emptyRoot,\n buildAccumulator,\n proofFor,\n recomputeRoot,\n verifyMembership,\n} from \"./methods/mst.js\";\n\n// Subaccord lifecycle + circuit breaker (ADR-0005/0007) + timelock helpers\n// (ADR-0010, bean veridao-erv7).\nexport * from \"./methods/lifecycle.js\";\n\n// VRF request + per-seat draw_seat choreography + sortition slot derivation\n// (ADR-0009 §2 + ADR-0012, bean veridao-j7tx).\nexport * from \"./methods/vrf.js\";\n\n// Juror capital stake / two-phase withdraw (requestWithdraw + withdraw) +\n// reconcileStake crank + the active_draws typed guard (ADR-0003/0007/0012,\n// REVIEW #4/#5, bean veridao-o8ki).\nexport * from \"./methods/staking.js\";\n\n// Per-round settlement crank + dispute cancellation (settleRound / cancelDispute,\n// ADR-0010, bean accord-dedf).\nexport * from \"./methods/settlement.js\";\n\n// Dispute appeal + bond refund + appeal-ladder math (ADR-0004, ADR-0010,\n// bean veridao-yny6).\nexport * from \"./methods/appeal.js\";\n\n// Stake / unstake MST accumulator proof orchestration (ADR-0012, bean\n// accord-bko6). Given a Subaccord's accumulator state + all its JurorStake\n// accounts, builds the canonical tree, verifies the root, and returns the\n// Merkle proof for stake / requestWithdraw / reconcileStake.\nexport {\n prepareStakeProof,\n type SubaccordAccumulatorView,\n type JurorStakeLeaf,\n type StakeProofResult,\n} from \"./methods/stakeFlow.js\";\n\n// Dispute phase label + countdown for the juror dashboard (bean accord-m4gt).\nexport {\n disputePhase,\n type RoundPhaseWindows,\n type PhaseInfo,\n} from \"./methods/disputePhase.js\";\n\n// Account codecs — exposed for advanced/test use (e.g. e2e VRF injection via\n// `surfnet_setAccount`: decode → set committedVrf → re-encode; daemon unit\n// tests encode fixtures over a stubbed RPC). Generated surface.\nexport {\n getDisputeEncoder,\n getDisputeCodec,\n DISPUTE_DISCRIMINATOR,\n} from \"./generated/accounts/dispute.js\";\nexport {\n getRoundEncoder,\n getRoundCodec,\n ROUND_DISCRIMINATOR,\n} from \"./generated/accounts/round.js\";\nexport {\n getSubaccordEncoder,\n getSubaccordCodec,\n SUBACCORD_DISCRIMINATOR,\n} from \"./generated/accounts/subaccord.js\";\n\n// Account decoders — pure (no `client.rpc`). The facade's typed fetchers\n// (`fetchX`) currently require a `ClientWithRpc` and break when the facade is\n// built over a raw `createSolanaRpc`; until that's fixed, read accounts via\n// raw `getAccountInfo` + these decoders.\n//\n// Generated `fetchMaybe*` functions work directly with a raw Kit RPC and return\n// typed `MaybeAccount<T>` — the correct read path for the frontend and tests.\nexport {\n type AppealBond,\n fetchMaybeAppealBond,\n fetchMaybeDispute,\n fetchMaybeJurorStake,\n fetchMaybeAccordState,\n fetchMaybePendingUpdate,\n fetchMaybeRound,\n fetchMaybeSubaccord,\n getAppealBondDecoder,\n getDisputeDecoder,\n getJurorStakeDecoder,\n getAccordStateDecoder,\n getPendingUpdateDecoder,\n getRoundDecoder,\n getSubaccordDecoder,\n type Dispute,\n type JurorStake,\n type AccordState,\n type PendingUpdate,\n type Round,\n type Subaccord,\n} from \"./generated/accounts/index.js\";\n\n// Typed getProgramAccounts query wrappers — no raw bytes leak to the caller\n// (ADR-0010, bean accord-3f19/accord-bp9y).\nexport {\n findAllDisputes,\n findAllPendingUpdates,\n type QueryConfig,\n} from \"./queries.js\";\n\n// Domain document convention (ADR-0027, milestone accord-lgof): sha256-CAS\n// hashing, frontmatter parsing, and daemon fetch/verify/publish for canon\n// rules docs. putDomainDoc is the single publish client (ADR-0027 amendment —\n// chain-anchored ?subaccord PUT).\nexport {\n DomainPublishError,\n hashDomainDoc,\n parseDomainDoc,\n putDomainDoc,\n verifyDomainDoc,\n fetchDomainDoc,\n type ParsedDomainDoc,\n type FetchedDomainDoc,\n type PutDomainDocOptions,\n type PutDomainDocResult,\n} from \"./domain.js\";\n"],"mappings":";;;;;AAUA;AAAA,EACE;AAAA,OAKK;;;ACRP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA,kBAAAA;AAAA,EACA,mBAAAC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAAC;AAAA,OAWK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OAGK;;;AC1BP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAcK;AAEA,IAAM,6BAAiD,IAAI,WAAW;AAAA,EAC3E;AAAA,EAAK;AAAA,EAAG;AAAA,EAAK;AAAA,EAAK;AAAA,EAAI;AAAA,EAAI;AAAA,EAAI;AAChC,CAAC;AA8CM,SAAS,wBAAkD;AAChE,SAAO;AAAA,IACL,iBAAiB;AAAA,MACf,CAAC,iBAAiB,eAAe,gBAAgB,GAAG,CAAC,CAAC;AAAA,MACtD,CAAC,aAAa,kBAAkB,CAAC;AAAA,MACjC,CAAC,UAAU,kBAAkB,CAAC;AAAA,MAC9B,CAAC,uBAAuB,iBAAiB,cAAc,CAAC,CAAC;AAAA,MACzD,CAAC,QAAQ,aAAa,CAAC;AAAA,MACvB,CAAC,WAAW,eAAe,gBAAgB,GAAG,EAAE,C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K;AACpC,UAAM,QAAQ,QAAQ,KAAK,MAAM,MAAM,CAAC,EAAE,KAAK,CAAC;AAChD,QAAI,CAAC,MAAO;AACZ,QAAI,QAAQ,QAAS,KAAI,QAAQ;AAAA,aACxB,QAAQ,cAAe,KAAI,cAAc;AAAA,EACpD;AACA,SAAO;AACT;AAbS;AAeT,SAAS,QAAQ,GAAmB;AAClC,MACE,EAAE,UAAU,MACV,EAAE,CAAC,MAAM,OAAO,EAAE,SAAS,GAAG,KAAO,EAAE,CAAC,MAAM,OAAO,EAAE,SAAS,GAAG,IACrE;AACA,WAAO,EAAE,MAAM,GAAG,EAAE;AAAA,EACtB;AACA,SAAO;AACT;AARS;;;AChIF,IAAM,WAAW;AACjB,IAAM,cAAc;","names":["fixEncoderSize","getBytesEncoder","SolanaError","assertAccountExists","assertAccountsExist","combineCodec","decodeAccount","fetchEncodedAccount","fetchEncodedAccounts","fixDecoderSize","fixEncoderSize","getAddressDecoder","getAddressEncoder","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","getU64Decoder","getU64Encoder","getU8Decoder","getU8Encoder","transformEncoder","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getAddressEncoder","getU64Encoder","getU8Encoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getAddressDecoder","getU64Decoder","getU8Decoder","combineCodec","decodeAccount","assertAccountExists","fetchEncodedAccount","assertAccountExists","assertAccountsExist","combineCodec","decodeAccount","fetchEncodedAccount","fetchEncodedAccounts","fixDecoderSize","fixEncoderSize","getAddressDecoder","getAddressEncoder","getBytesDecoder","getBytesEncoder","getOptionDecoder","getOptionEncoder","getStructDecoder","getStructEncoder","getU32Decoder","getU32Encoder","getU64Decoder","getU64Encoder","getU8Decoder","getU8Encoder","transformEncoder","combineCodec","Aggregation","combineCodec","combineCodec","getStructDecoder","getStructEncoder","getU32Decoder","getU32Encoder","getU64Decoder","getU64Encoder","getU8Decoder","getU8Encoder","getStructEncoder","getU64Encoder","getU8Encoder","getU32Encoder","getStructDecoder","getU64Decoder","getU8Decoder","getU32Decoder","combineCodec","getEnumDecoder","getEnumEncoder","DisputeState","getEnumEncoder","getEnumDecoder","combineCodec","getAddressDecoder","getAddressEncoder","getStructDecoder","getStructEncoder","getU64Decoder","getU64Encoder","getStructEncoder","getAddressEncoder","getU64Encoder","getStructDecoder","getAddressDecoder","getU64Decoder","combineCodec","combineCodec","fixDecoderSize","fixEncoderSize","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","getU64Decoder","getU64Encoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getU64Encoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getU64Decoder","combineCodec","combineCodec","getEnumDecoder","getEnumEncoder","ShortfallPolicy","getEnumEncoder","getEnumDecoder","combineCodec","combineCodec","getAddressDecoder","getAddressEncoder","getStructDecoder","getStructEncoder","getU16Decoder","getU16Encoder","getU64Decoder","getU64Encoder","getU8Decoder","getU8Encoder","getStructEncoder","getU64Encoder","getU16Encoder","getU8Encoder","getAddressEncoder","getStructDecoder","getU64Decoder","getU16Decoder","getU8Decoder","getAddressDecoder","combineCodec","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getAddressEncoder","getU64Encoder","getU8Encoder","getU32Encoder","getOptionEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getAddressDecoder","getU64Decoder","getU8Decoder","getU32Decoder","getOptionDecoder","combineCodec","decodeAccount","assertAccountExists","fetchEncodedAccount","assertAccountExists","assertAccountsExist","combineCodec","decodeAccount","fetchEncodedAccount","fetchEncodedAccounts","fixDecoderSize","fixEncoderSize","getAddressDecoder","getAddressEncoder","getBytesDecoder","getBytesEncoder","getI64Decoder","getI64Encoder","getStructDecoder","getStructEncoder","getU32Decoder","getU32Encoder","getU64Decoder","getU64Encoder","getU8Decoder","getU8Encoder","transformEncoder","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getAddressEncoder","getU64Encoder","getU32Encoder","getU8Encoder","getI64Encoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getAddressDecoder","getU64Decoder","getU32Decoder","getU8Decoder","getI64Decoder","combineCodec","decodeAccount","assertAccountExists","fetchEncodedAccount","assertAccountExists","assertAccountsExist","combineCodec","decodeAccount","fetchEncodedAccount","fetchEncodedAccounts","fixDecoderSize","fixEncoderSize","getAddressDecoder","getAddressEncoder","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","getU64Decoder","getU64Encoder","getU8Decoder","getU8Encoder","transformEncoder","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getAddressEncoder","getU64Encoder","getU8Encoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getAddressDecoder","getU64Decoder","getU8Decoder","combineCodec","decodeAccount","assertAccountExists","fetchEncodedAccount","assertAccountExists","assertAccountsExist","combineCodec","decodeAccount","fetchEncodedAccount","fetchEncodedAccounts","fixDecoderSize","fixEncoderSize","getAddressDecoder","getAddressEncoder","getArrayDecoder","getArrayEncoder","getBytesDecoder","getBytesEncoder","getI64Decoder","getI64Encoder","getStructDecoder","getStructEncoder","getU32Decoder","getU32Encoder","getU64Decoder","getU64Encoder","getU8Decoder","getU8Encoder","transformEncoder","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getU32Encoder","getU8Encoder","getI64Encoder","getU64Encoder","getAddressEncoder","getArrayEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getU32Decoder","getU8Decoder","getI64Decoder","getU64Decoder","getAddressDecoder","getArrayDecoder","combineCodec","decodeAccount","assertAccountExists","fetchEncodedAccount","assertAccountExists","assertAccountsExist","combineCodec","decodeAccount","fetchEncodedAccount","fetchEncodedAccounts","fixDecoderSize","fixEncoderSize","getAddressDecoder","getAddressEncoder","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","getU16Decoder","getU16Encoder","getU32Decoder","getU32Encoder","getU64Decoder","getU64Encoder","getU8Decoder","getU8Encoder","transformEncoder","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getAddressEncoder","getU64Encoder","getU16Encoder","getU8Encoder","getU32Encoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getAddressDecoder","getU64Decoder","getU16Decoder","getU8Decoder","getU32Decoder","combineCodec","decodeAccount","assertAccountExists","fetchEncodedAccount","combineCodec","fixDecoderSize","fixEncoderSize","getAddressEncoder","getBytesDecoder","getBytesEncoder","getProgramDerivedAddress","getStructDecoder","getStructEncoder","transformEncoder","getBytesEncoder","getBytesEncoder","getAddressEncoder","getBytesEncoder","getProgramDerivedAddress","getU32Encoder","getProgramDerivedAddress","getBytesEncoder","getAddressEncoder","getU32Encoder","getAddressEncoder","getBytesEncoder","getProgramDerivedAddress","getU64Encoder","getProgramDerivedAddress","getBytesEncoder","getAddressEncoder","getU64Encoder","getAddressEncoder","getBytesEncoder","getProgramDerivedAddress","getProgramDerivedAddress","getBytesEncoder","getAddressEncoder","getAddressEncoder","getBytesEncoder","getProgramDerivedAddress","getU64Encoder","getProgramDerivedAddress","getBytesEncoder","getAddressEncoder","getU64Encoder","getBytesEncoder","getProgramDerivedAddress","getProgramDerivedAddress","getBytesEncoder","getAddressEncoder","getBytesEncoder","getProgramDerivedAddress","getU32Encoder","getProgramDerivedAddress","getBytesEncoder","getAddressEncoder","getU32Encoder","fixEncoderSize","getAddressEncoder","getBytesEncoder","getProgramDerivedAddress","getProgramDerivedAddress","getBytesEncoder","getAddressEncoder","fixEncoderSize","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getProgramDerivedAddress","getAddressEncoder","getBytesEncoder","combineCodec","fixDecoderSize","fixEncoderSize","getAddressEncoder","getBytesDecoder","getBytesEncoder","getProgramDerivedAddress","getStructDecoder","getStructEncoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getAddressFromResolvedInstructionAccount","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getProgramDerivedAddress","getAddressEncoder","getAddressFromResolvedInstructionAccount","getBytesEncoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getAddressEncoder","getBytesDecoder","getBytesEncoder","getProgramDerivedAddress","getStructDecoder","getStructEncoder","getU32Decoder","getU32Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getAddressFromResolvedInstructionAccount","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getU32Encoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getU32Decoder","getAddressFromResolvedInstructionAccount","getProgramDerivedAddress","getAddressEncoder","getBytesEncoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getAddressEncoder","getBytesDecoder","getBytesEncoder","getProgramDerivedAddress","getStructDecoder","getStructEncoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getAddressFromResolvedInstructionAccount","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getProgramDerivedAddress","getAddressEncoder","getAddressFromResolvedInstructionAccount","getBytesEncoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getAddressEncoder","getArrayDecoder","getArrayEncoder","getBytesDecoder","getBytesEncoder","getProgramDerivedAddress","getStructDecoder","getStructEncoder","getU64Decoder","getU64Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getAddressFromResolvedInstructionAccount","getNonNullResolvedInstructionInput","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getArrayEncoder","getU64Encoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getArrayDecoder","getU64Decoder","getAddressFromResolvedInstructionAccount","getNonNullResolvedInstructionInput","getProgramDerivedAddress","getAddressEncoder","getBytesEncoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getAddressDecoder","getAddressEncoder","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","getU16Decoder","getU16Encoder","getU32Decoder","getU32Encoder","getU64Decoder","getU64Encoder","getU8Decoder","getU8Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getAddressFromResolvedInstructionAccount","getNonNullResolvedInstructionInput","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getU64Encoder","getU16Encoder","getU8Encoder","getU32Encoder","getAddressEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getU64Decoder","getU16Decoder","getU8Decoder","getU32Decoder","getAddressDecoder","getAddressFromResolvedInstructionAccount","getNonNullResolvedInstructionInput","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getArrayDecoder","getArrayEncoder","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","getU32Decoder","getU32Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getU32Encoder","getArrayEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getU32Decoder","getArrayDecoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","getU64Decoder","getU64Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getAddressFromResolvedInstructionAccount","getNonNullResolvedInstructionInput","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getU64Encoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getU64Decoder","getAddressFromResolvedInstructionAccount","getNonNullResolvedInstructionInput","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getArrayDecoder","getArrayEncoder","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getAddressFromResolvedInstructionAccount","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getArrayEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getArrayDecoder","getAddressFromResolvedInstructionAccount","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getArrayDecoder","getArrayEncoder","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getArrayEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getArrayDecoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getArrayDecoder","getArrayEncoder","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getArrayEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getArrayDecoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getAddressEncoder","getBytesDecoder","getBytesEncoder","getProgramDerivedAddress","getStructDecoder","getStructEncoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getAddressFromResolvedInstructionAccount","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getProgramDerivedAddress","getAddressEncoder","getAddressFromResolvedInstructionAccount","getBytesEncoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getArrayDecoder","getArrayEncoder","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","getU64Decoder","getU64Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getAddressFromResolvedInstructionAccount","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getU64Encoder","getArrayEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getU64Decoder","getArrayDecoder","getAddressFromResolvedInstructionAccount","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","getU64Decoder","getU64Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getU64Encoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getU64Decoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getBytesDecoder","getBytesEncoder","getStructDecoder","getStructEncoder","getU32Decoder","getU32Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getAddressFromResolvedInstructionAccount","getNonNullResolvedInstructionInput","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getU32Encoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getU32Decoder","getAddressFromResolvedInstructionAccount","getNonNullResolvedInstructionInput","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getAddressEncoder","getArrayDecoder","getArrayEncoder","getBytesDecoder","getBytesEncoder","getProgramDerivedAddress","getStructDecoder","getStructEncoder","getU64Decoder","getU64Encoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getAddressFromResolvedInstructionAccount","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getU64Encoder","getArrayEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getU64Decoder","getArrayDecoder","getAddressFromResolvedInstructionAccount","getProgramDerivedAddress","getAddressEncoder","getBytesEncoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getAddressEncoder","getBytesDecoder","getBytesEncoder","getProgramDerivedAddress","getStructDecoder","getStructEncoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getAddressFromResolvedInstructionAccount","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getAddressFromResolvedInstructionAccount","getProgramDerivedAddress","getAddressEncoder","getBytesEncoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","combineCodec","fixDecoderSize","fixEncoderSize","getAddressEncoder","getBytesDecoder","getBytesEncoder","getProgramDerivedAddress","getStructDecoder","getStructEncoder","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","SolanaError","transformEncoder","getAccountMetaFactory","getAddressFromResolvedInstructionAccount","transformEncoder","getStructEncoder","fixEncoderSize","getBytesEncoder","getStructDecoder","fixDecoderSize","getBytesDecoder","getAddressFromResolvedInstructionAccount","getProgramDerivedAddress","getAddressEncoder","getBytesEncoder","getAccountMetaFactory","SolanaError","SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS","fixEncoderSize","getBytesEncoder","SolanaError","fixEncoderSize","getBytesEncoder","SolanaError","getAddressEncoder","getBytesEncoder","getProgramDerivedAddress","getU32Encoder","findRoundPda","getProgramDerivedAddress","getBytesEncoder","getAddressEncoder","getU32Encoder","getAddressDecoder","getAddressEncoder","getAddressEncoder","getProgramDerivedAddress","ACCORD_PROGRAM_ID","findDisputePda","getAddressEncoder","getProgramDerivedAddress","getAddressEncoder","getAddressDecoder","getAddressEncoder","getProgramDerivedAddress","U64_MAX","findSubaccordPda","getAddressEncoder","getProgramDerivedAddress","findPendingUpdatePda","AccountRole","getAddressEncoder","getProgramDerivedAddress","U64_MAX","stake","AccountRole","le8","stake","path","idx","sha256","getAddressEncoder","getProgramDerivedAddress","le4","getAddressEncoder","getProgramDerivedAddress","getAddressEncoder","getProgramDerivedAddress","getAddressEncoder","getAddressEncoder","getAddressEncoder","getAddressEncoder","sha256","sha256"]}
|