@useaccord/sdk 0.1.0
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/README.md +126 -0
- package/dist/accord.d.ts +43 -0
- package/dist/accord.d.ts.map +1 -0
- package/dist/adapter.d.ts +39 -0
- package/dist/adapter.d.ts.map +1 -0
- package/dist/chunk-7QVYU63E.js +7 -0
- package/dist/chunk-7QVYU63E.js.map +1 -0
- package/dist/constants.d.ts +83 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/domain.d.ts +73 -0
- package/dist/domain.d.ts.map +1 -0
- package/dist/errors.d.ts +64 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/evidence/crypto.d.ts +12 -0
- package/dist/evidence/crypto.d.ts.map +1 -0
- package/dist/evidence/ecies.d.ts +45 -0
- package/dist/evidence/ecies.d.ts.map +1 -0
- package/dist/evidence/fetch.d.ts +20 -0
- package/dist/evidence/fetch.d.ts.map +1 -0
- package/dist/evidence/index.d.ts +27 -0
- package/dist/evidence/index.d.ts.map +1 -0
- package/dist/evidence/index.js +392 -0
- package/dist/evidence/index.js.map +1 -0
- package/dist/evidence/keys.d.ts +33 -0
- package/dist/evidence/keys.d.ts.map +1 -0
- package/dist/evidence/manifest.d.ts +47 -0
- package/dist/evidence/manifest.d.ts.map +1 -0
- package/dist/evidence/options.d.ts +14 -0
- package/dist/evidence/options.d.ts.map +1 -0
- package/dist/evidence/parse.d.ts +39 -0
- package/dist/evidence/parse.d.ts.map +1 -0
- package/dist/evidence/publish.d.ts +45 -0
- package/dist/evidence/publish.d.ts.map +1 -0
- package/dist/fetch.d.ts +24 -0
- package/dist/fetch.d.ts.map +1 -0
- package/dist/generated/accounts/accordState.d.ts +58 -0
- package/dist/generated/accounts/accordState.d.ts.map +1 -0
- package/dist/generated/accounts/appealBond.d.ts +61 -0
- package/dist/generated/accounts/appealBond.d.ts.map +1 -0
- package/dist/generated/accounts/dispute.d.ts +213 -0
- package/dist/generated/accounts/dispute.d.ts.map +1 -0
- package/dist/generated/accounts/index.d.ts +15 -0
- package/dist/generated/accounts/index.d.ts.map +1 -0
- package/dist/generated/accounts/jurorStake.d.ts +137 -0
- package/dist/generated/accounts/jurorStake.d.ts.map +1 -0
- package/dist/generated/accounts/pendingUpdate.d.ts +43 -0
- package/dist/generated/accounts/pendingUpdate.d.ts.map +1 -0
- package/dist/generated/accounts/round.d.ts +143 -0
- package/dist/generated/accounts/round.d.ts.map +1 -0
- package/dist/generated/accounts/subaccord.d.ts +300 -0
- package/dist/generated/accounts/subaccord.d.ts.map +1 -0
- package/dist/generated/errors/accord.d.ts +160 -0
- package/dist/generated/errors/accord.d.ts.map +1 -0
- package/dist/generated/errors/index.d.ts +9 -0
- package/dist/generated/errors/index.d.ts.map +1 -0
- package/dist/generated/index.d.ts +14 -0
- package/dist/generated/index.d.ts.map +1 -0
- package/dist/generated/instructions/appeal.d.ts +107 -0
- package/dist/generated/instructions/appeal.d.ts.map +1 -0
- package/dist/generated/instructions/cancelDispute.d.ts +73 -0
- package/dist/generated/instructions/cancelDispute.d.ts.map +1 -0
- package/dist/generated/instructions/claimAppealRefund.d.ts +91 -0
- package/dist/generated/instructions/claimAppealRefund.d.ts.map +1 -0
- package/dist/generated/instructions/commit.d.ts +50 -0
- package/dist/generated/instructions/commit.d.ts.map +1 -0
- package/dist/generated/instructions/commitVrfCallback.d.ts +47 -0
- package/dist/generated/instructions/commitVrfCallback.d.ts.map +1 -0
- package/dist/generated/instructions/createDispute.d.ts +136 -0
- package/dist/generated/instructions/createDispute.d.ts.map +1 -0
- package/dist/generated/instructions/createSubaccord.d.ts +196 -0
- package/dist/generated/instructions/createSubaccord.d.ts.map +1 -0
- package/dist/generated/instructions/drawSeat.d.ts +74 -0
- package/dist/generated/instructions/drawSeat.d.ts.map +1 -0
- package/dist/generated/instructions/executeSubaccordUpdate.d.ts +43 -0
- package/dist/generated/instructions/executeSubaccordUpdate.d.ts.map +1 -0
- package/dist/generated/instructions/executeUnpause.d.ts +59 -0
- package/dist/generated/instructions/executeUnpause.d.ts.map +1 -0
- package/dist/generated/instructions/finalizeDispute.d.ts +46 -0
- package/dist/generated/instructions/finalizeDispute.d.ts.map +1 -0
- package/dist/generated/instructions/finalizeRound.d.ts +46 -0
- package/dist/generated/instructions/finalizeRound.d.ts.map +1 -0
- package/dist/generated/instructions/getRuling.d.ts +42 -0
- package/dist/generated/instructions/getRuling.d.ts.map +1 -0
- package/dist/generated/instructions/health.d.ts +37 -0
- package/dist/generated/instructions/health.d.ts.map +1 -0
- package/dist/generated/instructions/index.d.ts +37 -0
- package/dist/generated/instructions/index.d.ts.map +1 -0
- package/dist/generated/instructions/initializePause.d.ts +51 -0
- package/dist/generated/instructions/initializePause.d.ts.map +1 -0
- package/dist/generated/instructions/pause.d.ts +47 -0
- package/dist/generated/instructions/pause.d.ts.map +1 -0
- package/dist/generated/instructions/proposeSubaccordUpdate.d.ts +90 -0
- package/dist/generated/instructions/proposeSubaccordUpdate.d.ts.map +1 -0
- package/dist/generated/instructions/proposeUnpause.d.ts +47 -0
- package/dist/generated/instructions/proposeUnpause.d.ts.map +1 -0
- package/dist/generated/instructions/pruneJuror.d.ts +68 -0
- package/dist/generated/instructions/pruneJuror.d.ts.map +1 -0
- package/dist/generated/instructions/reclaimSlot.d.ts +48 -0
- package/dist/generated/instructions/reclaimSlot.d.ts.map +1 -0
- package/dist/generated/instructions/reconcileStake.d.ts +48 -0
- package/dist/generated/instructions/reconcileStake.d.ts.map +1 -0
- package/dist/generated/instructions/redraw.d.ts +86 -0
- package/dist/generated/instructions/redraw.d.ts.map +1 -0
- package/dist/generated/instructions/requestVrf.d.ts +71 -0
- package/dist/generated/instructions/requestVrf.d.ts.map +1 -0
- package/dist/generated/instructions/requestWithdraw.d.ts +61 -0
- package/dist/generated/instructions/requestWithdraw.d.ts.map +1 -0
- package/dist/generated/instructions/reveal.d.ts +53 -0
- package/dist/generated/instructions/reveal.d.ts.map +1 -0
- package/dist/generated/instructions/settleRound.d.ts +60 -0
- package/dist/generated/instructions/settleRound.d.ts.map +1 -0
- package/dist/generated/instructions/stake.d.ts +98 -0
- package/dist/generated/instructions/stake.d.ts.map +1 -0
- package/dist/generated/instructions/withdraw.d.ts +67 -0
- package/dist/generated/instructions/withdraw.d.ts.map +1 -0
- package/dist/generated/instructions/withdrawFees.d.ts +67 -0
- package/dist/generated/instructions/withdrawFees.d.ts.map +1 -0
- package/dist/generated/pdas/accordState.d.ts +12 -0
- package/dist/generated/pdas/accordState.d.ts.map +1 -0
- package/dist/generated/pdas/appealBond.d.ts +16 -0
- package/dist/generated/pdas/appealBond.d.ts.map +1 -0
- package/dist/generated/pdas/dispute.d.ts +16 -0
- package/dist/generated/pdas/dispute.d.ts.map +1 -0
- package/dist/generated/pdas/index.d.ts +16 -0
- package/dist/generated/pdas/index.d.ts.map +1 -0
- package/dist/generated/pdas/jurorStake.d.ts +16 -0
- package/dist/generated/pdas/jurorStake.d.ts.map +1 -0
- package/dist/generated/pdas/pendingUpdate.d.ts +16 -0
- package/dist/generated/pdas/pendingUpdate.d.ts.map +1 -0
- package/dist/generated/pdas/programIdentity.d.ts +12 -0
- package/dist/generated/pdas/programIdentity.d.ts.map +1 -0
- package/dist/generated/pdas/round.d.ts +16 -0
- package/dist/generated/pdas/round.d.ts.map +1 -0
- package/dist/generated/pdas/subaccord.d.ts +16 -0
- package/dist/generated/pdas/subaccord.d.ts.map +1 -0
- package/dist/generated/programs/accord.d.ts +182 -0
- package/dist/generated/programs/accord.d.ts.map +1 -0
- package/dist/generated/programs/index.d.ts +9 -0
- package/dist/generated/programs/index.d.ts.map +1 -0
- package/dist/generated/types/aggregation.d.ts +25 -0
- package/dist/generated/types/aggregation.d.ts.map +1 -0
- package/dist/generated/types/caseTerms.d.ts +87 -0
- package/dist/generated/types/caseTerms.d.ts.map +1 -0
- package/dist/generated/types/disputeState.d.ts +34 -0
- package/dist/generated/types/disputeState.d.ts.map +1 -0
- package/dist/generated/types/index.d.ts +15 -0
- package/dist/generated/types/index.d.ts.map +1 -0
- package/dist/generated/types/leafClaim.d.ts +27 -0
- package/dist/generated/types/leafClaim.d.ts.map +1 -0
- package/dist/generated/types/mSTNode.d.ts +26 -0
- package/dist/generated/types/mSTNode.d.ts.map +1 -0
- package/dist/generated/types/shortfallPolicy.d.ts +23 -0
- package/dist/generated/types/shortfallPolicy.d.ts.map +1 -0
- package/dist/generated/types/updatePayload.d.ts +107 -0
- package/dist/generated/types/updatePayload.d.ts.map +1 -0
- package/dist/index.d.ts +47 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8714 -0
- package/dist/index.js.map +1 -0
- package/dist/methods/appeal.d.ts +131 -0
- package/dist/methods/appeal.d.ts.map +1 -0
- package/dist/methods/dispute.d.ts +177 -0
- package/dist/methods/dispute.d.ts.map +1 -0
- package/dist/methods/disputePhase.d.ts +34 -0
- package/dist/methods/disputePhase.d.ts.map +1 -0
- package/dist/methods/lifecycle.d.ts +228 -0
- package/dist/methods/lifecycle.d.ts.map +1 -0
- package/dist/methods/mst.d.ts +100 -0
- package/dist/methods/mst.d.ts.map +1 -0
- package/dist/methods/settlement.d.ts +69 -0
- package/dist/methods/settlement.d.ts.map +1 -0
- package/dist/methods/stakeFlow.d.ts +65 -0
- package/dist/methods/stakeFlow.d.ts.map +1 -0
- package/dist/methods/staking.d.ts +220 -0
- package/dist/methods/staking.d.ts.map +1 -0
- package/dist/methods/voting.d.ts +227 -0
- package/dist/methods/voting.d.ts.map +1 -0
- package/dist/methods/vrf.d.ts +143 -0
- package/dist/methods/vrf.d.ts.map +1 -0
- package/dist/methods.d.ts +79 -0
- package/dist/methods.d.ts.map +1 -0
- package/dist/pda.d.ts +37 -0
- package/dist/pda.d.ts.map +1 -0
- package/dist/queries.d.ts +27 -0
- package/dist/queries.d.ts.map +1 -0
- package/dist/query.d.ts +30 -0
- package/dist/query.d.ts.map +1 -0
- package/dist/token.d.ts +24 -0
- package/dist/token.d.ts.map +1 -0
- package/dist/types.d.ts +19 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/wallet.d.ts +30 -0
- package/dist/wallet.d.ts.map +1 -0
- package/package.json +45 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { fetchEncodedAccount, fetchEncodedAccounts, type Account, type Address, type Codec, type Decoder, type EncodedAccount, type Encoder, type FetchAccountConfig, type FetchAccountsConfig, type MaybeAccount, type MaybeEncodedAccount, type ReadonlyUint8Array } from "@solana/kit";
|
|
9
|
+
import { type UpdatePayload, type UpdatePayloadArgs } from "../types";
|
|
10
|
+
export declare const PENDING_UPDATE_DISCRIMINATOR: ReadonlyUint8Array;
|
|
11
|
+
export declare function getPendingUpdateDiscriminatorBytes(): ReadonlyUint8Array;
|
|
12
|
+
export type PendingUpdate = {
|
|
13
|
+
discriminator: ReadonlyUint8Array;
|
|
14
|
+
subaccord: Address;
|
|
15
|
+
nonce: bigint;
|
|
16
|
+
proposed: UpdatePayload;
|
|
17
|
+
proposedBy: Address;
|
|
18
|
+
/** Earliest slot at which `execute_subaccord_update` may land. */
|
|
19
|
+
executeAfterSlot: bigint;
|
|
20
|
+
bump: number;
|
|
21
|
+
};
|
|
22
|
+
export type PendingUpdateArgs = {
|
|
23
|
+
subaccord: Address;
|
|
24
|
+
nonce: number | bigint;
|
|
25
|
+
proposed: UpdatePayloadArgs;
|
|
26
|
+
proposedBy: Address;
|
|
27
|
+
/** Earliest slot at which `execute_subaccord_update` may land. */
|
|
28
|
+
executeAfterSlot: number | bigint;
|
|
29
|
+
bump: number;
|
|
30
|
+
};
|
|
31
|
+
/** Gets the encoder for {@link PendingUpdateArgs} account data. */
|
|
32
|
+
export declare function getPendingUpdateEncoder(): Encoder<PendingUpdateArgs>;
|
|
33
|
+
/** Gets the decoder for {@link PendingUpdate} account data. */
|
|
34
|
+
export declare function getPendingUpdateDecoder(): Decoder<PendingUpdate>;
|
|
35
|
+
/** Gets the codec for {@link PendingUpdate} account data. */
|
|
36
|
+
export declare function getPendingUpdateCodec(): Codec<PendingUpdateArgs, PendingUpdate>;
|
|
37
|
+
export declare function decodePendingUpdate<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<PendingUpdate, TAddress>;
|
|
38
|
+
export declare function decodePendingUpdate<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<PendingUpdate, TAddress>;
|
|
39
|
+
export declare function fetchPendingUpdate<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<PendingUpdate, TAddress>>;
|
|
40
|
+
export declare function fetchMaybePendingUpdate<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<PendingUpdate, TAddress>>;
|
|
41
|
+
export declare function fetchAllPendingUpdate(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<PendingUpdate>[]>;
|
|
42
|
+
export declare function fetchAllMaybePendingUpdate(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<PendingUpdate>[]>;
|
|
43
|
+
//# sourceMappingURL=pendingUpdate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pendingUpdate.d.ts","sourceRoot":"","sources":["../../../src/generated/accounts/pendingUpdate.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAKL,mBAAmB,EACnB,oBAAoB,EAcpB,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,OAAO,EACZ,KAAK,cAAc,EACn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code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { fetchEncodedAccount, fetchEncodedAccounts, type Account, type Address, type EncodedAccount, type FetchAccountConfig, type FetchAccountsConfig, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type MaybeAccount, type MaybeEncodedAccount, type ReadonlyUint8Array } from "@solana/kit";
|
|
9
|
+
export declare const ROUND_DISCRIMINATOR: ReadonlyUint8Array;
|
|
10
|
+
export declare function getRoundDiscriminatorBytes(): ReadonlyUint8Array;
|
|
11
|
+
export type Round = {
|
|
12
|
+
discriminator: ReadonlyUint8Array;
|
|
13
|
+
roundIdx: number;
|
|
14
|
+
jurorCount: number;
|
|
15
|
+
commitCount: number;
|
|
16
|
+
revealCount: number;
|
|
17
|
+
/**
|
|
18
|
+
* Same-size redraw counter within this round (ADR-0021). Orthogonal to
|
|
19
|
+
* `round_idx`: bumping it changes only the sortition seed, never the panel
|
|
20
|
+
* size or the appeal budget. `(0,0)` = initial draw; resets implicitly on a
|
|
21
|
+
* new appeal round (fresh `Round` PDA keyed by the new `round_idx`).
|
|
22
|
+
*/
|
|
23
|
+
drawAttempt: number;
|
|
24
|
+
/**
|
|
25
|
+
* Whether this round's coherence settlement has been applied
|
|
26
|
+
* (CONCEPT-REVIEW Ugly 5 / bean accord-r6ti). 0 until
|
|
27
|
+
* `finalize_dispute` (final round) or `settle_round` (prior rounds)
|
|
28
|
+
* processes it; 1 after. Idempotency guard against double-settlement.
|
|
29
|
+
* (`u8` not `bool` — `bool` is not `Pod`.)
|
|
30
|
+
*/
|
|
31
|
+
settled: number;
|
|
32
|
+
bump: number;
|
|
33
|
+
pad0: ReadonlyUint8Array;
|
|
34
|
+
/** Commit opens at this timestamp (= draw_time + review_window). */
|
|
35
|
+
reviewEnd: bigint;
|
|
36
|
+
/** Reveal opens at this timestamp (= review_end + commit_window). */
|
|
37
|
+
commitEnd: bigint;
|
|
38
|
+
/** Round can be finalized after this timestamp (= commit_end + reveal_window). */
|
|
39
|
+
revealEnd: bigint;
|
|
40
|
+
/**
|
|
41
|
+
* The tallied round result; `u64::MAX` = not set. `Plurality`: winning
|
|
42
|
+
* option index. `Median` (ADR-0025): the median of revealed scalar votes.
|
|
43
|
+
*/
|
|
44
|
+
result: bigint;
|
|
45
|
+
dispute: Address;
|
|
46
|
+
jurors: Array<Address>;
|
|
47
|
+
/**
|
|
48
|
+
* `hash(vote_le, salt, juror_pubkey)` per drawn Juror; `[0;32]` until
|
|
49
|
+
* committed. `vote_le` = the 8-byte little-endian vote (ADR-0025).
|
|
50
|
+
*/
|
|
51
|
+
commits: Array<ReadonlyUint8Array>;
|
|
52
|
+
/**
|
|
53
|
+
* Cumulative-from-left prefix per drawn seat (bean accord-tzo0). Filled
|
|
54
|
+
* when the seat lands; later seats read these to verify that every prior
|
|
55
|
+
* sortition retry genuinely collided with an already-drawn juror —
|
|
56
|
+
* eliminating caller choice (no draw_attempt grind).
|
|
57
|
+
*/
|
|
58
|
+
seatPrefix: Array<bigint>;
|
|
59
|
+
/**
|
|
60
|
+
* Leaf stake per drawn seat. With `seat_prefix`, defines the sortition
|
|
61
|
+
* range `[prefix, prefix+stake)` used for deterministic collision checks.
|
|
62
|
+
*/
|
|
63
|
+
seatStake: Array<bigint>;
|
|
64
|
+
/**
|
|
65
|
+
* Revealed vote per drawn Juror; `u64::MAX` until revealed. Option index
|
|
66
|
+
* for `Plurality`, fixed-point scalar (settlement-mint base units) for
|
|
67
|
+
* `Median` (ADR-0025). Tail field — struct size stays a multiple of 8.
|
|
68
|
+
*/
|
|
69
|
+
reveals: Array<bigint>;
|
|
70
|
+
};
|
|
71
|
+
export type RoundArgs = {
|
|
72
|
+
roundIdx: number;
|
|
73
|
+
jurorCount: number;
|
|
74
|
+
commitCount: number;
|
|
75
|
+
revealCount: number;
|
|
76
|
+
/**
|
|
77
|
+
* Same-size redraw counter within this round (ADR-0021). Orthogonal to
|
|
78
|
+
* `round_idx`: bumping it changes only the sortition seed, never the panel
|
|
79
|
+
* size or the appeal budget. `(0,0)` = initial draw; resets implicitly on a
|
|
80
|
+
* new appeal round (fresh `Round` PDA keyed by the new `round_idx`).
|
|
81
|
+
*/
|
|
82
|
+
drawAttempt: number;
|
|
83
|
+
/**
|
|
84
|
+
* Whether this round's coherence settlement has been applied
|
|
85
|
+
* (CONCEPT-REVIEW Ugly 5 / bean accord-r6ti). 0 until
|
|
86
|
+
* `finalize_dispute` (final round) or `settle_round` (prior rounds)
|
|
87
|
+
* processes it; 1 after. Idempotency guard against double-settlement.
|
|
88
|
+
* (`u8` not `bool` — `bool` is not `Pod`.)
|
|
89
|
+
*/
|
|
90
|
+
settled: number;
|
|
91
|
+
bump: number;
|
|
92
|
+
pad0: ReadonlyUint8Array;
|
|
93
|
+
/** Commit opens at this timestamp (= draw_time + review_window). */
|
|
94
|
+
reviewEnd: number | bigint;
|
|
95
|
+
/** Reveal opens at this timestamp (= review_end + commit_window). */
|
|
96
|
+
commitEnd: number | bigint;
|
|
97
|
+
/** Round can be finalized after this timestamp (= commit_end + reveal_window). */
|
|
98
|
+
revealEnd: number | bigint;
|
|
99
|
+
/**
|
|
100
|
+
* The tallied round result; `u64::MAX` = not set. `Plurality`: winning
|
|
101
|
+
* option index. `Median` (ADR-0025): the median of revealed scalar votes.
|
|
102
|
+
*/
|
|
103
|
+
result: number | bigint;
|
|
104
|
+
dispute: Address;
|
|
105
|
+
jurors: Array<Address>;
|
|
106
|
+
/**
|
|
107
|
+
* `hash(vote_le, salt, juror_pubkey)` per drawn Juror; `[0;32]` until
|
|
108
|
+
* committed. `vote_le` = the 8-byte little-endian vote (ADR-0025).
|
|
109
|
+
*/
|
|
110
|
+
commits: Array<ReadonlyUint8Array>;
|
|
111
|
+
/**
|
|
112
|
+
* Cumulative-from-left prefix per drawn seat (bean accord-tzo0). Filled
|
|
113
|
+
* when the seat lands; later seats read these to verify that every prior
|
|
114
|
+
* sortition retry genuinely collided with an already-drawn juror —
|
|
115
|
+
* eliminating caller choice (no draw_attempt grind).
|
|
116
|
+
*/
|
|
117
|
+
seatPrefix: Array<number | bigint>;
|
|
118
|
+
/**
|
|
119
|
+
* Leaf stake per drawn seat. With `seat_prefix`, defines the sortition
|
|
120
|
+
* range `[prefix, prefix+stake)` used for deterministic collision checks.
|
|
121
|
+
*/
|
|
122
|
+
seatStake: Array<number | bigint>;
|
|
123
|
+
/**
|
|
124
|
+
* Revealed vote per drawn Juror; `u64::MAX` until revealed. Option index
|
|
125
|
+
* for `Plurality`, fixed-point scalar (settlement-mint base units) for
|
|
126
|
+
* `Median` (ADR-0025). Tail field — struct size stays a multiple of 8.
|
|
127
|
+
*/
|
|
128
|
+
reveals: Array<number | bigint>;
|
|
129
|
+
};
|
|
130
|
+
/** Gets the encoder for {@link RoundArgs} account data. */
|
|
131
|
+
export declare function getRoundEncoder(): FixedSizeEncoder<RoundArgs>;
|
|
132
|
+
/** Gets the decoder for {@link Round} account data. */
|
|
133
|
+
export declare function getRoundDecoder(): FixedSizeDecoder<Round>;
|
|
134
|
+
/** Gets the codec for {@link Round} account data. */
|
|
135
|
+
export declare function getRoundCodec(): FixedSizeCodec<RoundArgs, Round>;
|
|
136
|
+
export declare function decodeRound<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<Round, TAddress>;
|
|
137
|
+
export declare function decodeRound<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<Round, TAddress>;
|
|
138
|
+
export declare function fetchRound<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<Round, TAddress>>;
|
|
139
|
+
export declare function fetchMaybeRound<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<Round, TAddress>>;
|
|
140
|
+
export declare function fetchAllRound(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<Round>[]>;
|
|
141
|
+
export declare function fetchAllMaybeRound(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<Round>[]>;
|
|
142
|
+
export declare function getRoundSize(): number;
|
|
143
|
+
//# sourceMappingURL=round.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"round.d.ts","sourceRoot":"","sources":["../../../src/generated/accounts/round.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAKL,mBAAmB,EACnB,oBAAoB,EAoBpB,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACxB,MAAM,aAAa,CAAC;AAErB,eAAO,MAAM,mBAAmB,EAAE,kBAEhC,CAAC;AAEH,wBAAgB,0BAA0B,IAAI,kBAAkB,CAE/D;AAED,MAAM,MAAM,KAAK,GAAG;IAClB,aAAa,EAAE,kBAAkB,CAAC;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;;OAMG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,kBAAkB,CAAC;IACzB,oEAAoE;IACpE,SAAS,EAAE,MAAM,CAAC;IAClB,qEAAqE;IACrE,SAAS,EAAE,MAAM,CAAC;IAClB,k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AU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC,CAAC,EAC/C,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,EACzB,MAAM,CAAC,EAAE,mBAAmB,GAC3B,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAI3B;AAED,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC,CAAC,EAC/C,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,EACzB,MAAM,CAAC,EAAE,mBAAmB,GAC3B,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC,CAGhC;AAED,wBAAgB,YAAY,IAAI,MAAM,CAErC"}
|
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
import { fetchEncodedAccount, fetchEncodedAccounts, type Account, type Address, type EncodedAccount, type FetchAccountConfig, type FetchAccountsConfig, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type MaybeAccount, type MaybeEncodedAccount, type ReadonlyUint8Array } from "@solana/kit";
|
|
9
|
+
import { type Aggregation, type AggregationArgs, type ShortfallPolicy, type ShortfallPolicyArgs } from "../types";
|
|
10
|
+
export declare const SUBACCORD_DISCRIMINATOR: ReadonlyUint8Array;
|
|
11
|
+
export declare function getSubaccordDiscriminatorBytes(): ReadonlyUint8Array;
|
|
12
|
+
export type Subaccord = {
|
|
13
|
+
discriminator: ReadonlyUint8Array;
|
|
14
|
+
creator: Address;
|
|
15
|
+
stakingToken: Address;
|
|
16
|
+
/**
|
|
17
|
+
* Compensation mint — fees + appeal bonds (ADR-0020). Distinct from
|
|
18
|
+
* `staking_token` so collateral and compensation are decoupled.
|
|
19
|
+
*/
|
|
20
|
+
feeToken: Address;
|
|
21
|
+
minStake: bigint;
|
|
22
|
+
/**
|
|
23
|
+
* Slash factor in basis points (10% = 1000). Incoherent Juror loses
|
|
24
|
+
* `alpha_bps * min_stake / 10_000` (flat — ADR-0003 consequence).
|
|
25
|
+
*/
|
|
26
|
+
alphaBps: number;
|
|
27
|
+
reviewWindow: bigint;
|
|
28
|
+
commitWindow: bigint;
|
|
29
|
+
revealWindow: bigint;
|
|
30
|
+
/**
|
|
31
|
+
* Appeal window after a round resolves before the dispute goes final
|
|
32
|
+
* (ADR-0022). Per-Subaccord; frozen onto `CaseTerms` at filing.
|
|
33
|
+
*/
|
|
34
|
+
appealWindow: bigint;
|
|
35
|
+
maxAppeals: number;
|
|
36
|
+
/**
|
|
37
|
+
* Round-1 (round-0) juror panel size (accord-9q3e, supersedes ADR-0019's
|
|
38
|
+
* fixed constant). Immutable at creation — determines the appeal-ladder
|
|
39
|
+
* geometry `(J+1)·2^k − 1`. Must be odd (tie avoidance) and the ladder top
|
|
40
|
+
* `(J+1)·2^max_appeals − 1` must fit `MAX_JURORS`. Default 3. Frozen onto
|
|
41
|
+
* `CaseTerms` at filing so governance cannot shift panel size mid-dispute.
|
|
42
|
+
* A pool wanting a single juror sets `min_jury_size = 1` + `max_appeals = 0`.
|
|
43
|
+
*/
|
|
44
|
+
minJurySize: number;
|
|
45
|
+
/** Per-Subaccord aggregation rule (ADR-0019). v1 = `Plurality`. */
|
|
46
|
+
aggregation: Aggregation;
|
|
47
|
+
feePerJuror: bigint;
|
|
48
|
+
/**
|
|
49
|
+
* Reveal-quorum fraction in basis points (ADR-0021). A round is
|
|
50
|
+
* authoritative only if `reveal_count >= ceil(panel × bps / 10_000)`.
|
|
51
|
+
* Default 6666 (= 2/3); the absolute commitment escalates per appeal
|
|
52
|
+
* for free via panel growth.
|
|
53
|
+
*/
|
|
54
|
+
revealThresholdBps: number;
|
|
55
|
+
/** What to do on a shortfall (ADR-0021). v1 = `Redraw`. */
|
|
56
|
+
shortfallPolicy: ShortfallPolicy;
|
|
57
|
+
/**
|
|
58
|
+
* Maximum same-size redraws per round before the dispute fails (ADR-0021).
|
|
59
|
+
* `(round_idx, draw_attempt)` with `draw_attempt` reaching this bound ⇒
|
|
60
|
+
* `Failed`. Orthogonal to `max_appeals` (which bounds `round_idx`).
|
|
61
|
+
*/
|
|
62
|
+
maxDrawAttempts: number;
|
|
63
|
+
/**
|
|
64
|
+
* Coherence tolerance for `Median` pools (ADR-0025), in bps of the final
|
|
65
|
+
* median: a revealed vote is coherent iff
|
|
66
|
+
* `|vote − ruling| · 10_000 ≤ ruling · coherence_tol_bps`. `0` = exact
|
|
67
|
+
* match. Inert for `Plurality` (exact option equality). Frozen onto
|
|
68
|
+
* `CaseTerms` at filing; immutable on the Subaccord (not in
|
|
69
|
+
* `UpdatePayload`) — it defines the pool's coherence game.
|
|
70
|
+
*/
|
|
71
|
+
coherenceTolBps: number;
|
|
72
|
+
/** `Pubkey::default()` => immutable. Otherwise signs propose/execute updates. */
|
|
73
|
+
authority: Address;
|
|
74
|
+
evidenceOperator: Address;
|
|
75
|
+
/** Immutable identity hash: what class of dispute this pool adjudicates. */
|
|
76
|
+
domainRef: ReadonlyUint8Array;
|
|
77
|
+
/** Immutable evidence-format spec hash (ADR-0006). */
|
|
78
|
+
evidenceSpec: ReadonlyUint8Array;
|
|
79
|
+
/**
|
|
80
|
+
* Attestation-gated juror pool (PROG-ATTESTTION). When both are
|
|
81
|
+
* `Pubkey::default()` the Subaccord is stake-only (today's behavior,
|
|
82
|
+
* unchanged). When set, jurors must hold a valid SAS attestation from
|
|
83
|
+
* `juror_credential` under `juror_schema` to stake and be drawn. Immutable
|
|
84
|
+
* at creation — joins `domain_ref` + `evidence_spec` as the identity
|
|
85
|
+
* triplet (ADR-0005). Both-or-neither: a half-bound Subaccord is rejected
|
|
86
|
+
* at `create_subaccord` (`AttestationBindingPartial`).
|
|
87
|
+
*/
|
|
88
|
+
jurorCredential: Address;
|
|
89
|
+
jurorSchema: Address;
|
|
90
|
+
/**
|
|
91
|
+
* Count of **distinct Jurors with any stake** (`JurorStake.staked > 0`).
|
|
92
|
+
* Maintained O(1) by `stake`/`unstake` (0→positive increments,
|
|
93
|
+
* positive→0 decrements). This is a *coarse* intake gate for
|
|
94
|
+
* `create_dispute`/`appeal` (SPEC edge case: revert if fewer active
|
|
95
|
+
* distinct stakers than the required panel). It deliberately does NOT track
|
|
96
|
+
* `min_stake` eligibility — that changes via the 48h timelock and cannot be
|
|
97
|
+
* recomputed without the O(n) ledger ADR-0003 rejected. Precise eligibility
|
|
98
|
+
* (amount ≥ min_stake, distinctness) is verified at `draw` against the
|
|
99
|
+
* finalized Merkle Snapshot.
|
|
100
|
+
*/
|
|
101
|
+
stakerCount: number;
|
|
102
|
+
/**
|
|
103
|
+
* On-chain stake accumulator root (ADR-0012). Maintained incrementally on
|
|
104
|
+
* every `stake`/`unstake` via client-supplied Merkle paths; canonical by
|
|
105
|
+
* construction — there is no posted root to withhold or fabricate.
|
|
106
|
+
*/
|
|
107
|
+
rootHash: ReadonlyUint8Array;
|
|
108
|
+
/** Total stake committed to by the accumulator tree (= root node sum). */
|
|
109
|
+
totalStake: bigint;
|
|
110
|
+
/**
|
|
111
|
+
* Next free leaf index in the append-only tree. Incremented once per
|
|
112
|
+
* first-time staker; never reused (full unstake zeros the leaf weight but
|
|
113
|
+
* keeps its `tree_index`).
|
|
114
|
+
*/
|
|
115
|
+
nextIndex: number;
|
|
116
|
+
/** Fixed tree depth (bounds the pool at `2^depth`). Set at `create_subaccord`. */
|
|
117
|
+
depth: number;
|
|
118
|
+
/**
|
|
119
|
+
* Parallel vault ledger — fee side (bean accord-fdad). Tracks every
|
|
120
|
+
* `fee_token` SPL transfer in/out of the `fee_vault`, independent of the
|
|
121
|
+
* vault's live balance. The vault balance is a *derivable consequence*:
|
|
122
|
+
* `fee_vault.amount == fee_vault_deposited - fee_vault_withdrawn`
|
|
123
|
+
* (separate-mint) or the fee portion of a shared ATA (same-mint).
|
|
124
|
+
*/
|
|
125
|
+
feeVaultDeposited: bigint;
|
|
126
|
+
feeVaultWithdrawn: bigint;
|
|
127
|
+
/**
|
|
128
|
+
* Parallel vault ledger — stake side (bean accord-fdad). Tracks every
|
|
129
|
+
* `staking_token` SPL transfer in/out of the `stake_vault`. Bumped only by
|
|
130
|
+
* `stake` (in) and `withdraw` (out); slashing and `request_withdraw` are
|
|
131
|
+
* ledger-only and never touch these.
|
|
132
|
+
*/
|
|
133
|
+
stakeVaultDeposited: bigint;
|
|
134
|
+
stakeVaultWithdrawn: bigint;
|
|
135
|
+
/**
|
|
136
|
+
* Head of the free-slot linked list (RECLAIM-LEAF). `u32::MAX` = list empty.
|
|
137
|
+
* When non-MAX, points to a JurorStake whose slot has been reclaimed and is
|
|
138
|
+
* available for reuse by a new staker. Maintained by `reclaim_slot` (push)
|
|
139
|
+
* and `stake` (pop).
|
|
140
|
+
*/
|
|
141
|
+
freeHead: number;
|
|
142
|
+
bump: number;
|
|
143
|
+
/**
|
|
144
|
+
* Reserved tail space for future field extensions. Zeroed at `init`;
|
|
145
|
+
* must stay the last field — new fields are carved out of it without
|
|
146
|
+
* moving existing offsets or resizing the account.
|
|
147
|
+
*/
|
|
148
|
+
padding: ReadonlyUint8Array;
|
|
149
|
+
};
|
|
150
|
+
export type SubaccordArgs = {
|
|
151
|
+
creator: Address;
|
|
152
|
+
stakingToken: Address;
|
|
153
|
+
/**
|
|
154
|
+
* Compensation mint — fees + appeal bonds (ADR-0020). Distinct from
|
|
155
|
+
* `staking_token` so collateral and compensation are decoupled.
|
|
156
|
+
*/
|
|
157
|
+
feeToken: Address;
|
|
158
|
+
minStake: number | bigint;
|
|
159
|
+
/**
|
|
160
|
+
* Slash factor in basis points (10% = 1000). Incoherent Juror loses
|
|
161
|
+
* `alpha_bps * min_stake / 10_000` (flat — ADR-0003 consequence).
|
|
162
|
+
*/
|
|
163
|
+
alphaBps: number;
|
|
164
|
+
reviewWindow: number | bigint;
|
|
165
|
+
commitWindow: number | bigint;
|
|
166
|
+
revealWindow: number | bigint;
|
|
167
|
+
/**
|
|
168
|
+
* Appeal window after a round resolves before the dispute goes final
|
|
169
|
+
* (ADR-0022). Per-Subaccord; frozen onto `CaseTerms` at filing.
|
|
170
|
+
*/
|
|
171
|
+
appealWindow: number | bigint;
|
|
172
|
+
maxAppeals: number;
|
|
173
|
+
/**
|
|
174
|
+
* Round-1 (round-0) juror panel size (accord-9q3e, supersedes ADR-0019's
|
|
175
|
+
* fixed constant). Immutable at creation — determines the appeal-ladder
|
|
176
|
+
* geometry `(J+1)·2^k − 1`. Must be odd (tie avoidance) and the ladder top
|
|
177
|
+
* `(J+1)·2^max_appeals − 1` must fit `MAX_JURORS`. Default 3. Frozen onto
|
|
178
|
+
* `CaseTerms` at filing so governance cannot shift panel size mid-dispute.
|
|
179
|
+
* A pool wanting a single juror sets `min_jury_size = 1` + `max_appeals = 0`.
|
|
180
|
+
*/
|
|
181
|
+
minJurySize: number;
|
|
182
|
+
/** Per-Subaccord aggregation rule (ADR-0019). v1 = `Plurality`. */
|
|
183
|
+
aggregation: AggregationArgs;
|
|
184
|
+
feePerJuror: number | bigint;
|
|
185
|
+
/**
|
|
186
|
+
* Reveal-quorum fraction in basis points (ADR-0021). A round is
|
|
187
|
+
* authoritative only if `reveal_count >= ceil(panel × bps / 10_000)`.
|
|
188
|
+
* Default 6666 (= 2/3); the absolute commitment escalates per appeal
|
|
189
|
+
* for free via panel growth.
|
|
190
|
+
*/
|
|
191
|
+
revealThresholdBps: number;
|
|
192
|
+
/** What to do on a shortfall (ADR-0021). v1 = `Redraw`. */
|
|
193
|
+
shortfallPolicy: ShortfallPolicyArgs;
|
|
194
|
+
/**
|
|
195
|
+
* Maximum same-size redraws per round before the dispute fails (ADR-0021).
|
|
196
|
+
* `(round_idx, draw_attempt)` with `draw_attempt` reaching this bound ⇒
|
|
197
|
+
* `Failed`. Orthogonal to `max_appeals` (which bounds `round_idx`).
|
|
198
|
+
*/
|
|
199
|
+
maxDrawAttempts: number;
|
|
200
|
+
/**
|
|
201
|
+
* Coherence tolerance for `Median` pools (ADR-0025), in bps of the final
|
|
202
|
+
* median: a revealed vote is coherent iff
|
|
203
|
+
* `|vote − ruling| · 10_000 ≤ ruling · coherence_tol_bps`. `0` = exact
|
|
204
|
+
* match. Inert for `Plurality` (exact option equality). Frozen onto
|
|
205
|
+
* `CaseTerms` at filing; immutable on the Subaccord (not in
|
|
206
|
+
* `UpdatePayload`) — it defines the pool's coherence game.
|
|
207
|
+
*/
|
|
208
|
+
coherenceTolBps: number;
|
|
209
|
+
/** `Pubkey::default()` => immutable. Otherwise signs propose/execute updates. */
|
|
210
|
+
authority: Address;
|
|
211
|
+
evidenceOperator: Address;
|
|
212
|
+
/** Immutable identity hash: what class of dispute this pool adjudicates. */
|
|
213
|
+
domainRef: ReadonlyUint8Array;
|
|
214
|
+
/** Immutable evidence-format spec hash (ADR-0006). */
|
|
215
|
+
evidenceSpec: ReadonlyUint8Array;
|
|
216
|
+
/**
|
|
217
|
+
* Attestation-gated juror pool (PROG-ATTESTTION). When both are
|
|
218
|
+
* `Pubkey::default()` the Subaccord is stake-only (today's behavior,
|
|
219
|
+
* unchanged). When set, jurors must hold a valid SAS attestation from
|
|
220
|
+
* `juror_credential` under `juror_schema` to stake and be drawn. Immutable
|
|
221
|
+
* at creation — joins `domain_ref` + `evidence_spec` as the identity
|
|
222
|
+
* triplet (ADR-0005). Both-or-neither: a half-bound Subaccord is rejected
|
|
223
|
+
* at `create_subaccord` (`AttestationBindingPartial`).
|
|
224
|
+
*/
|
|
225
|
+
jurorCredential: Address;
|
|
226
|
+
jurorSchema: Address;
|
|
227
|
+
/**
|
|
228
|
+
* Count of **distinct Jurors with any stake** (`JurorStake.staked > 0`).
|
|
229
|
+
* Maintained O(1) by `stake`/`unstake` (0→positive increments,
|
|
230
|
+
* positive→0 decrements). This is a *coarse* intake gate for
|
|
231
|
+
* `create_dispute`/`appeal` (SPEC edge case: revert if fewer active
|
|
232
|
+
* distinct stakers than the required panel). It deliberately does NOT track
|
|
233
|
+
* `min_stake` eligibility — that changes via the 48h timelock and cannot be
|
|
234
|
+
* recomputed without the O(n) ledger ADR-0003 rejected. Precise eligibility
|
|
235
|
+
* (amount ≥ min_stake, distinctness) is verified at `draw` against the
|
|
236
|
+
* finalized Merkle Snapshot.
|
|
237
|
+
*/
|
|
238
|
+
stakerCount: number;
|
|
239
|
+
/**
|
|
240
|
+
* On-chain stake accumulator root (ADR-0012). Maintained incrementally on
|
|
241
|
+
* every `stake`/`unstake` via client-supplied Merkle paths; canonical by
|
|
242
|
+
* construction — there is no posted root to withhold or fabricate.
|
|
243
|
+
*/
|
|
244
|
+
rootHash: ReadonlyUint8Array;
|
|
245
|
+
/** Total stake committed to by the accumulator tree (= root node sum). */
|
|
246
|
+
totalStake: number | bigint;
|
|
247
|
+
/**
|
|
248
|
+
* Next free leaf index in the append-only tree. Incremented once per
|
|
249
|
+
* first-time staker; never reused (full unstake zeros the leaf weight but
|
|
250
|
+
* keeps its `tree_index`).
|
|
251
|
+
*/
|
|
252
|
+
nextIndex: number;
|
|
253
|
+
/** Fixed tree depth (bounds the pool at `2^depth`). Set at `create_subaccord`. */
|
|
254
|
+
depth: number;
|
|
255
|
+
/**
|
|
256
|
+
* Parallel vault ledger — fee side (bean accord-fdad). Tracks every
|
|
257
|
+
* `fee_token` SPL transfer in/out of the `fee_vault`, independent of the
|
|
258
|
+
* vault's live balance. The vault balance is a *derivable consequence*:
|
|
259
|
+
* `fee_vault.amount == fee_vault_deposited - fee_vault_withdrawn`
|
|
260
|
+
* (separate-mint) or the fee portion of a shared ATA (same-mint).
|
|
261
|
+
*/
|
|
262
|
+
feeVaultDeposited: number | bigint;
|
|
263
|
+
feeVaultWithdrawn: number | bigint;
|
|
264
|
+
/**
|
|
265
|
+
* Parallel vault ledger — stake side (bean accord-fdad). Tracks every
|
|
266
|
+
* `staking_token` SPL transfer in/out of the `stake_vault`. Bumped only by
|
|
267
|
+
* `stake` (in) and `withdraw` (out); slashing and `request_withdraw` are
|
|
268
|
+
* ledger-only and never touch these.
|
|
269
|
+
*/
|
|
270
|
+
stakeVaultDeposited: number | bigint;
|
|
271
|
+
stakeVaultWithdrawn: number | bigint;
|
|
272
|
+
/**
|
|
273
|
+
* Head of the free-slot linked list (RECLAIM-LEAF). `u32::MAX` = list empty.
|
|
274
|
+
* When non-MAX, points to a JurorStake whose slot has been reclaimed and is
|
|
275
|
+
* available for reuse by a new staker. Maintained by `reclaim_slot` (push)
|
|
276
|
+
* and `stake` (pop).
|
|
277
|
+
*/
|
|
278
|
+
freeHead: number;
|
|
279
|
+
bump: number;
|
|
280
|
+
/**
|
|
281
|
+
* Reserved tail space for future field extensions. Zeroed at `init`;
|
|
282
|
+
* must stay the last field — new fields are carved out of it without
|
|
283
|
+
* moving existing offsets or resizing the account.
|
|
284
|
+
*/
|
|
285
|
+
padding: ReadonlyUint8Array;
|
|
286
|
+
};
|
|
287
|
+
/** Gets the encoder for {@link SubaccordArgs} account data. */
|
|
288
|
+
export declare function getSubaccordEncoder(): FixedSizeEncoder<SubaccordArgs>;
|
|
289
|
+
/** Gets the decoder for {@link Subaccord} account data. */
|
|
290
|
+
export declare function getSubaccordDecoder(): FixedSizeDecoder<Subaccord>;
|
|
291
|
+
/** Gets the codec for {@link Subaccord} account data. */
|
|
292
|
+
export declare function getSubaccordCodec(): FixedSizeCodec<SubaccordArgs, Subaccord>;
|
|
293
|
+
export declare function decodeSubaccord<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<Subaccord, TAddress>;
|
|
294
|
+
export declare function decodeSubaccord<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<Subaccord, TAddress>;
|
|
295
|
+
export declare function fetchSubaccord<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<Subaccord, TAddress>>;
|
|
296
|
+
export declare function fetchMaybeSubaccord<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<Subaccord, TAddress>>;
|
|
297
|
+
export declare function fetchAllSubaccord(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<Subaccord>[]>;
|
|
298
|
+
export declare function fetchAllMaybeSubaccord(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<Subaccord>[]>;
|
|
299
|
+
export declare function getSubaccordSize(): number;
|
|
300
|
+
//# sourceMappingURL=subaccord.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subaccord.d.ts","sourceRoot":"","sources":["../../../src/generated/accounts/subaccord.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAKL,mBAAmB,EACnB,oBAAoB,EAkBpB,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACxB,MAAM,aAAa,CAAC;AACrB,OAAO,EAKL,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACzB,MAAM,UAAU,CAAC;AAElB,eAAO,MAAM,uBAAuB,EAAE,kBAEpC,CAAC;AAEH,wBAAgB,8BAA8B,IAAI,kBAAkB,CAEnE;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,aAAa,EAAE,kBAAkB,CAAC;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,MA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