@useaccord/sdk 0.7.0 → 0.8.2

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.
@@ -14,7 +14,7 @@
14
14
  * - settle_round: programs/accord/src/lib.rs (1291)
15
15
  * - cancel_dispute: programs/accord/src/lib.rs (1539)
16
16
  */
17
- import type { Address, Instruction } from "@solana/kit";
17
+ import type { Address, GetAccountInfoApi, Instruction, Rpc } from "@solana/kit";
18
18
  /** Accounts for `settle_round`. */
19
19
  export interface SettleRoundAccounts {
20
20
  /** Any caller (permissionless crank). Signer. */
@@ -76,10 +76,32 @@ export interface AccordSettlementClient {
76
76
  export declare function settleRound(client: AccordSettlementClient, programId: Address, accounts: SettleRoundAccounts, roundIdx: number, remainingAccounts: Address[]): Instruction;
77
77
  /**
78
78
  * Build the permissionless `cancel_dispute` crank (lib.rs:1539). Refunds the
79
- * filer's fee when a round times out without a ruling. `remainingAccounts`
80
- * carries the Round + JurorStake + AppealBond PDAs the handler closes/refunds.
79
+ * filer's fee when a round times out without a ruling. Derive
80
+ * `remainingAccounts` with {@link deriveCancelDisputeRemainingAccounts} — the
81
+ * handler's strict accounting rejects any other layout.
81
82
  */
82
83
  export declare function cancelDispute(client: AccordSettlementClient, programId: Address, accounts: CancelDisputeAccounts, remainingAccounts: Address[]): Instruction;
84
+ /**
85
+ * Derive `cancel_dispute`'s `remainingAccounts`, mirroring the on-chain
86
+ * strict accounting (programs/accord/src/instructions/cancel_dispute.rs):
87
+ *
88
+ * 1. the current Round PDA + its panel's JurorStake PDAs — ONLY while
89
+ * `drawnSeats > 0`: `draw_seat` creates the Round, so a never-drawn
90
+ * dispute (dead VRF oracle — the classic pre-draw stall) has no account
91
+ * and the handler requires an EMPTY list.
92
+ * 2. every prior Round (`0..currentRound`) + its panel, ascending —
93
+ * `release_prior_rounds`.
94
+ * 3. one AppealBond PDA per appeal (`0..currentRound`) —
95
+ * `credit_bond_bounty_units`. Bond PDA seeds are the round BEING appealed
96
+ * (0-based appeal index); the bond's `roundIdx` FIELD records the round
97
+ * the appeal OPENED (seed + 1) — do not confuse them.
98
+ *
99
+ * A juror drawn into several rounds appears once per round — the handler
100
+ * counts occurrences, not addresses. (bean accord-br6a: the cranker, CLI,
101
+ * and reconciler each drifted from this layout independently; it lives here
102
+ * as the single source.)
103
+ */
104
+ export declare function deriveCancelDisputeRemainingAccounts(rpc: Rpc<GetAccountInfoApi>, programId: Address, dispute: Address, subaccord: Address, currentRound: number, drawnSeats: number): Promise<Address[]>;
83
105
  /**
84
106
  * Build the permissionless `claim_filing_bounty` crank (ADR-0030). Sweeps the
85
107
  * flip-bounty pool back to the filer when a dispute finalized WITHOUT ever
@@ -1 +1 @@
1
- {"version":3,"file":"settlement.d.ts","sourceRoot":"","sources":["../../src/methods/settlement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAExD,mCAAmC;AACnC,MAAM,WAAW,mBAAmB;IAClC,iDAAiD;IACjD,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,qBAAqB;IACpC,iDAAiD;IACjD,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,iEAAiE;IACjE,iBAAiB,EAAE,OAAO,CAAC;IAC3B,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,qDAAqD;AACrD,MAAM,WAAW,yBAAyB;IACxC,iDAAiD;IACjD,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,4EAA4E;I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SAAS,EAAE,OAAO,CAAC;QACnB,QAAQ,EAAE,yBAAyB,CAAC;KACrC,GAAG,WAAW,CAAC;CACjB;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,sBAAsB,EAC9B,SAAS,EAAE,OAAO,EAClB,QAAQ,EAAE,mBAAmB,EAC7B,QAAQ,EAAE,MAAM,EAChB,iBAAiB,EAAE,OAAO,EAAE,GAC3B,WAAW,CAUb;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,sBAAsB,EAC9B,SAAS,EAAE,OAAO,EAClB,QAAQ,EAAE,qBAAqB,EAC/B,iBAAiB,EAAE,OAAO,EAAE,GAC3B,WAAW,CAMb;AAKD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,oCAAoC,CACxD,GAAG,EAAE,GAAG,CAAC,iBAAiB,CAAC,EAC3B,SAAS,EAAE,OAAO,EAClB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,OAAO,EAClB,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,OAAO,EAAE,CAAC,CAiCpB;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,sBAAsB,EAC9B,SAAS,EAAE,OAAO,EAClB,QAAQ,EAAE,yBAAyB,GAClC,WAAW,CAEb"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useaccord/sdk",
3
- "version": "0.7.0",
3
+ "version": "0.8.2",
4
4
  "description": "TypeScript SDK for the Accord program on Solana",
5
5
  "repository": {
6
6
  "type": "git",