@utxopia/sdk 0.1.0-alpha.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/README.md +171 -0
- package/package.json +108 -0
- package/packages/btc-client/src/esplora-client.ts +153 -0
- package/packages/btc-client/src/index.ts +3 -0
- package/packages/btc-client/src/op-return.ts +93 -0
- package/packages/btc-client/src/types.ts +112 -0
- package/packages/sdk/README.md +277 -0
- package/packages/sdk/dist/announcement-client.d.ts +64 -0
- package/packages/sdk/dist/announcement-client.js +337 -0
- package/packages/sdk/dist/auditor-ciphertext.d.ts +72 -0
- package/packages/sdk/dist/auditor-ciphertext.js +135 -0
- package/packages/sdk/dist/auditor.d.ts +115 -0
- package/packages/sdk/dist/auditor.js +292 -0
- package/packages/sdk/dist/bitcoin/ika.d.ts +47 -0
- package/packages/sdk/dist/bitcoin/ika.js +74 -0
- package/packages/sdk/dist/bitcoin/index.d.ts +2 -0
- package/packages/sdk/dist/bitcoin/index.js +1 -0
- package/packages/sdk/dist/bound-params.d.ts +96 -0
- package/packages/sdk/dist/bound-params.js +249 -0
- package/packages/sdk/dist/chadbuffer.d.ts +124 -0
- package/packages/sdk/dist/chadbuffer.js +405 -0
- package/packages/sdk/dist/claim-link.d.ts +30 -0
- package/packages/sdk/dist/claim-link.js +50 -0
- package/packages/sdk/dist/client.d.ts +233 -0
- package/packages/sdk/dist/client.js +416 -0
- package/packages/sdk/dist/commitment-tree.d.ts +268 -0
- package/packages/sdk/dist/commitment-tree.js +564 -0
- package/packages/sdk/dist/config.d.ts +177 -0
- package/packages/sdk/dist/config.js +426 -0
- package/packages/sdk/dist/core/esplora.d.ts +110 -0
- package/packages/sdk/dist/core/esplora.js +187 -0
- package/packages/sdk/dist/core/mempool.d.ts +60 -0
- package/packages/sdk/dist/core/mempool.js +107 -0
- package/packages/sdk/dist/crypto-babyjub.d.ts +105 -0
- package/packages/sdk/dist/crypto-babyjub.js +312 -0
- package/packages/sdk/dist/crypto-ed25519.d.ts +116 -0
- package/packages/sdk/dist/crypto-ed25519.js +235 -0
- package/packages/sdk/dist/crypto.d.ts +59 -0
- package/packages/sdk/dist/crypto.js +140 -0
- package/packages/sdk/dist/event-client.d.ts +64 -0
- package/packages/sdk/dist/event-client.js +165 -0
- package/packages/sdk/dist/events.d.ts +127 -0
- package/packages/sdk/dist/events.js +305 -0
- package/packages/sdk/dist/explorer.d.ts +86 -0
- package/packages/sdk/dist/explorer.js +197 -0
- package/packages/sdk/dist/index.d.ts +61 -0
- package/packages/sdk/dist/index.js +216 -0
- package/packages/sdk/dist/instructions.d.ts +1125 -0
- package/packages/sdk/dist/instructions.js +1760 -0
- package/packages/sdk/dist/keys.d.ts +467 -0
- package/packages/sdk/dist/keys.js +799 -0
- package/packages/sdk/dist/logger.d.ts +10 -0
- package/packages/sdk/dist/logger.js +40 -0
- package/packages/sdk/dist/magicblock.d.ts +90 -0
- package/packages/sdk/dist/magicblock.js +164 -0
- package/packages/sdk/dist/merkle.d.ts +82 -0
- package/packages/sdk/dist/merkle.js +141 -0
- package/packages/sdk/dist/note.d.ts +348 -0
- package/packages/sdk/dist/note.js +483 -0
- package/packages/sdk/dist/pda.d.ts +160 -0
- package/packages/sdk/dist/pda.js +384 -0
- package/packages/sdk/dist/pool-state.d.ts +100 -0
- package/packages/sdk/dist/pool-state.js +126 -0
- package/packages/sdk/dist/poseidon.d.ts +53 -0
- package/packages/sdk/dist/poseidon.js +136 -0
- package/packages/sdk/dist/prover/index.d.ts +10 -0
- package/packages/sdk/dist/prover/index.js +10 -0
- package/packages/sdk/dist/prover/mobile.d.ts +45 -0
- package/packages/sdk/dist/prover/mobile.js +227 -0
- package/packages/sdk/dist/prover/web.d.ts +136 -0
- package/packages/sdk/dist/prover/web.js +597 -0
- package/packages/sdk/dist/psbt.d.ts +73 -0
- package/packages/sdk/dist/psbt.js +202 -0
- package/packages/sdk/dist/selective-disclosure.d.ts +181 -0
- package/packages/sdk/dist/selective-disclosure.js +172 -0
- package/packages/sdk/dist/sender-memo.d.ts +149 -0
- package/packages/sdk/dist/sender-memo.js +250 -0
- package/packages/sdk/dist/sns-resolver.d.ts +121 -0
- package/packages/sdk/dist/sns-resolver.js +229 -0
- package/packages/sdk/dist/solana/connection.d.ts +77 -0
- package/packages/sdk/dist/solana/connection.js +133 -0
- package/packages/sdk/dist/solana/priority-fee.d.ts +78 -0
- package/packages/sdk/dist/solana/priority-fee.js +137 -0
- package/packages/sdk/dist/stealth.d.ts +429 -0
- package/packages/sdk/dist/stealth.js +703 -0
- package/packages/sdk/dist/taproot.d.ts +172 -0
- package/packages/sdk/dist/taproot.js +494 -0
- package/packages/sdk/dist/token-registry.d.ts +96 -0
- package/packages/sdk/dist/token-registry.js +122 -0
- package/packages/sdk/dist/utils/encoding.d.ts +19 -0
- package/packages/sdk/dist/utils/encoding.js +29 -0
- package/packages/sdk/dist/vk-registry.d.ts +100 -0
- package/packages/sdk/dist/vk-registry.js +212 -0
|
@@ -0,0 +1,1125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UTXOPIA Instruction Builders (JoinSplit Architecture)
|
|
3
|
+
*
|
|
4
|
+
* Low-level instruction building for UTXOPIA operations.
|
|
5
|
+
* All Groth16 proofs are verified inline using BN254 pairing syscalls.
|
|
6
|
+
*
|
|
7
|
+
* @module instructions
|
|
8
|
+
*/
|
|
9
|
+
import { AccountRole, type Address } from "@solana/kit";
|
|
10
|
+
import { type AuditorCiphertextInput } from "./auditor-ciphertext";
|
|
11
|
+
/** Instruction type for v2 */
|
|
12
|
+
export interface Instruction {
|
|
13
|
+
programAddress: Address;
|
|
14
|
+
accounts: Array<{
|
|
15
|
+
address: Address;
|
|
16
|
+
role: (typeof AccountRole)[keyof typeof AccountRole];
|
|
17
|
+
}>;
|
|
18
|
+
data: Uint8Array;
|
|
19
|
+
}
|
|
20
|
+
/** Export instruction discriminators for consumers */
|
|
21
|
+
export declare const INSTRUCTION_DISCRIMINATORS: {
|
|
22
|
+
readonly INITIALIZE: 0;
|
|
23
|
+
readonly SET_PAUSED: 1;
|
|
24
|
+
readonly SET_POOL_CONFIG: 2;
|
|
25
|
+
readonly PROPOSE_POOL_UPDATE: 3;
|
|
26
|
+
readonly EXECUTE_POOL_UPDATE: 4;
|
|
27
|
+
readonly CANCEL_POOL_UPDATE: 5;
|
|
28
|
+
readonly INIT_VK_REGISTRY: 6;
|
|
29
|
+
readonly UPDATE_VK_REGISTRY: 7;
|
|
30
|
+
readonly REGISTER_TOKEN: 8;
|
|
31
|
+
readonly UPDATE_TOKEN_CONFIG: 9;
|
|
32
|
+
readonly CLAIM_FEES: 10;
|
|
33
|
+
readonly COMPLETE_DEPOSIT: 11;
|
|
34
|
+
readonly SHIELD: 12;
|
|
35
|
+
readonly TRANSACT: 13;
|
|
36
|
+
readonly UNSHIELD: 14;
|
|
37
|
+
readonly REDEEM: 15;
|
|
38
|
+
readonly RESERVED_REQUEST_REDEMPTION: 16;
|
|
39
|
+
readonly COMPLETE_REDEMPTION: 17;
|
|
40
|
+
readonly MARK_PROCESSING: 18;
|
|
41
|
+
readonly CANCEL_REDEMPTION: 19;
|
|
42
|
+
readonly ROTATE_TREE: 20;
|
|
43
|
+
readonly APPROVE_REDEMPTION_SIGNING: 27;
|
|
44
|
+
readonly SET_AUDITOR_FROZEN: 28;
|
|
45
|
+
readonly SET_AUDITOR_VIEWING_PUBKEY: 29;
|
|
46
|
+
readonly MAGICBLOCK_DELEGATE: 32;
|
|
47
|
+
readonly MAGICBLOCK_COMMIT: 33;
|
|
48
|
+
readonly MAGICBLOCK_PER_PERMISSION: 34;
|
|
49
|
+
readonly ROTATE_AUDITOR: 35;
|
|
50
|
+
readonly INITIALIZE_POLICY_APPROVAL: 36;
|
|
51
|
+
readonly POLICY_APPROVAL_DECISION: 37;
|
|
52
|
+
readonly POLICY_APPROVAL_COMMIT: 38;
|
|
53
|
+
};
|
|
54
|
+
/** Shield instruction options */
|
|
55
|
+
export interface ShieldInstructionOptions {
|
|
56
|
+
/** Amount to shield (in token's smallest unit — lamports, micro-USDC, sats) */
|
|
57
|
+
amount: bigint;
|
|
58
|
+
/** NPK bytes (32) — recipient's note public key */
|
|
59
|
+
npk: Uint8Array;
|
|
60
|
+
/** Ephemeral public key (32) — for stealth address derivation */
|
|
61
|
+
ephemeralPub: Uint8Array;
|
|
62
|
+
/** Accounts required for the shield instruction */
|
|
63
|
+
accounts: {
|
|
64
|
+
user: Address;
|
|
65
|
+
userTokenAccount: Address;
|
|
66
|
+
poolState: Address;
|
|
67
|
+
tokenConfig: Address;
|
|
68
|
+
vault: Address;
|
|
69
|
+
commitmentTree: Address;
|
|
70
|
+
tokenProgram: Address;
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Build shield instruction data (disc=12).
|
|
75
|
+
*
|
|
76
|
+
* Layout (after disc stripped by entrypoint):
|
|
77
|
+
* - amount: u64 LE (8 bytes)
|
|
78
|
+
* - npk: [u8; 32]
|
|
79
|
+
* - ephemeral_pub: [u8; 32]
|
|
80
|
+
*/
|
|
81
|
+
export declare function buildShieldInstructionData(options: {
|
|
82
|
+
amount: bigint;
|
|
83
|
+
npk: Uint8Array;
|
|
84
|
+
ephemeralPub: Uint8Array;
|
|
85
|
+
}): Uint8Array;
|
|
86
|
+
/**
|
|
87
|
+
* Build a complete shield instruction (disc=12).
|
|
88
|
+
*
|
|
89
|
+
* Shields SPL tokens into the privacy pool. Works with both
|
|
90
|
+
* legacy Token program (wSOL) and Token-2022 (USDC, USDT, etc.).
|
|
91
|
+
*/
|
|
92
|
+
export declare function buildShieldInstruction(options: ShieldInstructionOptions): Instruction;
|
|
93
|
+
/** Complete redemption instruction options */
|
|
94
|
+
export interface CompleteRedemptionInstructionOptions {
|
|
95
|
+
/** BTC transaction ID (internal byte order, 32 bytes) */
|
|
96
|
+
btcTxid: Uint8Array;
|
|
97
|
+
/** Raw tx size in ChadBuffer */
|
|
98
|
+
txSize: number;
|
|
99
|
+
/** Pool scriptPubKey for change UTXO tracking (empty = no tracking) */
|
|
100
|
+
poolScript: Uint8Array;
|
|
101
|
+
/** Number of consumed UTXO PDAs in remaining accounts */
|
|
102
|
+
consumedUtxoCount: number;
|
|
103
|
+
/** Account addresses */
|
|
104
|
+
accounts: {
|
|
105
|
+
poolState: Address;
|
|
106
|
+
redemptionRequest: Address;
|
|
107
|
+
authority: Address;
|
|
108
|
+
rentRecipient: Address;
|
|
109
|
+
verifiedTransaction: Address;
|
|
110
|
+
lightClient: Address;
|
|
111
|
+
txBuffer: Address;
|
|
112
|
+
zkbtcMint: Address;
|
|
113
|
+
poolVault: Address;
|
|
114
|
+
completionReceipt: Address;
|
|
115
|
+
poolConfig: Address;
|
|
116
|
+
/** Change UTXO PDA. Required when poolScript is non-empty. */
|
|
117
|
+
changeUtxo?: Address;
|
|
118
|
+
/** zkBTC TokenConfig PDA (credits protocol revenue) */
|
|
119
|
+
tokenConfig: Address;
|
|
120
|
+
/** Token program for zkBTC mint (TOKEN_2022_PROGRAM_ID or TOKEN_PROGRAM_ID). Defaults to Token-2022. */
|
|
121
|
+
tokenProgram?: Address;
|
|
122
|
+
/** Consumed UTXO PDAs to close */
|
|
123
|
+
consumedUtxos?: Address[];
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
export interface ApproveRedemptionSigningInstructionOptions {
|
|
127
|
+
/** BIP-341 taproot key-spend sighash for the unsigned BTC transaction. */
|
|
128
|
+
btcSighash: Uint8Array;
|
|
129
|
+
/** Optional keccak256(Sign.message), where Sign.message is the TapSighash preimage. */
|
|
130
|
+
ikaMessageDigest?: Uint8Array;
|
|
131
|
+
/** Miner fee in satoshis, checked by the on-chain signing policy. */
|
|
132
|
+
minerFeeSats: bigint | number;
|
|
133
|
+
accounts: {
|
|
134
|
+
poolState: Address;
|
|
135
|
+
redemptionRequest: Address;
|
|
136
|
+
authority: Address;
|
|
137
|
+
poolConfig: Address;
|
|
138
|
+
ikaProgram: Address;
|
|
139
|
+
ikaCoordinator: Address;
|
|
140
|
+
ikaMessageApproval: Address;
|
|
141
|
+
ikaDwallet: Address;
|
|
142
|
+
callerProgram: Address;
|
|
143
|
+
cpiAuthority: Address;
|
|
144
|
+
ikaPayer: Address;
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
export declare function buildApproveRedemptionSigningInstructionData(options: {
|
|
148
|
+
btcSighash: Uint8Array;
|
|
149
|
+
ikaMessageDigest?: Uint8Array;
|
|
150
|
+
minerFeeSats: bigint | number;
|
|
151
|
+
}): Uint8Array;
|
|
152
|
+
export declare function buildApproveRedemptionSigningInstruction(options: ApproveRedemptionSigningInstructionOptions): Instruction;
|
|
153
|
+
/**
|
|
154
|
+
* Build instruction data for COMPLETE_REDEMPTION (disc 17)
|
|
155
|
+
*
|
|
156
|
+
* Layout (after disc stripped):
|
|
157
|
+
* - btc_txid: [u8; 32]
|
|
158
|
+
* - tx_size: u32 LE
|
|
159
|
+
* - pool_script_len: u8
|
|
160
|
+
* - pool_script: [u8; 0-34]
|
|
161
|
+
* - consumed_utxo_count: u8
|
|
162
|
+
*/
|
|
163
|
+
export declare function buildCompleteRedemptionInstructionData(options: {
|
|
164
|
+
btcTxid: Uint8Array;
|
|
165
|
+
txSize: number;
|
|
166
|
+
poolScript: Uint8Array;
|
|
167
|
+
consumedUtxoCount: number;
|
|
168
|
+
}): Uint8Array;
|
|
169
|
+
/**
|
|
170
|
+
* Build a complete redemption instruction
|
|
171
|
+
*
|
|
172
|
+
* Accounts (14 base + optional change + variable consumed UTXOs):
|
|
173
|
+
* 0. pool_state (writable)
|
|
174
|
+
* 1. redemption_request (writable)
|
|
175
|
+
* 2. authority (signer)
|
|
176
|
+
* 3. rent_recipient (readonly)
|
|
177
|
+
* 4. verified_transaction (readonly)
|
|
178
|
+
* 5. light_client (readonly)
|
|
179
|
+
* 6. tx_buffer (readonly)
|
|
180
|
+
* 7. zkbtc_mint (writable)
|
|
181
|
+
* 8. pool_vault (writable)
|
|
182
|
+
* 9. token_program (readonly)
|
|
183
|
+
* 10. completion_receipt (writable)
|
|
184
|
+
* 11. system_program (readonly)
|
|
185
|
+
* 12. pool_config (readonly)
|
|
186
|
+
* 13. change_utxo (writable, only when pool_script is non-empty)
|
|
187
|
+
* 13/14..+N consumed_utxos (writable)
|
|
188
|
+
* final. token_config (writable)
|
|
189
|
+
*/
|
|
190
|
+
export declare function buildCompleteRedemptionInstruction(options: CompleteRedemptionInstructionOptions): Instruction;
|
|
191
|
+
/** Cancel redemption instruction options */
|
|
192
|
+
export interface CancelRedemptionInstructionOptions {
|
|
193
|
+
/** Note public key for the re-minted commitment (32 bytes) */
|
|
194
|
+
npk: Uint8Array;
|
|
195
|
+
accounts: {
|
|
196
|
+
/** Original requester (signer; receives the closed request's rent) */
|
|
197
|
+
user: Address;
|
|
198
|
+
poolState: Address;
|
|
199
|
+
redemptionRequest: Address;
|
|
200
|
+
commitmentTree: Address;
|
|
201
|
+
tokenConfig: Address;
|
|
202
|
+
/**
|
|
203
|
+
* Reserved UtxoRecord PDAs to release. Required when the request was in
|
|
204
|
+
* Processing (mark_processing reserved these UTXOs); pass [] / omit for a
|
|
205
|
+
* Pending cancel, which never reserved any. The program rejects a mismatch.
|
|
206
|
+
*/
|
|
207
|
+
reservedUtxos?: Address[];
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Build cancel redemption instruction data.
|
|
212
|
+
*
|
|
213
|
+
* Layout (after disc stripped by entrypoint):
|
|
214
|
+
* - npk: [u8; 32]
|
|
215
|
+
* - utxo_count: u8 (number of reserved UtxoRecord accounts that follow; 0 for Pending)
|
|
216
|
+
*/
|
|
217
|
+
export declare function buildCancelRedemptionInstructionData(options: {
|
|
218
|
+
npk: Uint8Array;
|
|
219
|
+
reservedUtxoCount: number;
|
|
220
|
+
}): Uint8Array;
|
|
221
|
+
/**
|
|
222
|
+
* Build a cancel redemption instruction.
|
|
223
|
+
*
|
|
224
|
+
* Accounts (6 base + variable):
|
|
225
|
+
* 0. user (writable signer)
|
|
226
|
+
* 1. pool_state (writable)
|
|
227
|
+
* 2. redemption_request (writable)
|
|
228
|
+
* 3. commitment_tree (writable)
|
|
229
|
+
* 4. system_program (readonly)
|
|
230
|
+
* 5. token_config (writable)
|
|
231
|
+
* 6..6+N reserved UtxoRecord PDAs (writable) — Processing cancels only
|
|
232
|
+
*/
|
|
233
|
+
export declare function buildCancelRedemptionInstruction(options: CancelRedemptionInstructionOptions): Instruction;
|
|
234
|
+
/** JoinSplit transact instruction options */
|
|
235
|
+
export interface TransactInstructionOptions {
|
|
236
|
+
/** Number of input notes being spent */
|
|
237
|
+
nInputs: number;
|
|
238
|
+
/** Number of output notes being created */
|
|
239
|
+
nOutputs: number;
|
|
240
|
+
/** Groth16 proof bytes (256 bytes) */
|
|
241
|
+
proofBytes: Uint8Array;
|
|
242
|
+
/** Merkle root */
|
|
243
|
+
merkleRoot: Uint8Array;
|
|
244
|
+
/** Bound parameters hash */
|
|
245
|
+
boundParamsHash: Uint8Array;
|
|
246
|
+
/** Nullifiers (32 bytes each) */
|
|
247
|
+
nullifiers: Uint8Array[];
|
|
248
|
+
/** Output commitments (32 bytes each) */
|
|
249
|
+
commitmentsOut: Uint8Array[];
|
|
250
|
+
/** Per-output stealth data: ephemeral_pub (32) + encrypted_amount (8) */
|
|
251
|
+
stealthData: Uint8Array[];
|
|
252
|
+
/** Reserved. Sender memos are rejected until they are proof-bound. */
|
|
253
|
+
senderMemos?: Uint8Array[];
|
|
254
|
+
/** Account addresses */
|
|
255
|
+
accounts: {
|
|
256
|
+
poolState: Address;
|
|
257
|
+
commitmentTree: Address;
|
|
258
|
+
vkRegistry: Address;
|
|
259
|
+
user: Address;
|
|
260
|
+
/** Nullifier record PDAs (one per input) */
|
|
261
|
+
nullifierRecords: Address[];
|
|
262
|
+
/** Required when poolState is permissioned. Appended before any proof buffer. */
|
|
263
|
+
policyApproval?: Address;
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Build transact instruction data (JoinSplit)
|
|
268
|
+
*
|
|
269
|
+
* Layout (after disc stripped by entrypoint):
|
|
270
|
+
* - n_inputs: u8
|
|
271
|
+
* - n_outputs: u8
|
|
272
|
+
* - n_public_outputs: u8 (always 0 for transact)
|
|
273
|
+
* - proof_source: u8 (0=inline, 1=buffer account)
|
|
274
|
+
* - proof: [u8; 256] (only if proof_source=0)
|
|
275
|
+
* - merkle_root: [u8; 32]
|
|
276
|
+
* - bound_params_hash: [u8; 32]
|
|
277
|
+
* - nullifiers: [[u8; 32]; n_inputs]
|
|
278
|
+
* - commitments_out: [[u8; 32]; n_outputs]
|
|
279
|
+
* - stealth_data: [ephemeral_pub(32) + encrypted_amount(8) + encrypted_token_id(32)] x n_outputs
|
|
280
|
+
*/
|
|
281
|
+
export declare function buildTransactInstructionData(options: {
|
|
282
|
+
nInputs: number;
|
|
283
|
+
nOutputs: number;
|
|
284
|
+
/** Groth16 proof (256 bytes). Omit when using buffer mode. */
|
|
285
|
+
proofBytes?: Uint8Array;
|
|
286
|
+
merkleRoot: Uint8Array;
|
|
287
|
+
boundParamsHash: Uint8Array;
|
|
288
|
+
nullifiers: Uint8Array[];
|
|
289
|
+
commitmentsOut: Uint8Array[];
|
|
290
|
+
stealthData: Uint8Array[];
|
|
291
|
+
/** 0=inline proof (default), 1=proof in separate ChadBuffer account */
|
|
292
|
+
proofSource?: 0 | 1;
|
|
293
|
+
/** Reserved. Sender memos are rejected until they are proof-bound. */
|
|
294
|
+
senderMemos?: Uint8Array[];
|
|
295
|
+
}): Uint8Array;
|
|
296
|
+
/**
|
|
297
|
+
* Build a complete JoinSplit transact instruction
|
|
298
|
+
*
|
|
299
|
+
* Accounts:
|
|
300
|
+
* 0. pool_state (writable)
|
|
301
|
+
* 1. commitment_tree (writable)
|
|
302
|
+
* 2. vk_registry (read)
|
|
303
|
+
* 3. user (signer)
|
|
304
|
+
* 4. system_program (read)
|
|
305
|
+
* 5..5+N nullifier_records (writable)
|
|
306
|
+
*/
|
|
307
|
+
export declare function buildTransactInstruction(options: TransactInstructionOptions): Instruction;
|
|
308
|
+
/**
|
|
309
|
+
* Build instruction data for REDEEM (disc=15) — atomic JoinSplit + BTC withdrawal (multi-output)
|
|
310
|
+
*
|
|
311
|
+
* Combines Groth16 proof verification with RedemptionRequest PDA creation.
|
|
312
|
+
* Supports 1..3 public outputs, each creating a separate RedemptionRequest.
|
|
313
|
+
*
|
|
314
|
+
* Layout (4-byte common header):
|
|
315
|
+
* - n_inputs: u8
|
|
316
|
+
* - n_outputs: u8
|
|
317
|
+
* - n_public_outputs: u8 (1..3)
|
|
318
|
+
* - proof_source: u8 (0=inline, 1=buffer account)
|
|
319
|
+
* - proof: [u8; 256] (only if proof_source=0)
|
|
320
|
+
* - merkle_root: [u8; 32]
|
|
321
|
+
* - bound_params_hash: [u8; 32]
|
|
322
|
+
* - nullifiers: [[u8; 32]; n_inputs]
|
|
323
|
+
* - commitments_out: [[u8; 32]; n_outputs]
|
|
324
|
+
* - stealth_data: [ephemeral_pub(32) + encrypted_amount(8) + encrypted_token_id(32)] x n_tree_outputs
|
|
325
|
+
* - For each public output: amount(8) + script_len(1) + script(var) + nonce(8)
|
|
326
|
+
*/
|
|
327
|
+
export declare function buildRedeemInstructionData(options: {
|
|
328
|
+
nInputs: number;
|
|
329
|
+
nOutputs: number;
|
|
330
|
+
/** Number of public (redeem) outputs. Defaults to redeemAmounts.length. */
|
|
331
|
+
nPublicOutputs?: number;
|
|
332
|
+
/** Groth16 proof (256 bytes). Omit when using buffer mode. */
|
|
333
|
+
proofBytes?: Uint8Array;
|
|
334
|
+
merkleRoot: Uint8Array;
|
|
335
|
+
boundParamsHash: Uint8Array;
|
|
336
|
+
nullifiers: Uint8Array[];
|
|
337
|
+
commitmentsOut: Uint8Array[];
|
|
338
|
+
/** Stealth data for tree outputs only (n_tree_outputs entries, 72 bytes each) */
|
|
339
|
+
stealthData: Uint8Array[];
|
|
340
|
+
/** Amount(s) to redeem in satoshis — single or array */
|
|
341
|
+
redeemAmounts: bigint[];
|
|
342
|
+
/** Bitcoin scriptPubKey(s) (raw bytes, max 62 each) — single or array */
|
|
343
|
+
btcScripts: Uint8Array[];
|
|
344
|
+
/** Unique request nonce(s) — single or array */
|
|
345
|
+
requestNonces: bigint[];
|
|
346
|
+
/** 0=inline proof (default), 1=proof in separate ChadBuffer account */
|
|
347
|
+
proofSource?: 0 | 1;
|
|
348
|
+
}): Uint8Array;
|
|
349
|
+
/** Unshield instruction options (multi-output) */
|
|
350
|
+
export interface UnshieldInstructionOptions {
|
|
351
|
+
/** Number of input notes being spent */
|
|
352
|
+
nInputs: number;
|
|
353
|
+
/** Number of output notes (includes burn outputs at end) */
|
|
354
|
+
nOutputs: number;
|
|
355
|
+
/** Number of public (unshield) outputs. Defaults to 1. */
|
|
356
|
+
nPublicOutputs?: number;
|
|
357
|
+
/** Groth16 proof bytes (256 bytes) */
|
|
358
|
+
proofBytes: Uint8Array;
|
|
359
|
+
/** Merkle root */
|
|
360
|
+
merkleRoot: Uint8Array;
|
|
361
|
+
/** Bound parameters hash */
|
|
362
|
+
boundParamsHash: Uint8Array;
|
|
363
|
+
/** Nullifiers (32 bytes each) */
|
|
364
|
+
nullifiers: Uint8Array[];
|
|
365
|
+
/** Output commitments (32 bytes each, last nPublicOutputs = burn commitments) */
|
|
366
|
+
commitmentsOut: Uint8Array[];
|
|
367
|
+
/** Per-output stealth data for tree outputs only */
|
|
368
|
+
stealthData: Uint8Array[];
|
|
369
|
+
/** Amount(s) being unshielded */
|
|
370
|
+
unshieldAmounts: bigint[];
|
|
371
|
+
/** Account addresses */
|
|
372
|
+
accounts: {
|
|
373
|
+
poolState: Address;
|
|
374
|
+
commitmentTree: Address;
|
|
375
|
+
vkRegistry: Address;
|
|
376
|
+
user: Address;
|
|
377
|
+
tokenConfig: Address;
|
|
378
|
+
vault: Address;
|
|
379
|
+
/** Token program for the mint (TOKEN_2022_PROGRAM_ID or TOKEN_PROGRAM_ID). Defaults to Token-2022. */
|
|
380
|
+
tokenProgram?: Address;
|
|
381
|
+
/** Public destination accounts (SPL token accounts, or direct recipients for native SOL) */
|
|
382
|
+
recipientTokenAccounts: Address[];
|
|
383
|
+
/** Nullifier record PDAs (one per input) */
|
|
384
|
+
nullifierRecords: Address[];
|
|
385
|
+
/** Required when poolState is permissioned. Appended before any proof buffer. */
|
|
386
|
+
policyApproval?: Address;
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* Build unshield instruction data (multi-output, disc=14).
|
|
391
|
+
*
|
|
392
|
+
* Layout (4-byte common header):
|
|
393
|
+
* - disc(1) + n_inputs(1) + n_outputs(1) + n_public_outputs(1) + proof_source(1)
|
|
394
|
+
* - proof(256) if inline
|
|
395
|
+
* - merkle_root(32) + bound_params_hash(32)
|
|
396
|
+
* - nullifiers(N*32) + commitments_out(M*32)
|
|
397
|
+
* - stealth_data(n_tree_outputs * 72)
|
|
398
|
+
* - amounts[P] (each u64 LE)
|
|
399
|
+
*
|
|
400
|
+
* Recipients come from the accounts array. Ordinary SPL outputs use token
|
|
401
|
+
* accounts; native-SOL outputs use the recipient accounts directly.
|
|
402
|
+
*/
|
|
403
|
+
export declare function buildUnshieldInstructionData(options: {
|
|
404
|
+
nInputs: number;
|
|
405
|
+
nOutputs: number;
|
|
406
|
+
/** Number of public (unshield) outputs. Defaults to 1. */
|
|
407
|
+
nPublicOutputs?: number;
|
|
408
|
+
/** Groth16 proof (256 bytes). Omit when using buffer mode. */
|
|
409
|
+
proofBytes?: Uint8Array;
|
|
410
|
+
merkleRoot: Uint8Array;
|
|
411
|
+
boundParamsHash: Uint8Array;
|
|
412
|
+
nullifiers: Uint8Array[];
|
|
413
|
+
commitmentsOut: Uint8Array[];
|
|
414
|
+
stealthData: Uint8Array[];
|
|
415
|
+
/** Amount(s) being unshielded — single or array */
|
|
416
|
+
unshieldAmounts: bigint[];
|
|
417
|
+
/** 0=inline proof (default), 1=proof in separate ChadBuffer account */
|
|
418
|
+
proofSource?: 0 | 1;
|
|
419
|
+
}): Uint8Array;
|
|
420
|
+
/**
|
|
421
|
+
* Build a complete unshield instruction (multi-output, disc=14)
|
|
422
|
+
*
|
|
423
|
+
* Accounts:
|
|
424
|
+
* 0. pool_state (read)
|
|
425
|
+
* 1. commitment_tree (writable)
|
|
426
|
+
* 2. vk_registry (read)
|
|
427
|
+
* 3. user (signer)
|
|
428
|
+
* 4. system_program (read)
|
|
429
|
+
* 5. token_config (writable)
|
|
430
|
+
* 6. vault (writable)
|
|
431
|
+
* 7. token_program (read)
|
|
432
|
+
* 8..8+P public destinations (SPL token accounts or native-SOL recipients)
|
|
433
|
+
* 8+P..8+P+N nullifier_records (writable)
|
|
434
|
+
*/
|
|
435
|
+
export declare function buildUnshieldInstruction(options: UnshieldInstructionOptions): Instruction;
|
|
436
|
+
/** Propose pool update instruction options */
|
|
437
|
+
export interface ProposePoolUpdateOptions {
|
|
438
|
+
/** New minimum deposit in satoshis */
|
|
439
|
+
minDeposit: bigint;
|
|
440
|
+
/** New maximum deposit in satoshis */
|
|
441
|
+
maxDeposit: bigint;
|
|
442
|
+
/** New service fee base in satoshis */
|
|
443
|
+
serviceFee: bigint;
|
|
444
|
+
/** Service fee in basis points (e.g. 30 = 0.3%). Applied immediately, no timelock. */
|
|
445
|
+
serviceFeeBps?: number;
|
|
446
|
+
/** Account addresses */
|
|
447
|
+
accounts: {
|
|
448
|
+
poolState: Address;
|
|
449
|
+
authority: Address;
|
|
450
|
+
};
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* Build propose_pool_update instruction data
|
|
454
|
+
*
|
|
455
|
+
* Layout: discriminator(1) + min_deposit(8) + max_deposit(8) + service_fee(8) + [service_fee_bps(2)] = 25 or 27 bytes
|
|
456
|
+
*/
|
|
457
|
+
export declare function buildProposePoolUpdateInstructionData(minDeposit: bigint, maxDeposit: bigint, serviceFee: bigint, serviceFeeBps?: number): Uint8Array;
|
|
458
|
+
/**
|
|
459
|
+
* Build a complete propose_pool_update instruction
|
|
460
|
+
*
|
|
461
|
+
* Accounts:
|
|
462
|
+
* 0. pool_state (writable)
|
|
463
|
+
* 1. authority (signer)
|
|
464
|
+
*/
|
|
465
|
+
export declare function buildProposePoolUpdateInstruction(options: ProposePoolUpdateOptions): Instruction;
|
|
466
|
+
/** Execute pool update instruction options */
|
|
467
|
+
export interface ExecutePoolUpdateOptions {
|
|
468
|
+
accounts: {
|
|
469
|
+
poolState: Address;
|
|
470
|
+
/** Pool authority — must sign (execute is authority-only; audit f11). */
|
|
471
|
+
authority: Address;
|
|
472
|
+
};
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* Build execute_pool_update instruction data
|
|
476
|
+
*
|
|
477
|
+
* Layout: discriminator(1) = 1 byte
|
|
478
|
+
*/
|
|
479
|
+
export declare function buildExecutePoolUpdateInstructionData(): Uint8Array;
|
|
480
|
+
/**
|
|
481
|
+
* Build a complete execute_pool_update instruction (authority-only)
|
|
482
|
+
*
|
|
483
|
+
* Accounts:
|
|
484
|
+
* 0. pool_state (writable)
|
|
485
|
+
* 1. authority (signer)
|
|
486
|
+
*/
|
|
487
|
+
export declare function buildExecutePoolUpdateInstruction(options: ExecutePoolUpdateOptions): Instruction;
|
|
488
|
+
/** Cancel pool update instruction options */
|
|
489
|
+
export interface CancelPoolUpdateOptions {
|
|
490
|
+
accounts: {
|
|
491
|
+
poolState: Address;
|
|
492
|
+
authority: Address;
|
|
493
|
+
};
|
|
494
|
+
}
|
|
495
|
+
/**
|
|
496
|
+
* Build cancel_pool_update instruction data
|
|
497
|
+
*
|
|
498
|
+
* Layout: discriminator(1) = 1 byte
|
|
499
|
+
*/
|
|
500
|
+
export declare function buildCancelPoolUpdateInstructionData(): Uint8Array;
|
|
501
|
+
/**
|
|
502
|
+
* Build a complete cancel_pool_update instruction
|
|
503
|
+
*
|
|
504
|
+
* Accounts:
|
|
505
|
+
* 0. pool_state (writable)
|
|
506
|
+
* 1. authority (signer)
|
|
507
|
+
*/
|
|
508
|
+
export declare function buildCancelPoolUpdateInstruction(options: CancelPoolUpdateOptions): Instruction;
|
|
509
|
+
/** Rotate tree instruction options */
|
|
510
|
+
export interface RotateTreeOptions {
|
|
511
|
+
accounts: {
|
|
512
|
+
poolState: Address;
|
|
513
|
+
currentTree: Address;
|
|
514
|
+
newTree: Address;
|
|
515
|
+
authority: Address;
|
|
516
|
+
systemProgram: Address;
|
|
517
|
+
};
|
|
518
|
+
}
|
|
519
|
+
/**
|
|
520
|
+
* Build rotate_tree instruction data (disc=20, no payload)
|
|
521
|
+
*/
|
|
522
|
+
export declare function buildRotateTreeInstructionData(): Uint8Array;
|
|
523
|
+
/**
|
|
524
|
+
* Build a complete rotate_tree instruction
|
|
525
|
+
*
|
|
526
|
+
* Accounts:
|
|
527
|
+
* 0. pool_state (writable)
|
|
528
|
+
* 1. current_tree (writable) — must be full
|
|
529
|
+
* 2. new_tree (writable) — to be created
|
|
530
|
+
* 3. authority (signer)
|
|
531
|
+
* 4. system_program
|
|
532
|
+
*/
|
|
533
|
+
export declare function buildRotateTreeInstruction(options: RotateTreeOptions): Instruction;
|
|
534
|
+
/** Only policy decisions are delegated; asset-bearing pool/tree state stays on Solana. */
|
|
535
|
+
export type MagicBlockDelegateTarget = "policyApproval";
|
|
536
|
+
export interface MagicBlockDelegateInstructionOptions {
|
|
537
|
+
accounts: {
|
|
538
|
+
payer: Address;
|
|
539
|
+
authority: Address;
|
|
540
|
+
poolState: Address;
|
|
541
|
+
delegatedAccount: Address;
|
|
542
|
+
ownerProgram?: Address;
|
|
543
|
+
buffer: Address;
|
|
544
|
+
delegationRecord: Address;
|
|
545
|
+
delegationMetadata: Address;
|
|
546
|
+
systemProgram?: Address;
|
|
547
|
+
};
|
|
548
|
+
target: MagicBlockDelegateTarget;
|
|
549
|
+
commitFrequencyMs: number;
|
|
550
|
+
validator?: Address;
|
|
551
|
+
}
|
|
552
|
+
export interface MagicBlockCommitInstructionOptions {
|
|
553
|
+
accounts: {
|
|
554
|
+
payer: Address;
|
|
555
|
+
/** Required for undelegation. Commit-only callers may omit it. */
|
|
556
|
+
authority?: Address;
|
|
557
|
+
magicContext?: Address;
|
|
558
|
+
magicProgram?: Address;
|
|
559
|
+
poolState: Address;
|
|
560
|
+
commitmentTree: Address;
|
|
561
|
+
nullifierAccounts: Address[];
|
|
562
|
+
};
|
|
563
|
+
nullifierHashes: Uint8Array[];
|
|
564
|
+
allowUndelegation?: boolean;
|
|
565
|
+
}
|
|
566
|
+
export type MagicBlockPerPermissionOperation = "create" | "update" | "close";
|
|
567
|
+
export interface MagicBlockPerPermissionMember {
|
|
568
|
+
address: Address;
|
|
569
|
+
flags: number;
|
|
570
|
+
}
|
|
571
|
+
export interface MagicBlockPerPermissionInstructionOptions {
|
|
572
|
+
operation: MagicBlockPerPermissionOperation;
|
|
573
|
+
target: MagicBlockDelegateTarget;
|
|
574
|
+
members?: MagicBlockPerPermissionMember[];
|
|
575
|
+
accounts: {
|
|
576
|
+
authority: Address;
|
|
577
|
+
poolState: Address;
|
|
578
|
+
permissionedAccount: Address;
|
|
579
|
+
permission: Address;
|
|
580
|
+
ephemeralVault?: Address;
|
|
581
|
+
magicProgram?: Address;
|
|
582
|
+
permissionProgram?: Address;
|
|
583
|
+
};
|
|
584
|
+
}
|
|
585
|
+
/**
|
|
586
|
+
* Build magicblock_delegate instruction data (disc=32).
|
|
587
|
+
*/
|
|
588
|
+
export declare function buildMagicBlockDelegateInstructionData(options: {
|
|
589
|
+
target: MagicBlockDelegateTarget;
|
|
590
|
+
commitFrequencyMs: number;
|
|
591
|
+
validator?: Address;
|
|
592
|
+
}): Uint8Array;
|
|
593
|
+
/**
|
|
594
|
+
* Build a complete magicblock_delegate instruction.
|
|
595
|
+
*/
|
|
596
|
+
export declare function buildMagicBlockDelegateInstruction(options: MagicBlockDelegateInstructionOptions): Instruction;
|
|
597
|
+
/**
|
|
598
|
+
* Build magicblock_commit instruction data (disc=33).
|
|
599
|
+
*/
|
|
600
|
+
export declare function buildMagicBlockCommitInstructionData(options: {
|
|
601
|
+
nullifierHashes: Uint8Array[];
|
|
602
|
+
allowUndelegation?: boolean;
|
|
603
|
+
}): Uint8Array;
|
|
604
|
+
/**
|
|
605
|
+
* Build a complete magicblock_commit instruction.
|
|
606
|
+
*/
|
|
607
|
+
export declare function buildMagicBlockCommitInstruction(options: MagicBlockCommitInstructionOptions): Instruction;
|
|
608
|
+
export declare function buildMagicBlockPerPermissionInstructionData(options: {
|
|
609
|
+
operation: MagicBlockPerPermissionOperation;
|
|
610
|
+
target: MagicBlockDelegateTarget;
|
|
611
|
+
members?: MagicBlockPerPermissionMember[];
|
|
612
|
+
}): Uint8Array;
|
|
613
|
+
export declare function buildMagicBlockPerPermissionInstruction(options: MagicBlockPerPermissionInstructionOptions): Instruction;
|
|
614
|
+
export type PolicyApprovalDecision = "approve" | "reject";
|
|
615
|
+
/** Must match `MAX_INTENT_PARTS` in the asset program. */
|
|
616
|
+
export declare const MAX_POLICY_INTENT_PARTS = 3;
|
|
617
|
+
/**
|
|
618
|
+
* Build the intent parts a spend's policy approval commits to.
|
|
619
|
+
*
|
|
620
|
+
* The layout mirrors what the asset program hashes, and deliberately carries no
|
|
621
|
+
* proof machinery: the merkle root, output commitments and stealth data all move
|
|
622
|
+
* when a spend is re-proved, and a spend has to be re-proved whenever the root
|
|
623
|
+
* advances — which is exactly while the authority is deciding. Binding them
|
|
624
|
+
* would make every approval expire the moment someone else deposits.
|
|
625
|
+
*
|
|
626
|
+
* Amounts and BTC scripts are encoded exactly as the instruction encodes them,
|
|
627
|
+
* because the program hashes the same trailing bytes it parses.
|
|
628
|
+
*/
|
|
629
|
+
export declare function buildPolicyIntentParts(options: {
|
|
630
|
+
action: 13;
|
|
631
|
+
nullifiers: Uint8Array[];
|
|
632
|
+
} | {
|
|
633
|
+
action: 14;
|
|
634
|
+
nullifiers: Uint8Array[];
|
|
635
|
+
unshieldAmounts: bigint[];
|
|
636
|
+
/** OWNER of each recipient token account — what the payout credits. */
|
|
637
|
+
recipientOwners: Uint8Array[];
|
|
638
|
+
} | {
|
|
639
|
+
action: 15;
|
|
640
|
+
nullifiers: Uint8Array[];
|
|
641
|
+
redeemAmounts: bigint[];
|
|
642
|
+
btcScripts: Uint8Array[];
|
|
643
|
+
requestNonces: bigint[];
|
|
644
|
+
}): Uint8Array[];
|
|
645
|
+
/**
|
|
646
|
+
* Mirror of `compute_policy_request_hash` in the asset program.
|
|
647
|
+
*
|
|
648
|
+
* The approval commits to what the authority decides — which notes are spent,
|
|
649
|
+
* how much leaves, and where it goes — never to the whole instruction. Binding
|
|
650
|
+
* the payload would tie an approval to one exact proof, and a spend has to be
|
|
651
|
+
* re-proved whenever the merkle root moves on, which is precisely while the
|
|
652
|
+
* authority is deciding.
|
|
653
|
+
*
|
|
654
|
+
* Parts, in the order the program hashes them:
|
|
655
|
+
* - `transact`: [nullifiers]
|
|
656
|
+
* - `unshield`: [nullifiers, amounts, recipientOwners]
|
|
657
|
+
* - `redeem`: [nullifiers, amountsScriptsAndNonces]
|
|
658
|
+
* - value entry (`shield` / `completeDeposit`): [instructionDataWithoutDiscriminator]
|
|
659
|
+
*
|
|
660
|
+
* Each part is folded to a fixed 32 bytes before the parts are joined, so their
|
|
661
|
+
* boundaries cannot be slid. Any drift from the on-chain version makes every
|
|
662
|
+
* Verified spend fail with PolicyApprovalMismatch.
|
|
663
|
+
*/
|
|
664
|
+
export declare function buildPolicyRequestHash(options: {
|
|
665
|
+
programId: Address;
|
|
666
|
+
poolState: Address;
|
|
667
|
+
actor: Address;
|
|
668
|
+
/** Discriminator of the asset instruction this approval covers. */
|
|
669
|
+
action: number;
|
|
670
|
+
intentParts: Uint8Array[];
|
|
671
|
+
}): Uint8Array;
|
|
672
|
+
export interface InitializePolicyApprovalOptions {
|
|
673
|
+
action: number;
|
|
674
|
+
expiresAtSlot: bigint;
|
|
675
|
+
actor: Address;
|
|
676
|
+
requestHash: Uint8Array;
|
|
677
|
+
nonce: Uint8Array;
|
|
678
|
+
accounts: {
|
|
679
|
+
payer: Address;
|
|
680
|
+
poolState: Address;
|
|
681
|
+
policyApproval: Address;
|
|
682
|
+
systemProgram?: Address;
|
|
683
|
+
};
|
|
684
|
+
}
|
|
685
|
+
export declare function buildInitializePolicyApprovalInstructionData(options: Omit<InitializePolicyApprovalOptions, "accounts">): Uint8Array;
|
|
686
|
+
export declare function buildInitializePolicyApprovalInstruction(options: InitializePolicyApprovalOptions): Instruction;
|
|
687
|
+
export declare function buildPolicyApprovalDecisionInstruction(options: {
|
|
688
|
+
decision: PolicyApprovalDecision;
|
|
689
|
+
accounts: {
|
|
690
|
+
policyAuthority: Address;
|
|
691
|
+
policyApproval: Address;
|
|
692
|
+
};
|
|
693
|
+
}): Instruction;
|
|
694
|
+
export declare function buildPolicyApprovalCommitInstruction(options: {
|
|
695
|
+
accounts: {
|
|
696
|
+
payer: Address;
|
|
697
|
+
policyApproval: Address;
|
|
698
|
+
magicContext?: Address;
|
|
699
|
+
magicProgram?: Address;
|
|
700
|
+
};
|
|
701
|
+
}): Instruction;
|
|
702
|
+
/**
|
|
703
|
+
* Build btc-light-client verify_transaction instruction data (disc=2)
|
|
704
|
+
*
|
|
705
|
+
* Layout (after disc byte):
|
|
706
|
+
* txid(32) + block_hash(32) + tx_size(u32 LE) + merkle_proof(variable)
|
|
707
|
+
*
|
|
708
|
+
* Merkle proof sub-layout:
|
|
709
|
+
* proof_txid(32) + path_bits(u32 LE) + path_len(u8) + tx_index(u32 LE) + siblings(32 * path_len)
|
|
710
|
+
*/
|
|
711
|
+
export declare function buildVerifyTransactionInstructionData(params: {
|
|
712
|
+
txid: Uint8Array;
|
|
713
|
+
blockHash: Uint8Array;
|
|
714
|
+
txSize: number;
|
|
715
|
+
txIndex: number;
|
|
716
|
+
merkleSiblings: Uint8Array[];
|
|
717
|
+
pathBits: number;
|
|
718
|
+
}): Uint8Array;
|
|
719
|
+
/**
|
|
720
|
+
* Build utxopia complete_deposit instruction data (disc=11)
|
|
721
|
+
*
|
|
722
|
+
* npk + ephemeral_pub are extracted ON-CHAIN from the deposit TX OP_RETURN.
|
|
723
|
+
* Amount is extracted from the SPV-verified sweep TX.
|
|
724
|
+
*
|
|
725
|
+
* Layout: disc(1) + sweep_txid(32) + block_height(u64 LE)
|
|
726
|
+
* + sweep_tx_size(u32 LE) + deposit_tx_size(u32 LE) + deposit_txid(32) = 81 bytes
|
|
727
|
+
*/
|
|
728
|
+
export declare function buildCompleteDepositInstructionData(params: {
|
|
729
|
+
sweepTxid: Uint8Array;
|
|
730
|
+
blockHeight: number;
|
|
731
|
+
sweepTxSize: number;
|
|
732
|
+
depositTxSize: number;
|
|
733
|
+
depositTxid: Uint8Array;
|
|
734
|
+
}): Uint8Array;
|
|
735
|
+
/** PoolConfig account discriminator (0x0a) */
|
|
736
|
+
export declare const POOL_CONFIG_DISCRIMINATOR = 10;
|
|
737
|
+
/** Serialized PoolConfig account length (bytes) */
|
|
738
|
+
export declare const POOL_CONFIG_LEN = 129;
|
|
739
|
+
/** Max pool_script (P2TR scriptPubKey) length */
|
|
740
|
+
export declare const POOL_SCRIPT_MAX_LEN = 34;
|
|
741
|
+
/**
|
|
742
|
+
* Build set_pool_config instruction data (disc=2).
|
|
743
|
+
*
|
|
744
|
+
* Strict payload — the program rejects any other shape:
|
|
745
|
+
* disc(1)
|
|
746
|
+
* + pool_script_len(1)
|
|
747
|
+
* + pool_script(N, 1..=34)
|
|
748
|
+
* + ika_dwallet(32)
|
|
749
|
+
* + ika_dwallet_xonly_pubkey(32)
|
|
750
|
+
* + cpi_authority_bump(1)
|
|
751
|
+
*
|
|
752
|
+
* `group_pub_key` is no longer part of PoolConfig and must not be sent.
|
|
753
|
+
*/
|
|
754
|
+
export declare function buildSetPoolConfigInstructionData(params: {
|
|
755
|
+
poolScript: Uint8Array;
|
|
756
|
+
ikaDwallet: Uint8Array;
|
|
757
|
+
ikaDwalletXonlyPubkey: Uint8Array;
|
|
758
|
+
cpiAuthorityBump: number;
|
|
759
|
+
}): Uint8Array;
|
|
760
|
+
/** Parsed PoolConfig account (Ika-only, 129 bytes) */
|
|
761
|
+
export interface ParsedPoolConfig {
|
|
762
|
+
discriminator: number;
|
|
763
|
+
poolScriptLen: number;
|
|
764
|
+
poolScript: Uint8Array;
|
|
765
|
+
ikaDwallet: Uint8Array;
|
|
766
|
+
ikaDwalletXonlyPubkey: Uint8Array;
|
|
767
|
+
cpiAuthorityBump: number;
|
|
768
|
+
}
|
|
769
|
+
/**
|
|
770
|
+
* Parse a PoolConfig account.
|
|
771
|
+
*
|
|
772
|
+
* Layout (fixed offsets — pool_script is a 34-byte field regardless of len):
|
|
773
|
+
* disc(1) @0, pool_script_len(1) @1, pool_script(34) @2,
|
|
774
|
+
* ika_dwallet(32) @36, ika_dwallet_xonly_pubkey(32) @68,
|
|
775
|
+
* cpi_authority_bump(1) @100, reserved(28) @101
|
|
776
|
+
*/
|
|
777
|
+
export declare function parsePoolConfig(data: Uint8Array): ParsedPoolConfig;
|
|
778
|
+
/**
|
|
779
|
+
* Bigint to 32-byte Uint8Array (big-endian)
|
|
780
|
+
*/
|
|
781
|
+
export declare function bigintTo32Bytes(value: bigint): Uint8Array;
|
|
782
|
+
/**
|
|
783
|
+
* 32-byte Uint8Array to bigint (big-endian)
|
|
784
|
+
*/
|
|
785
|
+
export declare function bytes32ToBigint(bytes: Uint8Array): bigint;
|
|
786
|
+
export { hexToBytes, bytesToHex } from "./crypto";
|
|
787
|
+
/** initializePermissioned instruction options */
|
|
788
|
+
export interface InitializePermissionedOptions {
|
|
789
|
+
/** PDA bump for pool state */
|
|
790
|
+
poolBump: number;
|
|
791
|
+
/** PDA bump for commitment tree */
|
|
792
|
+
treeBump: number;
|
|
793
|
+
/** Deposit fee in basis points (u16 LE) */
|
|
794
|
+
depositFeeBps: number;
|
|
795
|
+
/** Withdrawal fee in basis points (u16 LE) */
|
|
796
|
+
withdrawalFeeBps: number;
|
|
797
|
+
/** Auditor's Solana pubkey (32 bytes) */
|
|
798
|
+
auditor: Uint8Array;
|
|
799
|
+
/** Auditor's viewing public key (32 bytes) */
|
|
800
|
+
auditorViewingPubkey: Uint8Array;
|
|
801
|
+
/** Account addresses — same layout as initialize (disc=0) */
|
|
802
|
+
accounts: {
|
|
803
|
+
/** 0. pool_state (writable) */
|
|
804
|
+
poolState: Address;
|
|
805
|
+
/** 1. commitment_tree (writable) */
|
|
806
|
+
commitmentTree: Address;
|
|
807
|
+
/** 2. zkbtc_mint (writable) */
|
|
808
|
+
zkbtcMint: Address;
|
|
809
|
+
/** 3. pool_vault (writable) */
|
|
810
|
+
poolVault: Address;
|
|
811
|
+
/** 4. deposit_vault (writable) */
|
|
812
|
+
depositVault: Address;
|
|
813
|
+
/** 5. authority (signer, writable — pays for storage) */
|
|
814
|
+
authority: Address;
|
|
815
|
+
/** 6. system_program (readonly) */
|
|
816
|
+
systemProgram: Address;
|
|
817
|
+
};
|
|
818
|
+
}
|
|
819
|
+
/**
|
|
820
|
+
* Build initializePermissioned instruction data (disc=21).
|
|
821
|
+
*
|
|
822
|
+
* Layout (after disc byte — same as initialize plus two 32-byte fields):
|
|
823
|
+
* pool_bump(1) + tree_bump(1) + deposit_fee_bps(2 LE) + withdrawal_fee_bps(2 LE)
|
|
824
|
+
* + auditor(32) + auditor_viewing_pubkey(32)
|
|
825
|
+
* = 70 bytes of payload; 71 bytes total with disc.
|
|
826
|
+
*/
|
|
827
|
+
export declare function buildInitializePermissionedInstructionData(options: {
|
|
828
|
+
poolBump: number;
|
|
829
|
+
treeBump: number;
|
|
830
|
+
depositFeeBps: number;
|
|
831
|
+
withdrawalFeeBps: number;
|
|
832
|
+
auditor: Uint8Array;
|
|
833
|
+
auditorViewingPubkey: Uint8Array;
|
|
834
|
+
}): Uint8Array;
|
|
835
|
+
/**
|
|
836
|
+
* Build a complete initializePermissioned instruction (disc=21).
|
|
837
|
+
*
|
|
838
|
+
* Initializes a pool in permissioned mode; deposits/shields require auditor co-signing.
|
|
839
|
+
*
|
|
840
|
+
* Accounts (identical to initialize, disc=0):
|
|
841
|
+
* 0. pool_state (writable)
|
|
842
|
+
* 1. commitment_tree (writable)
|
|
843
|
+
* 2. zkbtc_mint (writable)
|
|
844
|
+
* 3. pool_vault (writable)
|
|
845
|
+
* 4. deposit_vault (writable)
|
|
846
|
+
* 5. authority (writable signer)
|
|
847
|
+
* 6. system_program (readonly)
|
|
848
|
+
*/
|
|
849
|
+
export declare function buildInitializePermissionedInstruction(options: InitializePermissionedOptions): Instruction;
|
|
850
|
+
/** completeDepositPermissioned instruction options */
|
|
851
|
+
export interface CompleteDepositPermissionedOptions {
|
|
852
|
+
/** SPV-proven sweep txid (32 bytes, internal byte order) */
|
|
853
|
+
sweepTxid: Uint8Array;
|
|
854
|
+
/** Block height containing the verified tx */
|
|
855
|
+
blockHeight: number;
|
|
856
|
+
/** Raw sweep tx size in ChadBuffer */
|
|
857
|
+
sweepTxSize: number;
|
|
858
|
+
/** Raw deposit tx size in ChadBuffer (0 = direct-to-pool) */
|
|
859
|
+
depositTxSize: number;
|
|
860
|
+
/** Deposit txid (32 bytes, internal byte order) */
|
|
861
|
+
depositTxid: Uint8Array;
|
|
862
|
+
/**
|
|
863
|
+
* Auditor ciphertext: either a pre-computed 112-byte `Uint8Array` blob (advanced
|
|
864
|
+
* / off-chain computed), OR the raw note fields from which the blob is derived
|
|
865
|
+
* on the fly via {@link buildAuditorCiphertextForNote}.
|
|
866
|
+
*
|
|
867
|
+
* If a `Uint8Array` is supplied it is used verbatim (preferred for auditors who
|
|
868
|
+
* hold the key off-chain). Pass `{ auditorViewingPubKey, tokenId, amount, commitment }`
|
|
869
|
+
* to have the builder encrypt and embed the ciphertext automatically.
|
|
870
|
+
*/
|
|
871
|
+
auditorCiphertext: AuditorCiphertextInput;
|
|
872
|
+
/** Account addresses — same 15 as complete_deposit PLUS auditor at index 15 */
|
|
873
|
+
accounts: {
|
|
874
|
+
/** 0. pool_state (writable) */
|
|
875
|
+
poolState: Address;
|
|
876
|
+
/** 1. verified_transaction PDA (readonly) */
|
|
877
|
+
verifiedTransaction: Address;
|
|
878
|
+
/** 2. light_client (readonly) */
|
|
879
|
+
lightClient: Address;
|
|
880
|
+
/** 3. commitment_tree (writable) */
|
|
881
|
+
commitmentTree: Address;
|
|
882
|
+
/** 4. tx_buffer / sweep ChadBuffer (readonly) */
|
|
883
|
+
txBuffer: Address;
|
|
884
|
+
/** 5. authority (writable signer) */
|
|
885
|
+
authority: Address;
|
|
886
|
+
/** 6. system_program (readonly) */
|
|
887
|
+
systemProgram: Address;
|
|
888
|
+
/** 7. zkbtc_mint (writable) */
|
|
889
|
+
zkbtcMint: Address;
|
|
890
|
+
/** 8. pool_vault (writable) */
|
|
891
|
+
poolVault: Address;
|
|
892
|
+
/** 9. token_program (readonly) */
|
|
893
|
+
tokenProgram: Address;
|
|
894
|
+
/** 10. deposit_tx_buffer (readonly) */
|
|
895
|
+
depositTxBuffer: Address;
|
|
896
|
+
/** 11. deposit_receipt PDA (writable) */
|
|
897
|
+
depositReceipt: Address;
|
|
898
|
+
/** 12. utxo_record PDA (writable) */
|
|
899
|
+
utxoRecord: Address;
|
|
900
|
+
/** 13. token_config PDA (writable) */
|
|
901
|
+
tokenConfig: Address;
|
|
902
|
+
/** 14. pool_config PDA (readonly) */
|
|
903
|
+
poolConfig: Address;
|
|
904
|
+
/** 15. one-time PolicyApproval (writable) */
|
|
905
|
+
policyApproval: Address;
|
|
906
|
+
};
|
|
907
|
+
}
|
|
908
|
+
/**
|
|
909
|
+
* Build completeDepositPermissioned instruction data (disc=22).
|
|
910
|
+
*
|
|
911
|
+
* Layout:
|
|
912
|
+
* disc(1) + CompleteDepositData fixed header (80 bytes) + auditorCiphertext (variable)
|
|
913
|
+
*
|
|
914
|
+
* The 80-byte header is identical to complete_deposit (disc=11).
|
|
915
|
+
*/
|
|
916
|
+
export declare function buildCompleteDepositPermissionedInstructionData(options: {
|
|
917
|
+
sweepTxid: Uint8Array;
|
|
918
|
+
blockHeight: number;
|
|
919
|
+
sweepTxSize: number;
|
|
920
|
+
depositTxSize: number;
|
|
921
|
+
depositTxid: Uint8Array;
|
|
922
|
+
auditorCiphertext: AuditorCiphertextInput;
|
|
923
|
+
}): Uint8Array;
|
|
924
|
+
/**
|
|
925
|
+
* Build a complete completeDepositPermissioned instruction (disc=22).
|
|
926
|
+
*
|
|
927
|
+
* Same accounts as complete_deposit (disc=11), plus a one-time PolicyApproval
|
|
928
|
+
* appended at account index 15.
|
|
929
|
+
*
|
|
930
|
+
* Accounts:
|
|
931
|
+
* 0. pool_state (writable)
|
|
932
|
+
* 1. verified_transaction(readonly)
|
|
933
|
+
* 2. light_client (readonly)
|
|
934
|
+
* 3. commitment_tree (writable)
|
|
935
|
+
* 4. tx_buffer (readonly)
|
|
936
|
+
* 5. authority (writable signer)
|
|
937
|
+
* 6. system_program (readonly)
|
|
938
|
+
* 7. zkbtc_mint (writable)
|
|
939
|
+
* 8. pool_vault (writable)
|
|
940
|
+
* 9. token_program (readonly)
|
|
941
|
+
* 10. deposit_tx_buffer (readonly)
|
|
942
|
+
* 11. deposit_receipt (writable)
|
|
943
|
+
* 12. utxo_record (writable)
|
|
944
|
+
* 13. token_config (writable)
|
|
945
|
+
* 14. pool_config (readonly)
|
|
946
|
+
* 15. policy_approval (writable)
|
|
947
|
+
*/
|
|
948
|
+
export declare function buildCompleteDepositPermissionedInstruction(options: CompleteDepositPermissionedOptions): Instruction;
|
|
949
|
+
/** shieldPermissioned instruction options */
|
|
950
|
+
export interface ShieldPermissionedInstructionOptions {
|
|
951
|
+
/** Amount to shield (in token's smallest unit) */
|
|
952
|
+
amount: bigint;
|
|
953
|
+
/** NPK bytes (32) — recipient's note public key */
|
|
954
|
+
npk: Uint8Array;
|
|
955
|
+
/** Ephemeral public key (32) — for stealth address derivation */
|
|
956
|
+
ephemeralPub: Uint8Array;
|
|
957
|
+
/**
|
|
958
|
+
* Auditor ciphertext: either a pre-computed 112-byte `Uint8Array` blob (advanced
|
|
959
|
+
* / off-chain computed), OR the raw note fields from which the blob is derived
|
|
960
|
+
* on the fly via {@link buildAuditorCiphertextForNote}.
|
|
961
|
+
*
|
|
962
|
+
* If a `Uint8Array` is supplied it is used verbatim (preferred for auditors who
|
|
963
|
+
* hold the key off-chain). Pass `{ auditorViewingPubKey, tokenId, amount, commitment }`
|
|
964
|
+
* to have the builder encrypt and embed the ciphertext automatically.
|
|
965
|
+
*/
|
|
966
|
+
auditorCiphertext: AuditorCiphertextInput;
|
|
967
|
+
/** Account addresses — same 7 as shield (disc=12) plus PolicyApproval at index 7 */
|
|
968
|
+
accounts: {
|
|
969
|
+
/** 0. user (writable signer) */
|
|
970
|
+
user: Address;
|
|
971
|
+
/** 1. user_token_account (writable) */
|
|
972
|
+
userTokenAccount: Address;
|
|
973
|
+
/** 2. pool_state (readonly) */
|
|
974
|
+
poolState: Address;
|
|
975
|
+
/** 3. token_config (writable) */
|
|
976
|
+
tokenConfig: Address;
|
|
977
|
+
/** 4. vault (writable) */
|
|
978
|
+
vault: Address;
|
|
979
|
+
/** 5. commitment_tree (writable) */
|
|
980
|
+
commitmentTree: Address;
|
|
981
|
+
/** 6. token_program (readonly) */
|
|
982
|
+
tokenProgram: Address;
|
|
983
|
+
/** 7. one-time PolicyApproval (writable) */
|
|
984
|
+
policyApproval: Address;
|
|
985
|
+
/**
|
|
986
|
+
* 9. ExitDestination PDA registered for `user`.
|
|
987
|
+
*
|
|
988
|
+
* Value cannot enter without a way back out: the program refuses a
|
|
989
|
+
* depositor who has no registered exit, so they can always ragequit to
|
|
990
|
+
* their own wallet without the auditor. Derive with
|
|
991
|
+
* {@link deriveExitDestinationPDA} using `EXIT_KIND_SOLANA_OWNER` and the
|
|
992
|
+
* depositor's address.
|
|
993
|
+
*/
|
|
994
|
+
exitDestination: Address;
|
|
995
|
+
};
|
|
996
|
+
}
|
|
997
|
+
/**
|
|
998
|
+
* Build shieldPermissioned instruction data (disc=23).
|
|
999
|
+
*
|
|
1000
|
+
* Layout:
|
|
1001
|
+
* disc(1) + shield header (72 bytes) + auditorCiphertext (variable)
|
|
1002
|
+
*
|
|
1003
|
+
* The 72-byte header is identical to shield (disc=12):
|
|
1004
|
+
* amount(8 LE) + npk(32) + ephemeral_pub(32)
|
|
1005
|
+
*/
|
|
1006
|
+
export declare function buildShieldPermissionedInstructionData(options: {
|
|
1007
|
+
amount: bigint;
|
|
1008
|
+
npk: Uint8Array;
|
|
1009
|
+
ephemeralPub: Uint8Array;
|
|
1010
|
+
auditorCiphertext: AuditorCiphertextInput;
|
|
1011
|
+
}): Uint8Array;
|
|
1012
|
+
/**
|
|
1013
|
+
* Build a complete shieldPermissioned instruction (disc=23).
|
|
1014
|
+
*
|
|
1015
|
+
* Same accounts as shield (disc=12), plus three appended.
|
|
1016
|
+
*
|
|
1017
|
+
* Accounts:
|
|
1018
|
+
* 0. user (writable signer)
|
|
1019
|
+
* 1. user_token_account(writable)
|
|
1020
|
+
* 2. pool_state (writable)
|
|
1021
|
+
* 3. token_config (writable)
|
|
1022
|
+
* 4. vault (writable)
|
|
1023
|
+
* 5. commitment_tree (writable)
|
|
1024
|
+
* 6. token_program (readonly)
|
|
1025
|
+
* 7. policy_approval (writable)
|
|
1026
|
+
* 8. policy_program (readonly)
|
|
1027
|
+
* 9. exit_destination (readonly) — the depositor's registered exit
|
|
1028
|
+
*/
|
|
1029
|
+
export declare function buildShieldPermissionedInstruction(options: ShieldPermissionedInstructionOptions): Instruction;
|
|
1030
|
+
/**
|
|
1031
|
+
* Build a registerExitDestination instruction (disc=39) — auditor-only.
|
|
1032
|
+
*
|
|
1033
|
+
* Adds one entry to a permissioned pool's append-only exit registry. Entries can
|
|
1034
|
+
* be added but never removed: a removable entry would hand the auditor back the
|
|
1035
|
+
* ability to prevent a withdrawal, which is the one power the design withholds.
|
|
1036
|
+
*
|
|
1037
|
+
* Register a depositor's address BEFORE their first `shieldPermissioned` — the
|
|
1038
|
+
* program refuses a depositor who has no exit.
|
|
1039
|
+
*
|
|
1040
|
+
* Data: kind(1) + key(32)
|
|
1041
|
+
* Accounts: 0. auditor (writable signer, pays rent)
|
|
1042
|
+
* 1. pool_state (readonly)
|
|
1043
|
+
* 2. exit_destination PDA (writable, uninitialized)
|
|
1044
|
+
* 3. system_program (readonly)
|
|
1045
|
+
*/
|
|
1046
|
+
/**
|
|
1047
|
+
* Build registerExitDestination instruction data (disc=39).
|
|
1048
|
+
*
|
|
1049
|
+
* Layout: disc(1) + kind(1) + key(32)
|
|
1050
|
+
*/
|
|
1051
|
+
export declare function buildRegisterExitDestinationInstructionData(options: {
|
|
1052
|
+
kind: number;
|
|
1053
|
+
key: Uint8Array;
|
|
1054
|
+
}): Uint8Array;
|
|
1055
|
+
export declare function buildRegisterExitDestinationInstruction(options: {
|
|
1056
|
+
/** `EXIT_KIND_SOLANA_OWNER` or `EXIT_KIND_BTC_SCRIPT`. */
|
|
1057
|
+
kind: number;
|
|
1058
|
+
/** Recipient token account owner, or sha256(btcScript). */
|
|
1059
|
+
key: Uint8Array;
|
|
1060
|
+
accounts: {
|
|
1061
|
+
auditor: Address;
|
|
1062
|
+
poolState: Address;
|
|
1063
|
+
exitDestination: Address;
|
|
1064
|
+
};
|
|
1065
|
+
}): Instruction;
|
|
1066
|
+
/** setAuditorFrozen instruction options */
|
|
1067
|
+
export interface SetAuditorFrozenOptions {
|
|
1068
|
+
/** true = freeze the auditor role; false = un-freeze */
|
|
1069
|
+
frozen: boolean;
|
|
1070
|
+
accounts: {
|
|
1071
|
+
/** 0. pool_state (writable) */
|
|
1072
|
+
poolState: Address;
|
|
1073
|
+
/** 1. auditor (signer) */
|
|
1074
|
+
auditor: Address;
|
|
1075
|
+
};
|
|
1076
|
+
}
|
|
1077
|
+
/**
|
|
1078
|
+
* Build setAuditorFrozen instruction data (disc=28).
|
|
1079
|
+
*
|
|
1080
|
+
* Layout: disc(1) + frozen(1) — frozen byte: 0 = not frozen, 1 = frozen.
|
|
1081
|
+
*/
|
|
1082
|
+
export declare function buildSetAuditorFrozenInstructionData(frozen: boolean): Uint8Array;
|
|
1083
|
+
/**
|
|
1084
|
+
* Build a complete setAuditorFrozen instruction (disc=28).
|
|
1085
|
+
*
|
|
1086
|
+
* Accounts:
|
|
1087
|
+
* 0. pool_state (writable)
|
|
1088
|
+
* 1. auditor (signer)
|
|
1089
|
+
*/
|
|
1090
|
+
export declare function buildSetAuditorFrozenInstruction(options: SetAuditorFrozenOptions): Instruction;
|
|
1091
|
+
/** setAuditorViewingPubkey instruction options */
|
|
1092
|
+
export interface SetAuditorViewingPubkeyOptions {
|
|
1093
|
+
/** New 32-byte viewing pubkey for the auditor */
|
|
1094
|
+
viewingPubkey: Uint8Array;
|
|
1095
|
+
accounts: {
|
|
1096
|
+
/** 0. pool_state (writable) */
|
|
1097
|
+
poolState: Address;
|
|
1098
|
+
/** 1. auditor (signer) */
|
|
1099
|
+
auditor: Address;
|
|
1100
|
+
};
|
|
1101
|
+
}
|
|
1102
|
+
/**
|
|
1103
|
+
* Build setAuditorViewingPubkey instruction data (disc=29).
|
|
1104
|
+
*
|
|
1105
|
+
* Layout: disc(1) + viewing_pubkey(32) = 33 bytes.
|
|
1106
|
+
*/
|
|
1107
|
+
export declare function buildSetAuditorViewingPubkeyInstructionData(viewingPubkey: Uint8Array): Uint8Array;
|
|
1108
|
+
/**
|
|
1109
|
+
* Build a complete setAuditorViewingPubkey instruction (disc=29).
|
|
1110
|
+
*
|
|
1111
|
+
* Accounts:
|
|
1112
|
+
* 0. pool_state (writable)
|
|
1113
|
+
* 1. auditor (signer)
|
|
1114
|
+
*/
|
|
1115
|
+
export declare function buildSetAuditorViewingPubkeyInstruction(options: SetAuditorViewingPubkeyOptions): Instruction;
|
|
1116
|
+
export interface RotateAuditorOptions {
|
|
1117
|
+
auditor: Uint8Array;
|
|
1118
|
+
viewingPubkey: Uint8Array;
|
|
1119
|
+
accounts: {
|
|
1120
|
+
poolState: Address;
|
|
1121
|
+
authority: Address;
|
|
1122
|
+
};
|
|
1123
|
+
}
|
|
1124
|
+
export declare function buildRotateAuditorInstructionData(auditor: Uint8Array, viewingPubkey: Uint8Array): Uint8Array;
|
|
1125
|
+
export declare function buildRotateAuditorInstruction(options: RotateAuditorOptions): Instruction;
|