@lightprotocol/stateless.js 0.20.8 → 0.21.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/dist/cjs/browser/actions/compress.d.ts +9 -7
- package/dist/cjs/browser/actions/create-account.d.ts +25 -28
- package/dist/cjs/browser/actions/decompress.d.ts +6 -7
- package/dist/cjs/browser/actions/index.d.ts +1 -1
- package/dist/cjs/browser/actions/transfer.d.ts +8 -11
- package/dist/cjs/browser/constants.d.ts +16 -6
- package/dist/cjs/browser/index.cjs +1 -1
- package/dist/cjs/browser/index.cjs.map +1 -1
- package/dist/cjs/browser/index.d.ts +2 -2
- package/dist/cjs/browser/instruction/pack-compressed-accounts.d.ts +6 -24
- package/dist/cjs/browser/programs/layout.d.ts +27 -0
- package/dist/cjs/browser/programs/system.d.ts +18 -27
- package/dist/cjs/browser/rpc-interface.d.ts +115 -50
- package/dist/cjs/browser/rpc.d.ts +21 -41
- package/dist/cjs/browser/state/BN254.d.ts +0 -1
- package/dist/cjs/browser/state/bn.d.ts +3 -0
- package/dist/cjs/browser/state/compressed-account.d.ts +53 -13
- package/dist/cjs/browser/state/index.d.ts +1 -0
- package/dist/cjs/browser/state/types.d.ts +87 -12
- package/dist/cjs/browser/test-helpers/test-rpc/get-compressed-accounts.d.ts +10 -1
- package/dist/cjs/browser/test-helpers/test-rpc/get-compressed-token-accounts.d.ts +1 -1
- package/dist/cjs/browser/test-helpers/test-rpc/test-rpc.d.ts +15 -19
- package/dist/cjs/browser/utils/get-state-tree-infos.d.ts +41 -0
- package/dist/cjs/browser/utils/index.d.ts +5 -2
- package/dist/cjs/browser/utils/parse-validity-proof.d.ts +3 -3
- package/dist/cjs/browser/utils/state-tree-lookup-table.d.ts +68 -0
- package/dist/cjs/node/actions/compress.d.ts +9 -7
- package/dist/cjs/node/actions/create-account.d.ts +25 -28
- package/dist/cjs/node/actions/decompress.d.ts +6 -7
- package/dist/cjs/node/actions/index.d.ts +1 -1
- package/dist/cjs/node/actions/transfer.d.ts +8 -11
- package/dist/cjs/node/constants.d.ts +16 -6
- package/dist/cjs/node/index.cjs +1 -1
- package/dist/cjs/node/index.cjs.map +1 -1
- package/dist/cjs/node/index.d.ts +2 -2
- package/dist/cjs/node/instruction/pack-compressed-accounts.d.ts +6 -24
- package/dist/cjs/node/programs/layout.d.ts +27 -0
- package/dist/cjs/node/programs/system.d.ts +18 -27
- package/dist/cjs/node/rpc-interface.d.ts +115 -50
- package/dist/cjs/node/rpc.d.ts +21 -41
- package/dist/cjs/node/state/BN254.d.ts +0 -1
- package/dist/cjs/node/state/bn.d.ts +3 -0
- package/dist/cjs/node/state/compressed-account.d.ts +53 -13
- package/dist/cjs/node/state/index.d.ts +1 -0
- package/dist/cjs/node/state/types.d.ts +87 -12
- package/dist/cjs/node/test-helpers/test-rpc/get-compressed-accounts.d.ts +10 -1
- package/dist/cjs/node/test-helpers/test-rpc/get-compressed-token-accounts.d.ts +1 -1
- package/dist/cjs/node/test-helpers/test-rpc/test-rpc.d.ts +15 -19
- package/dist/cjs/node/utils/get-state-tree-infos.d.ts +41 -0
- package/dist/cjs/node/utils/index.d.ts +5 -2
- package/dist/cjs/node/utils/parse-validity-proof.d.ts +3 -3
- package/dist/cjs/node/utils/state-tree-lookup-table.d.ts +68 -0
- package/dist/types/index.d.ts +596 -405
- package/package.json +4 -3
- package/dist/cjs/browser/utils/get-light-state-tree-info.d.ts +0 -76
- package/dist/cjs/node/utils/get-light-state-tree-info.d.ts +0 -76
- /package/dist/cjs/browser/{actions/common.d.ts → utils/dedupe-signer.d.ts} +0 -0
- /package/dist/cjs/node/{actions/common.d.ts → utils/dedupe-signer.d.ts} +0 -0
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _solana_web3_js from '@solana/web3.js';
|
|
2
|
-
import { PublicKey, Connection, Commitment, Keypair, TransactionInstruction, AddressLookupTableAccount, VersionedTransaction,
|
|
2
|
+
import { PublicKey, Connection, Commitment, Keypair, Signer, ConfirmOptions, TransactionInstruction, AddressLookupTableAccount, VersionedTransaction, TransactionSignature, RpcResponseAndContext, SignatureResult, DataSlice, MemcmpFilter, ConnectionConfig, ParsedTransactionWithMeta, AccountMeta } from '@solana/web3.js';
|
|
3
3
|
import { Buffer as Buffer$1 } from 'buffer';
|
|
4
4
|
import { Struct } from 'superstruct';
|
|
5
5
|
import BN from 'bn.js';
|
|
@@ -13,12 +13,13 @@ import { Layout } from '@coral-xyz/borsh';
|
|
|
13
13
|
* are used to from working with the web3.js PublicKey type.
|
|
14
14
|
*/
|
|
15
15
|
type BN254 = BN;
|
|
16
|
-
declare const bn: (number: string | number | BN | Buffer$1 | Uint8Array | number[], base?: number | "hex" | undefined, endian?: BN.Endianness | undefined) => BN;
|
|
17
16
|
/** Create a bigint instance with <254-bit max size and base58 capabilities */
|
|
18
17
|
declare const createBN254: (number: string | number | BN | Buffer$1 | Uint8Array | number[], base?: number | "hex" | "base58" | undefined) => BN254;
|
|
19
18
|
/** Convert <254-bit bigint to Base58 string. */
|
|
20
19
|
declare function encodeBN254toBase58(bigintNumber: BN): string;
|
|
21
20
|
|
|
21
|
+
declare const bn: (number: string | number | BN | Buffer$1 | Uint8Array | number[], base?: number | "hex" | undefined, endian?: BN.Endianness | undefined) => BN;
|
|
22
|
+
|
|
22
23
|
declare function deriveAddressSeed(seeds: Uint8Array[], programId: PublicKey): Uint8Array;
|
|
23
24
|
/**
|
|
24
25
|
* Derive an address for a compressed account from a seed and an address Merkle
|
|
@@ -89,6 +90,14 @@ declare function airdropSol({ connection, lamports, recipientPublicKey, }: {
|
|
|
89
90
|
}): Promise<string>;
|
|
90
91
|
declare function confirmTransaction(connection: Connection, signature: string, confirmation?: Commitment): Promise<_solana_web3_js.RpcResponseAndContext<_solana_web3_js.SignatureResult>>;
|
|
91
92
|
|
|
93
|
+
/**
|
|
94
|
+
* @param targetLamports - Target priority fee in lamports
|
|
95
|
+
* @param computeUnits - Expected compute units used by the transaction
|
|
96
|
+
* @returns microLamports per compute unit (use in
|
|
97
|
+
* `ComputeBudgetProgram.setComputeUnitPrice`)
|
|
98
|
+
*/
|
|
99
|
+
declare function calculateComputeUnitPrice(targetLamports: number, computeUnits: number): number;
|
|
100
|
+
|
|
92
101
|
declare function byteArrayToKeypair(byteArray: number[]): Keypair;
|
|
93
102
|
/**
|
|
94
103
|
* @internal
|
|
@@ -120,6 +129,162 @@ declare function hashvToBn254FieldSizeBe(bytes: Uint8Array[]): Uint8Array;
|
|
|
120
129
|
/** Mutates array in place */
|
|
121
130
|
declare function pushUniqueItems<T>(items: T[], map: T[]): void;
|
|
122
131
|
|
|
132
|
+
/** @internal remove signer from signers if part of signers */
|
|
133
|
+
declare function dedupeSigner(signer: Signer, signers: Signer[]): Signer[];
|
|
134
|
+
|
|
135
|
+
declare const FIELD_SIZE: BN;
|
|
136
|
+
declare const HIGHEST_ADDRESS_PLUS_ONE: BN;
|
|
137
|
+
declare const COMPUTE_BUDGET_PATTERN: number[];
|
|
138
|
+
declare const INVOKE_DISCRIMINATOR: Buffer$1;
|
|
139
|
+
declare const INVOKE_CPI_DISCRIMINATOR: Buffer$1;
|
|
140
|
+
declare const INSERT_INTO_QUEUES_DISCRIMINATOR: Buffer$1;
|
|
141
|
+
declare const noopProgram = "noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV";
|
|
142
|
+
declare const lightProgram = "SySTEM1eSU2p4BGQfQpimFEWWSC1XDFeun3Nqzz3rT7";
|
|
143
|
+
declare const accountCompressionProgram = "compr6CUsB5m2jS4Y3831ztGSTnDpnKJTKS95d64XVq";
|
|
144
|
+
declare const getRegisteredProgramPda: () => PublicKey;
|
|
145
|
+
declare const getAccountCompressionAuthority: () => PublicKey;
|
|
146
|
+
declare const defaultStaticAccounts: () => PublicKey[];
|
|
147
|
+
declare const defaultStaticAccountsStruct: () => {
|
|
148
|
+
registeredProgramPda: PublicKey;
|
|
149
|
+
noopProgram: PublicKey;
|
|
150
|
+
accountCompressionProgram: PublicKey;
|
|
151
|
+
accountCompressionAuthority: PublicKey;
|
|
152
|
+
cpiSignatureAccount: null;
|
|
153
|
+
};
|
|
154
|
+
type StateTreeLUTPair = {
|
|
155
|
+
stateTreeLookupTable: PublicKey;
|
|
156
|
+
nullifyLookupTable: PublicKey;
|
|
157
|
+
};
|
|
158
|
+
/**
|
|
159
|
+
* Returns the Default Public State Tree LUTs for Devnet and Mainnet-Beta.
|
|
160
|
+
*/
|
|
161
|
+
declare const defaultStateTreeLookupTables: () => {
|
|
162
|
+
mainnet: StateTreeLUTPair[];
|
|
163
|
+
devnet: StateTreeLUTPair[];
|
|
164
|
+
};
|
|
165
|
+
/**
|
|
166
|
+
* @internal
|
|
167
|
+
*/
|
|
168
|
+
declare const isLocalTest: (url: string) => boolean;
|
|
169
|
+
/**
|
|
170
|
+
* @internal
|
|
171
|
+
*/
|
|
172
|
+
declare const localTestActiveStateTreeInfo: () => StateTreeInfo[];
|
|
173
|
+
declare const getDefaultAddressTreeInfo: () => {
|
|
174
|
+
tree: PublicKey;
|
|
175
|
+
queue: PublicKey;
|
|
176
|
+
cpiContext: null;
|
|
177
|
+
treeType: TreeType;
|
|
178
|
+
nextTreeInfo: null;
|
|
179
|
+
};
|
|
180
|
+
/**
|
|
181
|
+
* @deprecated use {@link rpc.getStateTreeInfos} and {@link selectStateTreeInfo} instead.
|
|
182
|
+
* for address trees, use {@link getDefaultAddressTreeInfo} instead.
|
|
183
|
+
* Use only with Localnet testing.
|
|
184
|
+
* For public networks, fetch via {@link defaultStateTreeLookupTables} and {@link getAllStateTreeInfos}.
|
|
185
|
+
*/
|
|
186
|
+
declare const defaultTestStateTreeAccounts: () => {
|
|
187
|
+
nullifierQueue: PublicKey;
|
|
188
|
+
merkleTree: PublicKey;
|
|
189
|
+
merkleTreeHeight: number;
|
|
190
|
+
addressTree: PublicKey;
|
|
191
|
+
addressQueue: PublicKey;
|
|
192
|
+
};
|
|
193
|
+
/**
|
|
194
|
+
* @internal testing only
|
|
195
|
+
*/
|
|
196
|
+
declare const defaultTestStateTreeAccounts2: () => {
|
|
197
|
+
nullifierQueue2: PublicKey;
|
|
198
|
+
merkleTree2: PublicKey;
|
|
199
|
+
};
|
|
200
|
+
declare const COMPRESSED_TOKEN_PROGRAM_ID: PublicKey;
|
|
201
|
+
declare const stateTreeLookupTableMainnet = "7i86eQs3GSqHjN47WdWLTCGMW6gde1q96G2EVnUyK2st";
|
|
202
|
+
declare const nullifiedStateTreeLookupTableMainnet = "H9QD4u1fG7KmkAzn2tDXhheushxFe1EcrjGGyEFXeMqT";
|
|
203
|
+
declare const stateTreeLookupTableDevnet = "Dk9mNkbiZXJZ4By8DfSP6HEE4ojZzRvucwpawLeuwq8q";
|
|
204
|
+
declare const nullifiedStateTreeLookupTableDevnet = "AXbHzp1NgjLvpfnD6JRTTovXZ7APUCdtWZFCRr5tCxse";
|
|
205
|
+
declare const nullifierQueuePubkey = "nfq1NvQDJ2GEgnS8zt9prAe8rjjpAW1zFkrvZoBR148";
|
|
206
|
+
declare const cpiContextPubkey = "cpi1uHzrEhBG733DoEJNgHCyRS3XmmyVNZx5fonubE4";
|
|
207
|
+
declare const merkletreePubkey = "smt1NamzXdq4AMqS2fS2F1i5KTYPZRhoHgWx38d8WsT";
|
|
208
|
+
declare const addressTree = "amt1Ayt45jfbdw5YSo7iz6WZxUmnZsQTYXy82hVwyC2";
|
|
209
|
+
declare const addressQueue = "aq1S9z4reTSQAdgWHGD2zDaS39sjGrAxbR31vxJ2F4F";
|
|
210
|
+
declare const merkleTree2Pubkey = "smt2rJAFdyJJupwMKAqTNAJwvjhmiZ4JYGZmbVRw1Ho";
|
|
211
|
+
declare const nullifierQueue2Pubkey = "nfq2hgS7NYemXsFaFUCe3EMXSDSfnZnAe27jC6aPP1X";
|
|
212
|
+
declare const cpiContext2Pubkey = "cpi2cdhkH5roePvcudTgUL8ppEBfTay1desGh8G8QxK";
|
|
213
|
+
declare const confirmConfig: ConfirmOptions;
|
|
214
|
+
declare const DEFAULT_MERKLE_TREE_HEIGHT = 26;
|
|
215
|
+
declare const DEFAULT_MERKLE_TREE_ROOTS = 2800;
|
|
216
|
+
/** Threshold (per asset) at which new in-UTXOs get merged, in order to reduce UTXO pool size */
|
|
217
|
+
declare const UTXO_MERGE_THRESHOLD = 20;
|
|
218
|
+
declare const UTXO_MERGE_MAXIMUM = 10;
|
|
219
|
+
/**
|
|
220
|
+
* Treshold after which the currently used transaction Merkle tree is switched
|
|
221
|
+
* to the next one
|
|
222
|
+
*/
|
|
223
|
+
declare const TRANSACTION_MERKLE_TREE_ROLLOVER_THRESHOLD: BN;
|
|
224
|
+
/**
|
|
225
|
+
* Fee to provide continous funding for the state Merkle tree.
|
|
226
|
+
* Once the state Merkle tree is at 95% capacity the accumulated fees
|
|
227
|
+
* will be used to fund the next state Merkle tree with the same parameters.
|
|
228
|
+
*
|
|
229
|
+
* Is charged per output compressed account.
|
|
230
|
+
*/
|
|
231
|
+
declare const STATE_MERKLE_TREE_ROLLOVER_FEE: BN;
|
|
232
|
+
/**
|
|
233
|
+
* Fee to provide continous funding for the address queue and address Merkle tree.
|
|
234
|
+
* Once the address Merkle tree is at 95% capacity the accumulated fees
|
|
235
|
+
* will be used to fund the next address queue and address tree with the same parameters.
|
|
236
|
+
*
|
|
237
|
+
* Is charged per newly created address.
|
|
238
|
+
*/
|
|
239
|
+
declare const ADDRESS_QUEUE_ROLLOVER_FEE: BN;
|
|
240
|
+
/**
|
|
241
|
+
* Is charged if the transaction nullifies at least one compressed account.
|
|
242
|
+
*/
|
|
243
|
+
declare const STATE_MERKLE_TREE_NETWORK_FEE: BN;
|
|
244
|
+
/**
|
|
245
|
+
* Is charged if the transaction creates at least one address.
|
|
246
|
+
*/
|
|
247
|
+
declare const ADDRESS_TREE_NETWORK_FEE: BN;
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* @deprecated use {@link selectStateTreeInfo} instead.
|
|
251
|
+
*
|
|
252
|
+
* Get a random tree and queue from a set of provided state tree infos.
|
|
253
|
+
*
|
|
254
|
+
* @param infos Set of state tree infos
|
|
255
|
+
* @returns A random tree and queue
|
|
256
|
+
*/
|
|
257
|
+
declare function pickRandomTreeAndQueue(infos: StateTreeInfo[]): {
|
|
258
|
+
tree: PublicKey;
|
|
259
|
+
queue: PublicKey;
|
|
260
|
+
};
|
|
261
|
+
/**
|
|
262
|
+
* Get a pseudo-random active state tree info from the set of provided state
|
|
263
|
+
* tree infos.
|
|
264
|
+
*
|
|
265
|
+
* Using this mitigates write lock contention on state trees.
|
|
266
|
+
*
|
|
267
|
+
* @param infos Set of state tree infos
|
|
268
|
+
* @param treeType The type of tree. Defaults to `TreeType.StateV1`
|
|
269
|
+
* @param useMaxConcurrency If true, return all infos. If false, return at
|
|
270
|
+
* most {@link MAX_HOTSPOTS}. Defaults to `false`.
|
|
271
|
+
*
|
|
272
|
+
* @returns A pseudo-randomly selected tree info
|
|
273
|
+
*/
|
|
274
|
+
declare function selectStateTreeInfo(infos: StateTreeInfo[], treeType?: TreeType, useMaxConcurrency?: boolean): StateTreeInfo;
|
|
275
|
+
/**
|
|
276
|
+
* Get active state tree infos from LUTs.
|
|
277
|
+
*
|
|
278
|
+
* @param connection The connection to the cluster
|
|
279
|
+
* @param stateTreeLUTPairs The state tree lookup table pairs
|
|
280
|
+
*
|
|
281
|
+
* @returns The active state tree infos
|
|
282
|
+
*/
|
|
283
|
+
declare function getAllStateTreeInfos({ connection, stateTreeLUTPairs, }: {
|
|
284
|
+
connection: Connection;
|
|
285
|
+
stateTreeLUTPairs: StateTreeLUTPair[];
|
|
286
|
+
}): Promise<StateTreeInfo[]>;
|
|
287
|
+
|
|
123
288
|
interface GnarkProofJson {
|
|
124
289
|
ar: string[];
|
|
125
290
|
bs: string[][];
|
|
@@ -135,9 +300,9 @@ declare const placeholderValidityProof: () => {
|
|
|
135
300
|
b: number[];
|
|
136
301
|
c: number[];
|
|
137
302
|
};
|
|
138
|
-
declare const checkValidityProofShape: (proof:
|
|
303
|
+
declare const checkValidityProofShape: (proof: ValidityProof) => void;
|
|
139
304
|
declare function proofFromJsonStruct(json: GnarkProofJson): ProofABC;
|
|
140
|
-
declare function negateAndCompressProof(proof: ProofABC):
|
|
305
|
+
declare function negateAndCompressProof(proof: ProofABC): ValidityProof;
|
|
141
306
|
|
|
142
307
|
/** pipe function */
|
|
143
308
|
declare function pipe<T, R>(initialFunction: (arg: T) => R, ...functions: ((arg: R) => R)[]): (initialValue: T) => R;
|
|
@@ -195,30 +360,15 @@ declare function buildAndSignTx(instructions: TransactionInstruction[], payer: S
|
|
|
195
360
|
|
|
196
361
|
declare function sleep(ms: number): Promise<void>;
|
|
197
362
|
|
|
198
|
-
declare const validateSufficientBalance: (balance: BN) => void;
|
|
199
|
-
declare const validateSameOwner: (compressedAccounts: CompressedAccount[] | CompressedAccountWithMerkleContext[]) => void;
|
|
200
|
-
declare const validateNumbersForProof: (hashesLength: number, newAddressesLength: number) => void;
|
|
201
|
-
declare const validateNumbersForInclusionProof: (hashesLength: number) => void;
|
|
202
|
-
declare const validateNumbersForNonInclusionProof: (newAddressesLength: number) => void;
|
|
203
|
-
declare const validateNumbers: (length: number, allowedNumbers: number[], type: string) => void;
|
|
204
|
-
|
|
205
|
-
/**
|
|
206
|
-
* @param targetLamports - Target priority fee in lamports
|
|
207
|
-
* @param computeUnits - Expected compute units used by the transaction
|
|
208
|
-
* @returns microLamports per compute unit (use in
|
|
209
|
-
* `ComputeBudgetProgram.setComputeUnitPrice`)
|
|
210
|
-
*/
|
|
211
|
-
declare function calculateComputeUnitPrice(targetLamports: number, computeUnits: number): number;
|
|
212
|
-
|
|
213
363
|
/**
|
|
214
364
|
* Create two lookup tables storing all public state tree and queue addresses
|
|
215
365
|
* returns lookup table addresses and txId
|
|
216
366
|
*
|
|
217
367
|
* @internal
|
|
218
|
-
* @param connection
|
|
219
|
-
* @param payer
|
|
220
|
-
* @param authority
|
|
221
|
-
* @param recentSlot
|
|
368
|
+
* @param connection Connection to the Solana network
|
|
369
|
+
* @param payer Keypair of the payer
|
|
370
|
+
* @param authority Keypair of the authority
|
|
371
|
+
* @param recentSlot Slot of the recent block
|
|
222
372
|
*/
|
|
223
373
|
declare function createStateTreeLookupTable({ connection, payer, authority, recentSlot, }: {
|
|
224
374
|
connection: Connection;
|
|
@@ -231,14 +381,15 @@ declare function createStateTreeLookupTable({ connection, payer, authority, rece
|
|
|
231
381
|
}>;
|
|
232
382
|
/**
|
|
233
383
|
* Extend state tree lookup table with new state tree and queue addresses
|
|
384
|
+
*
|
|
234
385
|
* @internal
|
|
235
|
-
* @param connection
|
|
236
|
-
* @param tableAddress
|
|
237
|
-
* @param newStateTreeAddresses
|
|
238
|
-
* @param newQueueAddresses
|
|
239
|
-
* @param newCpiContextAddresses
|
|
240
|
-
* @param payer
|
|
241
|
-
* @param authority
|
|
386
|
+
* @param connection Connection to the Solana network
|
|
387
|
+
* @param tableAddress Address of the lookup table to extend
|
|
388
|
+
* @param newStateTreeAddresses Addresses of the new state trees to add
|
|
389
|
+
* @param newQueueAddresses Addresses of the new queues to add
|
|
390
|
+
* @param newCpiContextAddresses Addresses of the new cpi contexts to add
|
|
391
|
+
* @param payer Keypair of the payer
|
|
392
|
+
* @param authority Keypair of the authority
|
|
242
393
|
*/
|
|
243
394
|
declare function extendStateTreeLookupTable({ connection, tableAddress, newStateTreeAddresses, newQueueAddresses, newCpiContextAddresses, payer, authority, }: {
|
|
244
395
|
connection: Connection;
|
|
@@ -255,60 +406,112 @@ declare function extendStateTreeLookupTable({ connection, tableAddress, newState
|
|
|
255
406
|
/**
|
|
256
407
|
* Adds state tree address to lookup table. Acts as nullifier lookup for rolled
|
|
257
408
|
* over state trees.
|
|
409
|
+
*
|
|
258
410
|
* @internal
|
|
259
|
-
* @param connection
|
|
260
|
-
* @param stateTreeAddress
|
|
261
|
-
* @param
|
|
262
|
-
* address in
|
|
263
|
-
* @param stateTreeLookupTableAddress
|
|
264
|
-
*
|
|
265
|
-
* @param payer
|
|
266
|
-
* @param authority
|
|
267
|
-
*/
|
|
268
|
-
declare function nullifyLookupTable({ connection, fullStateTreeAddress,
|
|
411
|
+
* @param connection Connection to the Solana network
|
|
412
|
+
* @param stateTreeAddress Address of the state tree to nullify
|
|
413
|
+
* @param nullifyLookupTableAddress Address of the nullifier lookup table to
|
|
414
|
+
* store address in
|
|
415
|
+
* @param stateTreeLookupTableAddress lookup table storing all state tree
|
|
416
|
+
* addresses
|
|
417
|
+
* @param payer Keypair of the payer
|
|
418
|
+
* @param authority Keypair of the authority
|
|
419
|
+
*/
|
|
420
|
+
declare function nullifyLookupTable({ connection, fullStateTreeAddress, nullifyLookupTableAddress, stateTreeLookupTableAddress, payer, authority, }: {
|
|
269
421
|
connection: Connection;
|
|
270
422
|
fullStateTreeAddress: PublicKey;
|
|
271
|
-
|
|
423
|
+
nullifyLookupTableAddress: PublicKey;
|
|
272
424
|
stateTreeLookupTableAddress: PublicKey;
|
|
273
425
|
payer: Keypair;
|
|
274
426
|
authority: Keypair;
|
|
275
427
|
}): Promise<{
|
|
276
428
|
txId: string;
|
|
277
429
|
}>;
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
declare
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
nullifyTableAddress: PublicKey;
|
|
286
|
-
}): Promise<ActiveTreeBundle[]>;
|
|
430
|
+
|
|
431
|
+
declare const validateSufficientBalance: (balance: BN) => void;
|
|
432
|
+
declare const validateSameOwner: (compressedAccounts: CompressedAccount[] | CompressedAccountWithMerkleContext[]) => void;
|
|
433
|
+
declare const validateNumbersForProof: (hashesLength: number, newAddressesLength: number) => void;
|
|
434
|
+
declare const validateNumbersForInclusionProof: (hashesLength: number) => void;
|
|
435
|
+
declare const validateNumbersForNonInclusionProof: (newAddressesLength: number) => void;
|
|
436
|
+
declare const validateNumbers: (length: number, allowedNumbers: number[], type: string) => void;
|
|
287
437
|
|
|
288
438
|
declare enum TreeType {
|
|
289
439
|
/**
|
|
290
440
|
* v1 state merkle tree
|
|
291
441
|
*/
|
|
292
|
-
|
|
442
|
+
StateV1 = 1,
|
|
293
443
|
/**
|
|
294
444
|
* v1 address merkle tree
|
|
295
445
|
*/
|
|
296
|
-
|
|
446
|
+
AddressV1 = 2,
|
|
297
447
|
/**
|
|
298
448
|
* v2 state merkle tree
|
|
299
449
|
*/
|
|
300
|
-
|
|
450
|
+
StateV2 = 3,
|
|
301
451
|
/**
|
|
302
452
|
* v2 address merkle tree
|
|
303
453
|
*/
|
|
304
|
-
|
|
454
|
+
AddressV2 = 4
|
|
305
455
|
}
|
|
456
|
+
/**
|
|
457
|
+
* @deprecated Use {@link StateTreeInfo} instead.
|
|
458
|
+
*
|
|
459
|
+
* A bundle of active trees for a given tree type.
|
|
460
|
+
*/
|
|
306
461
|
type ActiveTreeBundle = {
|
|
307
462
|
tree: PublicKey;
|
|
308
463
|
queue: PublicKey | null;
|
|
309
464
|
cpiContext: PublicKey | null;
|
|
310
465
|
treeType: TreeType;
|
|
311
466
|
};
|
|
467
|
+
/**
|
|
468
|
+
* State tree info, versioned via {@link TreeType}. The protocol
|
|
469
|
+
* stores compressed accounts in state trees.
|
|
470
|
+
*
|
|
471
|
+
* Onchain Accounts are subject to Solana's write-lock limits.
|
|
472
|
+
*
|
|
473
|
+
* To load balance transactions, use {@link selectStateTreeInfo} to
|
|
474
|
+
* select a random tree from a range of active trees.
|
|
475
|
+
*
|
|
476
|
+
* Example:
|
|
477
|
+
* ```typescript
|
|
478
|
+
* const infos = await rpc.getStateTreeInfos();
|
|
479
|
+
* const info = selectStateTreeInfo(infos);
|
|
480
|
+
* const ix = await CompressedTokenProgram.compress({
|
|
481
|
+
* // ...
|
|
482
|
+
* outputStateTreeInfo: info
|
|
483
|
+
* });
|
|
484
|
+
* ```
|
|
485
|
+
*/
|
|
486
|
+
type StateTreeInfo = {
|
|
487
|
+
/**
|
|
488
|
+
* Pubkey of the tree account.
|
|
489
|
+
*/
|
|
490
|
+
tree: PublicKey;
|
|
491
|
+
/**
|
|
492
|
+
* Pubkey of the queue account associated with the tree.
|
|
493
|
+
*/
|
|
494
|
+
queue: PublicKey;
|
|
495
|
+
/**
|
|
496
|
+
* The type of tree. One of {@link TreeType}.
|
|
497
|
+
*/
|
|
498
|
+
treeType: TreeType;
|
|
499
|
+
/**
|
|
500
|
+
* Optional compressed cpi context account.
|
|
501
|
+
*/
|
|
502
|
+
cpiContext?: PublicKey;
|
|
503
|
+
/**
|
|
504
|
+
* Optional next tree info if the tree is full.
|
|
505
|
+
*/
|
|
506
|
+
nextTreeInfo: StateTreeInfo | null;
|
|
507
|
+
};
|
|
508
|
+
/**
|
|
509
|
+
* Address tree info, versioned via {@link TreeType}. The protocol
|
|
510
|
+
* stores PDAs in address trees.
|
|
511
|
+
*/
|
|
512
|
+
type AddressTreeInfo = Omit<StateTreeInfo, 'cpiContext' | 'nextTreeInfo'> & {
|
|
513
|
+
nextTreeInfo: AddressTreeInfo | null;
|
|
514
|
+
};
|
|
312
515
|
interface PackedCompressedAccountWithMerkleContext {
|
|
313
516
|
compressedAccount: CompressedAccount;
|
|
314
517
|
merkleContext: PackedMerkleContext;
|
|
@@ -330,22 +533,27 @@ interface QueueIndex {
|
|
|
330
533
|
* compressed account.
|
|
331
534
|
* */
|
|
332
535
|
interface CompressedAccount {
|
|
333
|
-
/**
|
|
536
|
+
/**
|
|
537
|
+
* Public key of program or user owning the account.
|
|
538
|
+
*/
|
|
334
539
|
owner: PublicKey;
|
|
335
|
-
/**
|
|
540
|
+
/**
|
|
541
|
+
* Lamports attached to the account.
|
|
542
|
+
*/
|
|
336
543
|
lamports: BN;
|
|
337
544
|
/**
|
|
338
|
-
*
|
|
339
|
-
* transactions.
|
|
545
|
+
* Optional unique account ID that is persistent across transactions.
|
|
340
546
|
*/
|
|
341
547
|
address: number[] | null;
|
|
342
|
-
/**
|
|
548
|
+
/**
|
|
549
|
+
* Optional data attached to the account.
|
|
550
|
+
*/
|
|
343
551
|
data: CompressedAccountData | null;
|
|
344
552
|
}
|
|
345
553
|
/**
|
|
346
554
|
* Describe the generic compressed account details applicable to every
|
|
347
555
|
* compressed account.
|
|
348
|
-
|
|
556
|
+
*/
|
|
349
557
|
interface OutputCompressedAccountWithPackedContext {
|
|
350
558
|
compressedAccount: CompressedAccount;
|
|
351
559
|
merkleTreeIndex: number;
|
|
@@ -372,7 +580,7 @@ interface PublicTransactionEvent {
|
|
|
372
580
|
message: Uint8Array | null;
|
|
373
581
|
}
|
|
374
582
|
interface InstructionDataInvoke {
|
|
375
|
-
proof:
|
|
583
|
+
proof: ValidityProof | null;
|
|
376
584
|
inputCompressedAccountsWithMerkleContext: PackedCompressedAccountWithMerkleContext[];
|
|
377
585
|
outputCompressedAccounts: OutputCompressedAccountWithPackedContext[];
|
|
378
586
|
relayFee: BN | null;
|
|
@@ -381,7 +589,7 @@ interface InstructionDataInvoke {
|
|
|
381
589
|
isCompress: boolean;
|
|
382
590
|
}
|
|
383
591
|
interface InstructionDataInvokeCpi {
|
|
384
|
-
proof:
|
|
592
|
+
proof: ValidityProof | null;
|
|
385
593
|
inputCompressedAccountsWithMerkleContext: PackedCompressedAccountWithMerkleContext[];
|
|
386
594
|
outputCompressedAccounts: OutputCompressedAccountWithPackedContext[];
|
|
387
595
|
relayFee: BN | null;
|
|
@@ -395,11 +603,28 @@ interface CompressedCpiContext {
|
|
|
395
603
|
first_set_context: boolean;
|
|
396
604
|
cpi_context_account_index: number;
|
|
397
605
|
}
|
|
606
|
+
/**
|
|
607
|
+
* @deprecated Use {@link ValidityProof} instead.
|
|
608
|
+
*/
|
|
398
609
|
interface CompressedProof {
|
|
399
610
|
a: number[];
|
|
400
611
|
b: number[];
|
|
401
612
|
c: number[];
|
|
402
613
|
}
|
|
614
|
+
/**
|
|
615
|
+
* Validity proof.
|
|
616
|
+
*
|
|
617
|
+
* You can request proofs via `rpc.getValidityProof` or
|
|
618
|
+
* `rpc.getValidityProofV0`.
|
|
619
|
+
*
|
|
620
|
+
* One proof is 128 bytes large, and can prove the existence of N compressed
|
|
621
|
+
* accounts or the uniqueness of N PDAs.
|
|
622
|
+
*/
|
|
623
|
+
interface ValidityProof {
|
|
624
|
+
a: number[];
|
|
625
|
+
b: number[];
|
|
626
|
+
c: number[];
|
|
627
|
+
}
|
|
403
628
|
interface InputTokenDataWithContext {
|
|
404
629
|
amount: BN;
|
|
405
630
|
delegateIndex: number | null;
|
|
@@ -421,29 +646,69 @@ type CompressedAccountWithMerkleContext = CompressedAccount & MerkleContext & {
|
|
|
421
646
|
readOnly: boolean;
|
|
422
647
|
};
|
|
423
648
|
/**
|
|
424
|
-
*
|
|
425
|
-
*
|
|
426
|
-
|
|
427
|
-
|
|
649
|
+
* @deprecated use {@link MerkleContext} instead.
|
|
650
|
+
*
|
|
651
|
+
* Legacy MerkleContext
|
|
652
|
+
*/
|
|
653
|
+
type MerkleContextLegacy = {
|
|
654
|
+
/**
|
|
655
|
+
* State tree
|
|
656
|
+
*/
|
|
428
657
|
merkleTree: PublicKey;
|
|
429
|
-
/**
|
|
658
|
+
/**
|
|
659
|
+
* Nullifier queue
|
|
660
|
+
*/
|
|
430
661
|
nullifierQueue: PublicKey;
|
|
431
|
-
/**
|
|
662
|
+
/**
|
|
663
|
+
* Poseidon hash of the account. Stored as leaf in state tree
|
|
664
|
+
*/
|
|
432
665
|
hash: number[];
|
|
433
|
-
/**
|
|
666
|
+
/**
|
|
667
|
+
* Position of `hash` in the State tree
|
|
668
|
+
*/
|
|
434
669
|
leafIndex: number;
|
|
435
670
|
};
|
|
671
|
+
/**
|
|
672
|
+
* Context for compressed account stored in a state tree
|
|
673
|
+
*/
|
|
674
|
+
type MerkleContext = {
|
|
675
|
+
/**
|
|
676
|
+
* Tree info
|
|
677
|
+
*/
|
|
678
|
+
treeInfo: StateTreeInfo;
|
|
679
|
+
/**
|
|
680
|
+
* Poseidon hash of the account. Stored as leaf in state tree
|
|
681
|
+
*/
|
|
682
|
+
hash: BN;
|
|
683
|
+
/**
|
|
684
|
+
* Position of `hash` in the State tree
|
|
685
|
+
*/
|
|
686
|
+
leafIndex: number;
|
|
687
|
+
/**
|
|
688
|
+
* Whether the account can be proven by index or by merkle proof
|
|
689
|
+
*/
|
|
690
|
+
proveByIndex: boolean;
|
|
691
|
+
};
|
|
692
|
+
/**
|
|
693
|
+
* MerkleContext with merkle proof
|
|
694
|
+
*/
|
|
436
695
|
type MerkleContextWithMerkleProof = MerkleContext & {
|
|
437
|
-
/**
|
|
696
|
+
/**
|
|
697
|
+
* Recent valid 'hash' proof path, expires after n slots
|
|
698
|
+
*/
|
|
438
699
|
merkleProof: BN254[];
|
|
439
|
-
/**
|
|
700
|
+
/**
|
|
701
|
+
* Index of state root the merkleproof is valid for, expires after n slots
|
|
702
|
+
*/
|
|
440
703
|
rootIndex: number;
|
|
441
|
-
/**
|
|
704
|
+
/**
|
|
705
|
+
* Current root
|
|
706
|
+
*/
|
|
442
707
|
root: BN254;
|
|
443
708
|
};
|
|
444
709
|
declare const createCompressedAccount: (owner: PublicKey, lamports?: BN, data?: CompressedAccountData, address?: number[]) => CompressedAccount;
|
|
445
710
|
declare const createCompressedAccountWithMerkleContext: (merkleContext: MerkleContext, owner: PublicKey, lamports?: BN, data?: CompressedAccountData, address?: number[]) => CompressedAccountWithMerkleContext;
|
|
446
|
-
declare const createMerkleContext: (
|
|
711
|
+
declare const createMerkleContext: (treeInfo: StateTreeInfo, hash: BN254, leafIndex: number, proveByIndex?: boolean) => MerkleContext;
|
|
447
712
|
|
|
448
713
|
interface LatestNonVotingSignatures {
|
|
449
714
|
context: {
|
|
@@ -486,6 +751,19 @@ interface SignatureWithMetadata {
|
|
|
486
751
|
signature: string;
|
|
487
752
|
slot: number;
|
|
488
753
|
}
|
|
754
|
+
/**
|
|
755
|
+
* Account hash and associated state tree info.
|
|
756
|
+
*/
|
|
757
|
+
interface HashWithTreeInfo {
|
|
758
|
+
/**
|
|
759
|
+
* Account hash.
|
|
760
|
+
*/
|
|
761
|
+
hash: BN254;
|
|
762
|
+
/**
|
|
763
|
+
* State tree info.
|
|
764
|
+
*/
|
|
765
|
+
stateTreeInfo: StateTreeInfo;
|
|
766
|
+
}
|
|
489
767
|
interface HashWithTree {
|
|
490
768
|
hash: BN254;
|
|
491
769
|
tree: PublicKey;
|
|
@@ -496,6 +774,23 @@ interface AddressWithTree {
|
|
|
496
774
|
tree: PublicKey;
|
|
497
775
|
queue: PublicKey;
|
|
498
776
|
}
|
|
777
|
+
/**
|
|
778
|
+
* Address and associated address tree info.
|
|
779
|
+
*/
|
|
780
|
+
interface AddressWithTreeInfo {
|
|
781
|
+
/**
|
|
782
|
+
* Address.
|
|
783
|
+
*/
|
|
784
|
+
address: BN254;
|
|
785
|
+
/**
|
|
786
|
+
* Address tree info.
|
|
787
|
+
*/
|
|
788
|
+
addressTreeInfo: AddressTreeInfo;
|
|
789
|
+
}
|
|
790
|
+
interface AddressWithTreeInfo {
|
|
791
|
+
address: BN254;
|
|
792
|
+
treeInfo: AddressTreeInfo;
|
|
793
|
+
}
|
|
499
794
|
interface CompressedTransaction {
|
|
500
795
|
compressionInfo: {
|
|
501
796
|
closedAccounts: {
|
|
@@ -528,6 +823,41 @@ interface HexInputsForProver {
|
|
|
528
823
|
pathElements: string[];
|
|
529
824
|
leaf: string;
|
|
530
825
|
}
|
|
826
|
+
/**
|
|
827
|
+
* Validity proof with context.
|
|
828
|
+
*
|
|
829
|
+
* You can request proofs via `rpc.getValidityProof` or
|
|
830
|
+
* `rpc.getValidityProofV0`.
|
|
831
|
+
*/
|
|
832
|
+
type ValidityProofWithContext = {
|
|
833
|
+
/**
|
|
834
|
+
* Validity proof.
|
|
835
|
+
*/
|
|
836
|
+
compressedProof: ValidityProof;
|
|
837
|
+
/**
|
|
838
|
+
* Roots.
|
|
839
|
+
*/
|
|
840
|
+
roots: BN[];
|
|
841
|
+
/**
|
|
842
|
+
* Root indices.
|
|
843
|
+
*/
|
|
844
|
+
rootIndices: number[];
|
|
845
|
+
/**
|
|
846
|
+
* Leaf indices.
|
|
847
|
+
*/
|
|
848
|
+
leafIndices: number[];
|
|
849
|
+
/**
|
|
850
|
+
* Leaves.
|
|
851
|
+
*/
|
|
852
|
+
leaves: BN[];
|
|
853
|
+
/**
|
|
854
|
+
* Tree infos.
|
|
855
|
+
*/
|
|
856
|
+
treeInfos: StateTreeInfo[];
|
|
857
|
+
};
|
|
858
|
+
/**
|
|
859
|
+
* @deprecated use {@link ValidityProofWithContext} instead
|
|
860
|
+
*/
|
|
531
861
|
type CompressedProofWithContext = {
|
|
532
862
|
compressedProof: CompressedProof;
|
|
533
863
|
roots: BN[];
|
|
@@ -606,6 +936,8 @@ declare function jsonRpcResultAndContext<T, U>(value: Struct<T, U>): Struct<RpcR
|
|
|
606
936
|
* @internal
|
|
607
937
|
*/
|
|
608
938
|
declare const CompressedAccountResult: Struct<{
|
|
939
|
+
lamports: BN;
|
|
940
|
+
tree: PublicKey;
|
|
609
941
|
data: {
|
|
610
942
|
data: string;
|
|
611
943
|
dataHash: BN;
|
|
@@ -613,10 +945,8 @@ declare const CompressedAccountResult: Struct<{
|
|
|
613
945
|
} | null;
|
|
614
946
|
address: number[] | null;
|
|
615
947
|
hash: BN;
|
|
616
|
-
lamports: BN;
|
|
617
948
|
owner: PublicKey;
|
|
618
949
|
leafIndex: number;
|
|
619
|
-
tree: PublicKey;
|
|
620
950
|
seq: BN | null;
|
|
621
951
|
slotCreated: BN;
|
|
622
952
|
}, {
|
|
@@ -663,6 +993,8 @@ declare const CompressedTokenAccountResult: Struct<{
|
|
|
663
993
|
state: string;
|
|
664
994
|
};
|
|
665
995
|
account: {
|
|
996
|
+
lamports: BN;
|
|
997
|
+
tree: PublicKey;
|
|
666
998
|
data: {
|
|
667
999
|
data: string;
|
|
668
1000
|
dataHash: BN;
|
|
@@ -670,10 +1002,8 @@ declare const CompressedTokenAccountResult: Struct<{
|
|
|
670
1002
|
} | null;
|
|
671
1003
|
address: number[] | null;
|
|
672
1004
|
hash: BN;
|
|
673
|
-
lamports: BN;
|
|
674
1005
|
owner: PublicKey;
|
|
675
1006
|
leafIndex: number;
|
|
676
|
-
tree: PublicKey;
|
|
677
1007
|
seq: BN | null;
|
|
678
1008
|
slotCreated: BN;
|
|
679
1009
|
};
|
|
@@ -692,6 +1022,8 @@ declare const CompressedTokenAccountResult: Struct<{
|
|
|
692
1022
|
state: Struct<string, null>;
|
|
693
1023
|
}>;
|
|
694
1024
|
account: Struct<{
|
|
1025
|
+
lamports: BN;
|
|
1026
|
+
tree: PublicKey;
|
|
695
1027
|
data: {
|
|
696
1028
|
data: string;
|
|
697
1029
|
dataHash: BN;
|
|
@@ -699,10 +1031,8 @@ declare const CompressedTokenAccountResult: Struct<{
|
|
|
699
1031
|
} | null;
|
|
700
1032
|
address: number[] | null;
|
|
701
1033
|
hash: BN;
|
|
702
|
-
lamports: BN;
|
|
703
1034
|
owner: PublicKey;
|
|
704
1035
|
leafIndex: number;
|
|
705
|
-
tree: PublicKey;
|
|
706
1036
|
seq: BN | null;
|
|
707
1037
|
slotCreated: BN;
|
|
708
1038
|
}, {
|
|
@@ -730,6 +1060,8 @@ declare const CompressedTokenAccountResult: Struct<{
|
|
|
730
1060
|
*/
|
|
731
1061
|
declare const MultipleCompressedAccountsResult: Struct<{
|
|
732
1062
|
items: {
|
|
1063
|
+
lamports: BN;
|
|
1064
|
+
tree: PublicKey;
|
|
733
1065
|
data: {
|
|
734
1066
|
data: string;
|
|
735
1067
|
dataHash: BN;
|
|
@@ -737,15 +1069,15 @@ declare const MultipleCompressedAccountsResult: Struct<{
|
|
|
737
1069
|
} | null;
|
|
738
1070
|
address: number[] | null;
|
|
739
1071
|
hash: BN;
|
|
740
|
-
lamports: BN;
|
|
741
1072
|
owner: PublicKey;
|
|
742
1073
|
leafIndex: number;
|
|
743
|
-
tree: PublicKey;
|
|
744
1074
|
seq: BN | null;
|
|
745
1075
|
slotCreated: BN;
|
|
746
1076
|
}[];
|
|
747
1077
|
}, {
|
|
748
1078
|
items: Struct<{
|
|
1079
|
+
lamports: BN;
|
|
1080
|
+
tree: PublicKey;
|
|
749
1081
|
data: {
|
|
750
1082
|
data: string;
|
|
751
1083
|
dataHash: BN;
|
|
@@ -753,13 +1085,13 @@ declare const MultipleCompressedAccountsResult: Struct<{
|
|
|
753
1085
|
} | null;
|
|
754
1086
|
address: number[] | null;
|
|
755
1087
|
hash: BN;
|
|
756
|
-
lamports: BN;
|
|
757
1088
|
owner: PublicKey;
|
|
758
1089
|
leafIndex: number;
|
|
759
|
-
tree: PublicKey;
|
|
760
1090
|
seq: BN | null;
|
|
761
1091
|
slotCreated: BN;
|
|
762
1092
|
}[], Struct<{
|
|
1093
|
+
lamports: BN;
|
|
1094
|
+
tree: PublicKey;
|
|
763
1095
|
data: {
|
|
764
1096
|
data: string;
|
|
765
1097
|
dataHash: BN;
|
|
@@ -767,10 +1099,8 @@ declare const MultipleCompressedAccountsResult: Struct<{
|
|
|
767
1099
|
} | null;
|
|
768
1100
|
address: number[] | null;
|
|
769
1101
|
hash: BN;
|
|
770
|
-
lamports: BN;
|
|
771
1102
|
owner: PublicKey;
|
|
772
1103
|
leafIndex: number;
|
|
773
|
-
tree: PublicKey;
|
|
774
1104
|
seq: BN | null;
|
|
775
1105
|
slotCreated: BN;
|
|
776
1106
|
}, {
|
|
@@ -798,6 +1128,8 @@ declare const MultipleCompressedAccountsResult: Struct<{
|
|
|
798
1128
|
*/
|
|
799
1129
|
declare const CompressedAccountsByOwnerResult: Struct<{
|
|
800
1130
|
items: {
|
|
1131
|
+
lamports: BN;
|
|
1132
|
+
tree: PublicKey;
|
|
801
1133
|
data: {
|
|
802
1134
|
data: string;
|
|
803
1135
|
dataHash: BN;
|
|
@@ -805,16 +1137,16 @@ declare const CompressedAccountsByOwnerResult: Struct<{
|
|
|
805
1137
|
} | null;
|
|
806
1138
|
address: number[] | null;
|
|
807
1139
|
hash: BN;
|
|
808
|
-
lamports: BN;
|
|
809
1140
|
owner: PublicKey;
|
|
810
1141
|
leafIndex: number;
|
|
811
|
-
tree: PublicKey;
|
|
812
1142
|
seq: BN | null;
|
|
813
1143
|
slotCreated: BN;
|
|
814
1144
|
}[];
|
|
815
1145
|
cursor: string | null;
|
|
816
1146
|
}, {
|
|
817
1147
|
items: Struct<{
|
|
1148
|
+
lamports: BN;
|
|
1149
|
+
tree: PublicKey;
|
|
818
1150
|
data: {
|
|
819
1151
|
data: string;
|
|
820
1152
|
dataHash: BN;
|
|
@@ -822,13 +1154,13 @@ declare const CompressedAccountsByOwnerResult: Struct<{
|
|
|
822
1154
|
} | null;
|
|
823
1155
|
address: number[] | null;
|
|
824
1156
|
hash: BN;
|
|
825
|
-
lamports: BN;
|
|
826
1157
|
owner: PublicKey;
|
|
827
1158
|
leafIndex: number;
|
|
828
|
-
tree: PublicKey;
|
|
829
1159
|
seq: BN | null;
|
|
830
1160
|
slotCreated: BN;
|
|
831
1161
|
}[], Struct<{
|
|
1162
|
+
lamports: BN;
|
|
1163
|
+
tree: PublicKey;
|
|
832
1164
|
data: {
|
|
833
1165
|
data: string;
|
|
834
1166
|
dataHash: BN;
|
|
@@ -836,10 +1168,8 @@ declare const CompressedAccountsByOwnerResult: Struct<{
|
|
|
836
1168
|
} | null;
|
|
837
1169
|
address: number[] | null;
|
|
838
1170
|
hash: BN;
|
|
839
|
-
lamports: BN;
|
|
840
1171
|
owner: PublicKey;
|
|
841
1172
|
leafIndex: number;
|
|
842
|
-
tree: PublicKey;
|
|
843
1173
|
seq: BN | null;
|
|
844
1174
|
slotCreated: BN;
|
|
845
1175
|
}, {
|
|
@@ -876,6 +1206,8 @@ declare const CompressedTokenAccountsByOwnerOrDelegateResult: Struct<{
|
|
|
876
1206
|
state: string;
|
|
877
1207
|
};
|
|
878
1208
|
account: {
|
|
1209
|
+
lamports: BN;
|
|
1210
|
+
tree: PublicKey;
|
|
879
1211
|
data: {
|
|
880
1212
|
data: string;
|
|
881
1213
|
dataHash: BN;
|
|
@@ -883,10 +1215,8 @@ declare const CompressedTokenAccountsByOwnerOrDelegateResult: Struct<{
|
|
|
883
1215
|
} | null;
|
|
884
1216
|
address: number[] | null;
|
|
885
1217
|
hash: BN;
|
|
886
|
-
lamports: BN;
|
|
887
1218
|
owner: PublicKey;
|
|
888
1219
|
leafIndex: number;
|
|
889
|
-
tree: PublicKey;
|
|
890
1220
|
seq: BN | null;
|
|
891
1221
|
slotCreated: BN;
|
|
892
1222
|
};
|
|
@@ -902,6 +1232,8 @@ declare const CompressedTokenAccountsByOwnerOrDelegateResult: Struct<{
|
|
|
902
1232
|
state: string;
|
|
903
1233
|
};
|
|
904
1234
|
account: {
|
|
1235
|
+
lamports: BN;
|
|
1236
|
+
tree: PublicKey;
|
|
905
1237
|
data: {
|
|
906
1238
|
data: string;
|
|
907
1239
|
dataHash: BN;
|
|
@@ -909,10 +1241,8 @@ declare const CompressedTokenAccountsByOwnerOrDelegateResult: Struct<{
|
|
|
909
1241
|
} | null;
|
|
910
1242
|
address: number[] | null;
|
|
911
1243
|
hash: BN;
|
|
912
|
-
lamports: BN;
|
|
913
1244
|
owner: PublicKey;
|
|
914
1245
|
leafIndex: number;
|
|
915
|
-
tree: PublicKey;
|
|
916
1246
|
seq: BN | null;
|
|
917
1247
|
slotCreated: BN;
|
|
918
1248
|
};
|
|
@@ -925,6 +1255,8 @@ declare const CompressedTokenAccountsByOwnerOrDelegateResult: Struct<{
|
|
|
925
1255
|
state: string;
|
|
926
1256
|
};
|
|
927
1257
|
account: {
|
|
1258
|
+
lamports: BN;
|
|
1259
|
+
tree: PublicKey;
|
|
928
1260
|
data: {
|
|
929
1261
|
data: string;
|
|
930
1262
|
dataHash: BN;
|
|
@@ -932,10 +1264,8 @@ declare const CompressedTokenAccountsByOwnerOrDelegateResult: Struct<{
|
|
|
932
1264
|
} | null;
|
|
933
1265
|
address: number[] | null;
|
|
934
1266
|
hash: BN;
|
|
935
|
-
lamports: BN;
|
|
936
1267
|
owner: PublicKey;
|
|
937
1268
|
leafIndex: number;
|
|
938
|
-
tree: PublicKey;
|
|
939
1269
|
seq: BN | null;
|
|
940
1270
|
slotCreated: BN;
|
|
941
1271
|
};
|
|
@@ -954,6 +1284,8 @@ declare const CompressedTokenAccountsByOwnerOrDelegateResult: Struct<{
|
|
|
954
1284
|
state: Struct<string, null>;
|
|
955
1285
|
}>;
|
|
956
1286
|
account: Struct<{
|
|
1287
|
+
lamports: BN;
|
|
1288
|
+
tree: PublicKey;
|
|
957
1289
|
data: {
|
|
958
1290
|
data: string;
|
|
959
1291
|
dataHash: BN;
|
|
@@ -961,10 +1293,8 @@ declare const CompressedTokenAccountsByOwnerOrDelegateResult: Struct<{
|
|
|
961
1293
|
} | null;
|
|
962
1294
|
address: number[] | null;
|
|
963
1295
|
hash: BN;
|
|
964
|
-
lamports: BN;
|
|
965
1296
|
owner: PublicKey;
|
|
966
1297
|
leafIndex: number;
|
|
967
|
-
tree: PublicKey;
|
|
968
1298
|
seq: BN | null;
|
|
969
1299
|
slotCreated: BN;
|
|
970
1300
|
}, {
|
|
@@ -1002,21 +1332,21 @@ declare const HealthResult: Struct<string, null>;
|
|
|
1002
1332
|
*/
|
|
1003
1333
|
declare const LatestNonVotingSignaturesResult: Struct<{
|
|
1004
1334
|
items: {
|
|
1335
|
+
signature: string;
|
|
1005
1336
|
error: string | null;
|
|
1006
1337
|
slot: number;
|
|
1007
|
-
signature: string;
|
|
1008
1338
|
blockTime: number;
|
|
1009
1339
|
}[];
|
|
1010
1340
|
}, {
|
|
1011
1341
|
items: Struct<{
|
|
1342
|
+
signature: string;
|
|
1012
1343
|
error: string | null;
|
|
1013
1344
|
slot: number;
|
|
1014
|
-
signature: string;
|
|
1015
1345
|
blockTime: number;
|
|
1016
1346
|
}[], Struct<{
|
|
1347
|
+
signature: string;
|
|
1017
1348
|
error: string | null;
|
|
1018
1349
|
slot: number;
|
|
1019
|
-
signature: string;
|
|
1020
1350
|
blockTime: number;
|
|
1021
1351
|
}, {
|
|
1022
1352
|
signature: Struct<string, null>;
|
|
@@ -1030,19 +1360,19 @@ declare const LatestNonVotingSignaturesResult: Struct<{
|
|
|
1030
1360
|
*/
|
|
1031
1361
|
declare const LatestNonVotingSignaturesResultPaginated: Struct<{
|
|
1032
1362
|
items: {
|
|
1033
|
-
slot: number;
|
|
1034
1363
|
signature: string;
|
|
1364
|
+
slot: number;
|
|
1035
1365
|
blockTime: number;
|
|
1036
1366
|
}[];
|
|
1037
1367
|
cursor: string | null;
|
|
1038
1368
|
}, {
|
|
1039
1369
|
items: Struct<{
|
|
1040
|
-
slot: number;
|
|
1041
1370
|
signature: string;
|
|
1371
|
+
slot: number;
|
|
1042
1372
|
blockTime: number;
|
|
1043
1373
|
}[], Struct<{
|
|
1044
|
-
slot: number;
|
|
1045
1374
|
signature: string;
|
|
1375
|
+
slot: number;
|
|
1046
1376
|
blockTime: number;
|
|
1047
1377
|
}, {
|
|
1048
1378
|
signature: Struct<string, null>;
|
|
@@ -1055,12 +1385,12 @@ declare const LatestNonVotingSignaturesResultPaginated: Struct<{
|
|
|
1055
1385
|
* @internal
|
|
1056
1386
|
*/
|
|
1057
1387
|
declare const MerkeProofResult: Struct<{
|
|
1388
|
+
root: BN;
|
|
1058
1389
|
hash: BN;
|
|
1059
1390
|
leafIndex: number;
|
|
1060
1391
|
merkleTree: PublicKey;
|
|
1061
1392
|
proof: BN[];
|
|
1062
1393
|
rootSeq: number;
|
|
1063
|
-
root: BN;
|
|
1064
1394
|
}, {
|
|
1065
1395
|
hash: Struct<BN, null>;
|
|
1066
1396
|
leafIndex: Struct<number, null>;
|
|
@@ -1073,11 +1403,11 @@ declare const MerkeProofResult: Struct<{
|
|
|
1073
1403
|
* @internal
|
|
1074
1404
|
*/
|
|
1075
1405
|
declare const NewAddressProofResult: Struct<{
|
|
1406
|
+
root: BN;
|
|
1076
1407
|
address: BN;
|
|
1077
1408
|
merkleTree: PublicKey;
|
|
1078
1409
|
proof: BN[];
|
|
1079
1410
|
rootSeq: number;
|
|
1080
|
-
root: BN;
|
|
1081
1411
|
nextIndex: number;
|
|
1082
1412
|
lowerRangeAddress: BN;
|
|
1083
1413
|
higherRangeAddress: BN;
|
|
@@ -1127,19 +1457,19 @@ declare const ValidityProofResult: Struct<{
|
|
|
1127
1457
|
* @internal
|
|
1128
1458
|
*/
|
|
1129
1459
|
declare const MultipleMerkleProofsResult: Struct<{
|
|
1460
|
+
root: BN;
|
|
1130
1461
|
hash: BN;
|
|
1131
1462
|
leafIndex: number;
|
|
1132
1463
|
merkleTree: PublicKey;
|
|
1133
1464
|
proof: BN[];
|
|
1134
1465
|
rootSeq: number;
|
|
1135
|
-
root: BN;
|
|
1136
1466
|
}[], Struct<{
|
|
1467
|
+
root: BN;
|
|
1137
1468
|
hash: BN;
|
|
1138
1469
|
leafIndex: number;
|
|
1139
1470
|
merkleTree: PublicKey;
|
|
1140
1471
|
proof: BN[];
|
|
1141
1472
|
rootSeq: number;
|
|
1142
|
-
root: BN;
|
|
1143
1473
|
}, {
|
|
1144
1474
|
hash: Struct<BN, null>;
|
|
1145
1475
|
leafIndex: Struct<number, null>;
|
|
@@ -1222,9 +1552,9 @@ declare const CompressedMintTokenHoldersResult: Struct<{
|
|
|
1222
1552
|
}>>;
|
|
1223
1553
|
}>;
|
|
1224
1554
|
declare const AccountProofResult: Struct<{
|
|
1555
|
+
root: number[];
|
|
1225
1556
|
hash: number[];
|
|
1226
1557
|
proof: number[][];
|
|
1227
|
-
root: number[];
|
|
1228
1558
|
}, {
|
|
1229
1559
|
hash: Struct<number[], Struct<number, null>>;
|
|
1230
1560
|
root: Struct<number[], Struct<number, null>>;
|
|
@@ -1233,18 +1563,18 @@ declare const AccountProofResult: Struct<{
|
|
|
1233
1563
|
declare const toUnixTimestamp: (blockTime: string) => number;
|
|
1234
1564
|
declare const SignatureListResult: Struct<{
|
|
1235
1565
|
items: {
|
|
1236
|
-
slot: number;
|
|
1237
1566
|
signature: string;
|
|
1567
|
+
slot: number;
|
|
1238
1568
|
blockTime: number;
|
|
1239
1569
|
}[];
|
|
1240
1570
|
}, {
|
|
1241
1571
|
items: Struct<{
|
|
1242
|
-
slot: number;
|
|
1243
1572
|
signature: string;
|
|
1573
|
+
slot: number;
|
|
1244
1574
|
blockTime: number;
|
|
1245
1575
|
}[], Struct<{
|
|
1246
|
-
slot: number;
|
|
1247
1576
|
signature: string;
|
|
1577
|
+
slot: number;
|
|
1248
1578
|
blockTime: number;
|
|
1249
1579
|
}, {
|
|
1250
1580
|
blockTime: Struct<number, null>;
|
|
@@ -1254,19 +1584,19 @@ declare const SignatureListResult: Struct<{
|
|
|
1254
1584
|
}>;
|
|
1255
1585
|
declare const SignatureListWithCursorResult: Struct<{
|
|
1256
1586
|
items: {
|
|
1257
|
-
slot: number;
|
|
1258
1587
|
signature: string;
|
|
1588
|
+
slot: number;
|
|
1259
1589
|
blockTime: number;
|
|
1260
1590
|
}[];
|
|
1261
1591
|
cursor: string | null;
|
|
1262
1592
|
}, {
|
|
1263
1593
|
items: Struct<{
|
|
1264
|
-
slot: number;
|
|
1265
1594
|
signature: string;
|
|
1595
|
+
slot: number;
|
|
1266
1596
|
blockTime: number;
|
|
1267
1597
|
}[], Struct<{
|
|
1268
|
-
slot: number;
|
|
1269
1598
|
signature: string;
|
|
1599
|
+
slot: number;
|
|
1270
1600
|
blockTime: number;
|
|
1271
1601
|
}, {
|
|
1272
1602
|
blockTime: Struct<number, null>;
|
|
@@ -1279,6 +1609,8 @@ declare const CompressedTransactionResult: Struct<{
|
|
|
1279
1609
|
compressionInfo: {
|
|
1280
1610
|
closedAccounts: {
|
|
1281
1611
|
account: {
|
|
1612
|
+
lamports: BN;
|
|
1613
|
+
tree: PublicKey;
|
|
1282
1614
|
data: {
|
|
1283
1615
|
data: string;
|
|
1284
1616
|
dataHash: BN;
|
|
@@ -1286,10 +1618,8 @@ declare const CompressedTransactionResult: Struct<{
|
|
|
1286
1618
|
} | null;
|
|
1287
1619
|
address: number[] | null;
|
|
1288
1620
|
hash: BN;
|
|
1289
|
-
lamports: BN;
|
|
1290
1621
|
owner: PublicKey;
|
|
1291
1622
|
leafIndex: number;
|
|
1292
|
-
tree: PublicKey;
|
|
1293
1623
|
seq: BN | null;
|
|
1294
1624
|
slotCreated: BN;
|
|
1295
1625
|
};
|
|
@@ -1303,6 +1633,8 @@ declare const CompressedTransactionResult: Struct<{
|
|
|
1303
1633
|
}[];
|
|
1304
1634
|
openedAccounts: {
|
|
1305
1635
|
account: {
|
|
1636
|
+
lamports: BN;
|
|
1637
|
+
tree: PublicKey;
|
|
1306
1638
|
data: {
|
|
1307
1639
|
data: string;
|
|
1308
1640
|
dataHash: BN;
|
|
@@ -1310,10 +1642,8 @@ declare const CompressedTransactionResult: Struct<{
|
|
|
1310
1642
|
} | null;
|
|
1311
1643
|
address: number[] | null;
|
|
1312
1644
|
hash: BN;
|
|
1313
|
-
lamports: BN;
|
|
1314
1645
|
owner: PublicKey;
|
|
1315
1646
|
leafIndex: number;
|
|
1316
|
-
tree: PublicKey;
|
|
1317
1647
|
seq: BN | null;
|
|
1318
1648
|
slotCreated: BN;
|
|
1319
1649
|
};
|
|
@@ -1331,6 +1661,8 @@ declare const CompressedTransactionResult: Struct<{
|
|
|
1331
1661
|
compressionInfo: Struct<{
|
|
1332
1662
|
closedAccounts: {
|
|
1333
1663
|
account: {
|
|
1664
|
+
lamports: BN;
|
|
1665
|
+
tree: PublicKey;
|
|
1334
1666
|
data: {
|
|
1335
1667
|
data: string;
|
|
1336
1668
|
dataHash: BN;
|
|
@@ -1338,10 +1670,8 @@ declare const CompressedTransactionResult: Struct<{
|
|
|
1338
1670
|
} | null;
|
|
1339
1671
|
address: number[] | null;
|
|
1340
1672
|
hash: BN;
|
|
1341
|
-
lamports: BN;
|
|
1342
1673
|
owner: PublicKey;
|
|
1343
1674
|
leafIndex: number;
|
|
1344
|
-
tree: PublicKey;
|
|
1345
1675
|
seq: BN | null;
|
|
1346
1676
|
slotCreated: BN;
|
|
1347
1677
|
};
|
|
@@ -1355,6 +1685,8 @@ declare const CompressedTransactionResult: Struct<{
|
|
|
1355
1685
|
}[];
|
|
1356
1686
|
openedAccounts: {
|
|
1357
1687
|
account: {
|
|
1688
|
+
lamports: BN;
|
|
1689
|
+
tree: PublicKey;
|
|
1358
1690
|
data: {
|
|
1359
1691
|
data: string;
|
|
1360
1692
|
dataHash: BN;
|
|
@@ -1362,10 +1694,8 @@ declare const CompressedTransactionResult: Struct<{
|
|
|
1362
1694
|
} | null;
|
|
1363
1695
|
address: number[] | null;
|
|
1364
1696
|
hash: BN;
|
|
1365
|
-
lamports: BN;
|
|
1366
1697
|
owner: PublicKey;
|
|
1367
1698
|
leafIndex: number;
|
|
1368
|
-
tree: PublicKey;
|
|
1369
1699
|
seq: BN | null;
|
|
1370
1700
|
slotCreated: BN;
|
|
1371
1701
|
};
|
|
@@ -1380,6 +1710,8 @@ declare const CompressedTransactionResult: Struct<{
|
|
|
1380
1710
|
}, {
|
|
1381
1711
|
closedAccounts: Struct<{
|
|
1382
1712
|
account: {
|
|
1713
|
+
lamports: BN;
|
|
1714
|
+
tree: PublicKey;
|
|
1383
1715
|
data: {
|
|
1384
1716
|
data: string;
|
|
1385
1717
|
dataHash: BN;
|
|
@@ -1387,10 +1719,8 @@ declare const CompressedTransactionResult: Struct<{
|
|
|
1387
1719
|
} | null;
|
|
1388
1720
|
address: number[] | null;
|
|
1389
1721
|
hash: BN;
|
|
1390
|
-
lamports: BN;
|
|
1391
1722
|
owner: PublicKey;
|
|
1392
1723
|
leafIndex: number;
|
|
1393
|
-
tree: PublicKey;
|
|
1394
1724
|
seq: BN | null;
|
|
1395
1725
|
slotCreated: BN;
|
|
1396
1726
|
};
|
|
@@ -1403,6 +1733,8 @@ declare const CompressedTransactionResult: Struct<{
|
|
|
1403
1733
|
} | null;
|
|
1404
1734
|
}[], Struct<{
|
|
1405
1735
|
account: {
|
|
1736
|
+
lamports: BN;
|
|
1737
|
+
tree: PublicKey;
|
|
1406
1738
|
data: {
|
|
1407
1739
|
data: string;
|
|
1408
1740
|
dataHash: BN;
|
|
@@ -1410,10 +1742,8 @@ declare const CompressedTransactionResult: Struct<{
|
|
|
1410
1742
|
} | null;
|
|
1411
1743
|
address: number[] | null;
|
|
1412
1744
|
hash: BN;
|
|
1413
|
-
lamports: BN;
|
|
1414
1745
|
owner: PublicKey;
|
|
1415
1746
|
leafIndex: number;
|
|
1416
|
-
tree: PublicKey;
|
|
1417
1747
|
seq: BN | null;
|
|
1418
1748
|
slotCreated: BN;
|
|
1419
1749
|
};
|
|
@@ -1426,6 +1756,8 @@ declare const CompressedTransactionResult: Struct<{
|
|
|
1426
1756
|
} | null;
|
|
1427
1757
|
}, {
|
|
1428
1758
|
account: Struct<{
|
|
1759
|
+
lamports: BN;
|
|
1760
|
+
tree: PublicKey;
|
|
1429
1761
|
data: {
|
|
1430
1762
|
data: string;
|
|
1431
1763
|
dataHash: BN;
|
|
@@ -1433,10 +1765,8 @@ declare const CompressedTransactionResult: Struct<{
|
|
|
1433
1765
|
} | null;
|
|
1434
1766
|
address: number[] | null;
|
|
1435
1767
|
hash: BN;
|
|
1436
|
-
lamports: BN;
|
|
1437
1768
|
owner: PublicKey;
|
|
1438
1769
|
leafIndex: number;
|
|
1439
|
-
tree: PublicKey;
|
|
1440
1770
|
seq: BN | null;
|
|
1441
1771
|
slotCreated: BN;
|
|
1442
1772
|
}, {
|
|
@@ -1474,6 +1804,8 @@ declare const CompressedTransactionResult: Struct<{
|
|
|
1474
1804
|
}>>;
|
|
1475
1805
|
openedAccounts: Struct<{
|
|
1476
1806
|
account: {
|
|
1807
|
+
lamports: BN;
|
|
1808
|
+
tree: PublicKey;
|
|
1477
1809
|
data: {
|
|
1478
1810
|
data: string;
|
|
1479
1811
|
dataHash: BN;
|
|
@@ -1481,10 +1813,8 @@ declare const CompressedTransactionResult: Struct<{
|
|
|
1481
1813
|
} | null;
|
|
1482
1814
|
address: number[] | null;
|
|
1483
1815
|
hash: BN;
|
|
1484
|
-
lamports: BN;
|
|
1485
1816
|
owner: PublicKey;
|
|
1486
1817
|
leafIndex: number;
|
|
1487
|
-
tree: PublicKey;
|
|
1488
1818
|
seq: BN | null;
|
|
1489
1819
|
slotCreated: BN;
|
|
1490
1820
|
};
|
|
@@ -1497,6 +1827,8 @@ declare const CompressedTransactionResult: Struct<{
|
|
|
1497
1827
|
} | null;
|
|
1498
1828
|
}[], Struct<{
|
|
1499
1829
|
account: {
|
|
1830
|
+
lamports: BN;
|
|
1831
|
+
tree: PublicKey;
|
|
1500
1832
|
data: {
|
|
1501
1833
|
data: string;
|
|
1502
1834
|
dataHash: BN;
|
|
@@ -1504,10 +1836,8 @@ declare const CompressedTransactionResult: Struct<{
|
|
|
1504
1836
|
} | null;
|
|
1505
1837
|
address: number[] | null;
|
|
1506
1838
|
hash: BN;
|
|
1507
|
-
lamports: BN;
|
|
1508
1839
|
owner: PublicKey;
|
|
1509
1840
|
leafIndex: number;
|
|
1510
|
-
tree: PublicKey;
|
|
1511
1841
|
seq: BN | null;
|
|
1512
1842
|
slotCreated: BN;
|
|
1513
1843
|
};
|
|
@@ -1520,6 +1850,8 @@ declare const CompressedTransactionResult: Struct<{
|
|
|
1520
1850
|
} | null;
|
|
1521
1851
|
}, {
|
|
1522
1852
|
account: Struct<{
|
|
1853
|
+
lamports: BN;
|
|
1854
|
+
tree: PublicKey;
|
|
1523
1855
|
data: {
|
|
1524
1856
|
data: string;
|
|
1525
1857
|
dataHash: BN;
|
|
@@ -1527,10 +1859,8 @@ declare const CompressedTransactionResult: Struct<{
|
|
|
1527
1859
|
} | null;
|
|
1528
1860
|
address: number[] | null;
|
|
1529
1861
|
hash: BN;
|
|
1530
|
-
lamports: BN;
|
|
1531
1862
|
owner: PublicKey;
|
|
1532
1863
|
leafIndex: number;
|
|
1533
|
-
tree: PublicKey;
|
|
1534
1864
|
seq: BN | null;
|
|
1535
1865
|
slotCreated: BN;
|
|
1536
1866
|
}, {
|
|
@@ -1576,9 +1906,9 @@ interface CompressionApiInterface {
|
|
|
1576
1906
|
getCompressedAccountProof(hash: BN254): Promise<MerkleContextWithMerkleProof>;
|
|
1577
1907
|
getMultipleCompressedAccounts(hashes: BN254[]): Promise<CompressedAccountWithMerkleContext[]>;
|
|
1578
1908
|
getMultipleCompressedAccountProofs(hashes: BN254[]): Promise<MerkleContextWithMerkleProof[]>;
|
|
1579
|
-
getValidityProof(hashes: BN254[], newAddresses: BN254[]): Promise<
|
|
1580
|
-
getValidityProofV0(hashes: HashWithTree[], newAddresses: AddressWithTree[]): Promise<
|
|
1581
|
-
getValidityProofAndRpcContext(hashes: HashWithTree[], newAddresses: AddressWithTree[]): Promise<WithContext<
|
|
1909
|
+
getValidityProof(hashes: BN254[], newAddresses: BN254[]): Promise<ValidityProofWithContext>;
|
|
1910
|
+
getValidityProofV0(hashes: HashWithTree[], newAddresses: AddressWithTree[]): Promise<ValidityProofWithContext>;
|
|
1911
|
+
getValidityProofAndRpcContext(hashes: HashWithTree[], newAddresses: AddressWithTree[]): Promise<WithContext<ValidityProofWithContext>>;
|
|
1582
1912
|
getCompressedAccountsByOwner(owner: PublicKey, config?: GetCompressedAccountsByOwnerConfig): Promise<WithCursor<CompressedAccountWithMerkleContext[]>>;
|
|
1583
1913
|
getCompressedMintTokenHolders(mint: PublicKey, options?: PaginatedOptions): Promise<WithContext<WithCursor<CompressedMintTokenHolders[]>>>;
|
|
1584
1914
|
getCompressedTokenAccountsByOwner(publicKey: PublicKey, options: GetCompressedTokenAccountsByOwnerOrDelegateOptions): Promise<WithCursor<ParsedTokenAccount[]>>;
|
|
@@ -1664,7 +1994,7 @@ interface LightWasm {
|
|
|
1664
1994
|
* @param depth Depth of the merkle tree.
|
|
1665
1995
|
* @param log Log proof generation time.
|
|
1666
1996
|
*/
|
|
1667
|
-
declare function getTestRpc(lightWasm: LightWasm, endpoint?: string, compressionApiEndpoint?: string, proverEndpoint?: string,
|
|
1997
|
+
declare function getTestRpc(lightWasm: LightWasm, endpoint?: string, compressionApiEndpoint?: string, proverEndpoint?: string, depth?: number, log?: boolean): Promise<TestRpc>;
|
|
1668
1998
|
/**
|
|
1669
1999
|
* Simple mock rpc for unit tests that simulates the compression rpc interface.
|
|
1670
2000
|
* Fetches, parses events and builds merkletree on-demand, i.e. it does not persist state.
|
|
@@ -1677,14 +2007,13 @@ declare function getTestRpc(lightWasm: LightWasm, endpoint?: string, compression
|
|
|
1677
2007
|
declare class TestRpc extends Connection implements CompressionApiInterface {
|
|
1678
2008
|
compressionApiEndpoint: string;
|
|
1679
2009
|
proverEndpoint: string;
|
|
1680
|
-
merkleTreeAddress: PublicKey;
|
|
1681
|
-
nullifierQueueAddress: PublicKey;
|
|
1682
|
-
addressTreeAddress: PublicKey;
|
|
1683
|
-
addressQueueAddress: PublicKey;
|
|
1684
2010
|
lightWasm: LightWasm;
|
|
1685
2011
|
depth: number;
|
|
1686
2012
|
log: boolean;
|
|
1687
|
-
|
|
2013
|
+
allStateTreeInfos: StateTreeInfo[] | null;
|
|
2014
|
+
lastStateTreeFetchTime: number | null;
|
|
2015
|
+
fetchPromise: Promise<StateTreeInfo[]> | null;
|
|
2016
|
+
CACHE_TTL: number;
|
|
1688
2017
|
/**
|
|
1689
2018
|
* Establish a Compression-compatible JSON RPC mock-connection
|
|
1690
2019
|
*
|
|
@@ -1699,17 +2028,14 @@ declare class TestRpc extends Connection implements CompressionApiInterface {
|
|
|
1699
2028
|
*/
|
|
1700
2029
|
constructor(endpoint: string, hasher: LightWasm, compressionApiEndpoint: string, proverEndpoint: string, connectionConfig?: ConnectionConfig, testRpcConfig?: TestRpcConfig);
|
|
1701
2030
|
/**
|
|
1702
|
-
*
|
|
1703
|
-
*/
|
|
1704
|
-
setStateTreeInfo(info: ActiveTreeBundle[]): void;
|
|
1705
|
-
/**
|
|
1706
|
-
* Returns local test state trees.
|
|
2031
|
+
* @deprecated Use {@link getStateTreeInfos} instead
|
|
1707
2032
|
*/
|
|
1708
|
-
|
|
2033
|
+
getCachedActiveStateTreeInfos(): Promise<void>;
|
|
1709
2034
|
/**
|
|
1710
2035
|
* Returns local test state trees.
|
|
1711
2036
|
*/
|
|
1712
|
-
|
|
2037
|
+
getStateTreeInfos(): Promise<StateTreeInfo[]>;
|
|
2038
|
+
doFetch(): Promise<StateTreeInfo[]>;
|
|
1713
2039
|
/**
|
|
1714
2040
|
* Fetch the compressed account for the specified account hash
|
|
1715
2041
|
*/
|
|
@@ -1847,12 +2173,12 @@ declare class TestRpc extends Connection implements CompressionApiInterface {
|
|
|
1847
2173
|
* Note: Use RPC class for forested trees. TestRpc is only for custom
|
|
1848
2174
|
* testing purposes.
|
|
1849
2175
|
*/
|
|
1850
|
-
getValidityProofDirect(hashes?: BN254[], newAddresses?: BN254[]): Promise<
|
|
2176
|
+
getValidityProofDirect(hashes?: BN254[], newAddresses?: BN254[]): Promise<ValidityProofWithContext>;
|
|
1851
2177
|
/**
|
|
1852
2178
|
* @deprecated This method is not available for TestRpc. Please use
|
|
1853
2179
|
* {@link getValidityProof} instead.
|
|
1854
2180
|
*/
|
|
1855
|
-
getValidityProofAndRpcContext(hashes?: HashWithTree[], newAddresses?: AddressWithTree[]): Promise<WithContext<
|
|
2181
|
+
getValidityProofAndRpcContext(hashes?: HashWithTree[], newAddresses?: AddressWithTree[]): Promise<WithContext<ValidityProofWithContext>>;
|
|
1856
2182
|
/**
|
|
1857
2183
|
* Fetch the latest validity proof for (1) compressed accounts specified by
|
|
1858
2184
|
* an array of account hashes. (2) new unique addresses specified by an
|
|
@@ -1867,8 +2193,8 @@ declare class TestRpc extends Connection implements CompressionApiInterface {
|
|
|
1867
2193
|
* @param newAddresses Array of BN254 new addresses.
|
|
1868
2194
|
* @returns validity proof with context
|
|
1869
2195
|
*/
|
|
1870
|
-
getValidityProof(hashes?: BN254[], newAddresses?: BN254[]): Promise<
|
|
1871
|
-
getValidityProofV0(hashes?: HashWithTree[], newAddresses?: AddressWithTree[]): Promise<
|
|
2196
|
+
getValidityProof(hashes?: BN254[], newAddresses?: BN254[]): Promise<ValidityProofWithContext>;
|
|
2197
|
+
getValidityProofV0(hashes?: HashWithTree[], newAddresses?: AddressWithTree[]): Promise<ValidityProofWithContext>;
|
|
1872
2198
|
}
|
|
1873
2199
|
|
|
1874
2200
|
declare class IndexedElement {
|
|
@@ -2086,7 +2412,7 @@ declare function parseTokenLayoutWithIdl(compressedAccount: CompressedAccount, p
|
|
|
2086
2412
|
* @param owner PublicKey of the token owner
|
|
2087
2413
|
* @param mint PublicKey of the token mint
|
|
2088
2414
|
*/
|
|
2089
|
-
declare function getCompressedTokenAccounts(events: PublicTransactionEvent[]): Promise<ParsedTokenAccount[]>;
|
|
2415
|
+
declare function getCompressedTokenAccounts(events: PublicTransactionEvent[], rpc: Rpc): Promise<ParsedTokenAccount[]>;
|
|
2090
2416
|
/** @internal */
|
|
2091
2417
|
declare function getCompressedTokenAccountsByOwnerTest(rpc: Rpc, owner: PublicKey, mint: PublicKey): Promise<WithCursor<ParsedTokenAccount[]>>;
|
|
2092
2418
|
declare function getCompressedTokenAccountsByDelegateTest(rpc: Rpc, delegate: PublicKey, mint: PublicKey): Promise<WithCursor<ParsedTokenAccount[]>>;
|
|
@@ -2152,7 +2478,7 @@ declare function wrapBigNumbersAsStrings(text: string): string;
|
|
|
2152
2478
|
/** @internal */
|
|
2153
2479
|
declare const rpcRequest: (rpcEndpoint: string, method: string, params?: any, convertToCamelCase?: boolean, debug?: boolean) => Promise<any>;
|
|
2154
2480
|
/** @internal */
|
|
2155
|
-
declare const proverRequest: (proverEndpoint: string, method: "inclusion" | "new-address" | "combined", params?: any, log?: boolean, publicInputHash?: BN | undefined) => Promise<
|
|
2481
|
+
declare const proverRequest: (proverEndpoint: string, method: "inclusion" | "new-address" | "combined", params?: any, log?: boolean, publicInputHash?: BN | undefined) => Promise<ValidityProof>;
|
|
2156
2482
|
type NonInclusionMerkleProofInputs = {
|
|
2157
2483
|
root: BN;
|
|
2158
2484
|
value: BN;
|
|
@@ -2171,8 +2497,7 @@ type MerkleContextWithNewAddressProof = {
|
|
|
2171
2497
|
nextIndex: BN;
|
|
2172
2498
|
merkleProofHashedIndexedElementLeaf: BN[];
|
|
2173
2499
|
indexHashedIndexedElementLeaf: BN;
|
|
2174
|
-
|
|
2175
|
-
nullifierQueue: PublicKey;
|
|
2500
|
+
treeInfo: AddressTreeInfo;
|
|
2176
2501
|
};
|
|
2177
2502
|
type NonInclusionJsonStruct = {
|
|
2178
2503
|
root: string;
|
|
@@ -2186,14 +2511,6 @@ type NonInclusionJsonStruct = {
|
|
|
2186
2511
|
declare function convertMerkleProofsWithContextToHex(merkleProofsWithContext: MerkleContextWithMerkleProof[]): HexInputsForProver[];
|
|
2187
2512
|
declare function convertNonInclusionMerkleProofInputsToHex(nonInclusionMerkleProofInputs: MerkleContextWithNewAddressProof[]): NonInclusionJsonStruct[];
|
|
2188
2513
|
declare function getPublicInputHash(accountProofs: MerkleContextWithMerkleProof[], accountHashes: BN254[], newAddressProofs: MerkleContextWithNewAddressProof[], lightWasm: LightWasm): BN;
|
|
2189
|
-
/**
|
|
2190
|
-
* Get the queue for a given tree
|
|
2191
|
-
*
|
|
2192
|
-
* @param info - The active state tree addresses
|
|
2193
|
-
* @param tree - The tree to get the queue for
|
|
2194
|
-
* @returns The queue for the given tree, or undefined if not found
|
|
2195
|
-
*/
|
|
2196
|
-
declare function getQueueForTree(info: ActiveTreeBundle[], tree: PublicKey): PublicKey;
|
|
2197
2514
|
/**
|
|
2198
2515
|
* Get the tree for a given queue
|
|
2199
2516
|
*
|
|
@@ -2201,40 +2518,31 @@ declare function getQueueForTree(info: ActiveTreeBundle[], tree: PublicKey): Pub
|
|
|
2201
2518
|
* @param queue - The queue to get the tree for
|
|
2202
2519
|
* @returns The tree for the given queue, or undefined if not found
|
|
2203
2520
|
*/
|
|
2204
|
-
declare function getTreeForQueue(info:
|
|
2205
|
-
/**
|
|
2206
|
-
* Get a random tree and queue from the active state tree addresses.
|
|
2207
|
-
*
|
|
2208
|
-
* Prevents write lock contention on state trees.
|
|
2209
|
-
*
|
|
2210
|
-
* @param info - The active state tree addresses
|
|
2211
|
-
* @returns A random tree and queue
|
|
2212
|
-
*/
|
|
2213
|
-
declare function pickRandomTreeAndQueue(info: ActiveTreeBundle[]): {
|
|
2214
|
-
tree: PublicKey;
|
|
2215
|
-
queue: PublicKey;
|
|
2216
|
-
};
|
|
2521
|
+
declare function getTreeForQueue(info: StateTreeInfo[], queue: PublicKey): PublicKey;
|
|
2217
2522
|
/**
|
|
2218
2523
|
*
|
|
2219
2524
|
*/
|
|
2220
2525
|
declare class Rpc extends Connection implements CompressionApiInterface {
|
|
2221
2526
|
compressionApiEndpoint: string;
|
|
2222
2527
|
proverEndpoint: string;
|
|
2223
|
-
|
|
2528
|
+
allStateTreeInfos: StateTreeInfo[] | null;
|
|
2529
|
+
lastStateTreeFetchTime: number | null;
|
|
2530
|
+
CACHE_TTL: number;
|
|
2531
|
+
fetchPromise: Promise<StateTreeInfo[]> | null;
|
|
2224
2532
|
constructor(endpoint: string, compressionApiEndpoint: string, proverEndpoint: string, config?: ConnectionConfig);
|
|
2225
2533
|
/**
|
|
2226
|
-
*
|
|
2534
|
+
* @deprecated Use {@link getStateTreeInfos} instead
|
|
2227
2535
|
*/
|
|
2228
|
-
|
|
2536
|
+
getCachedActiveStateTreeInfos(): Promise<void>;
|
|
2229
2537
|
/**
|
|
2230
|
-
* Get
|
|
2231
|
-
*
|
|
2538
|
+
* Get a list of all state tree infos. If not already cached, fetches from
|
|
2539
|
+
* the cluster.
|
|
2232
2540
|
*/
|
|
2233
|
-
|
|
2541
|
+
getStateTreeInfos(): Promise<StateTreeInfo[]>;
|
|
2234
2542
|
/**
|
|
2235
|
-
*
|
|
2543
|
+
* @internal
|
|
2236
2544
|
*/
|
|
2237
|
-
|
|
2545
|
+
doFetch(): Promise<StateTreeInfo[]>;
|
|
2238
2546
|
/**
|
|
2239
2547
|
* Fetch the compressed account for the specified account address or hash
|
|
2240
2548
|
*/
|
|
@@ -2382,12 +2690,10 @@ declare class Rpc extends Connection implements CompressionApiInterface {
|
|
|
2382
2690
|
* @param newAddresses Array of BN254 new addresses.
|
|
2383
2691
|
* @returns validity proof with context
|
|
2384
2692
|
*/
|
|
2385
|
-
getValidityProofDirect(hashes?: BN254[], newAddresses?: BN254[]): Promise<
|
|
2693
|
+
getValidityProofDirect(hashes?: BN254[], newAddresses?: BN254[]): Promise<ValidityProofWithContext>;
|
|
2386
2694
|
/**
|
|
2387
2695
|
* @deprecated use {@link getValidityProofV0} instead.
|
|
2388
2696
|
*
|
|
2389
|
-
*
|
|
2390
|
-
*
|
|
2391
2697
|
* Fetch the latest validity proof for (1) compressed accounts specified by
|
|
2392
2698
|
* an array of account hashes. (2) new unique addresses specified by an
|
|
2393
2699
|
* array of addresses.
|
|
@@ -2401,7 +2707,7 @@ declare class Rpc extends Connection implements CompressionApiInterface {
|
|
|
2401
2707
|
* @param newAddresses Array of BN254 new addresses.
|
|
2402
2708
|
* @returns validity proof with context
|
|
2403
2709
|
*/
|
|
2404
|
-
getValidityProof(hashes?: BN254[], newAddresses?: BN254[]): Promise<
|
|
2710
|
+
getValidityProof(hashes?: BN254[], newAddresses?: BN254[]): Promise<ValidityProofWithContext>;
|
|
2405
2711
|
/**
|
|
2406
2712
|
* Fetch the latest validity proof for (1) compressed accounts specified by
|
|
2407
2713
|
* an array of account hashes. (2) new unique addresses specified by an
|
|
@@ -2416,7 +2722,7 @@ declare class Rpc extends Connection implements CompressionApiInterface {
|
|
|
2416
2722
|
* @param newAddresses Array of { address: BN254, tree: PublicKey, queue: PublicKey }.
|
|
2417
2723
|
* @returns validity proof with context
|
|
2418
2724
|
*/
|
|
2419
|
-
getValidityProofV0(hashes?: HashWithTree[], newAddresses?: AddressWithTree[]): Promise<
|
|
2725
|
+
getValidityProofV0(hashes?: HashWithTree[], newAddresses?: AddressWithTree[]): Promise<ValidityProofWithContext>;
|
|
2420
2726
|
/**
|
|
2421
2727
|
* Fetch the latest validity proof for (1) compressed accounts specified by
|
|
2422
2728
|
* an array of account hashes. (2) new unique addresses specified by an
|
|
@@ -2433,96 +2739,85 @@ declare class Rpc extends Connection implements CompressionApiInterface {
|
|
|
2433
2739
|
* state tree/queue.
|
|
2434
2740
|
* @returns validity proof with context
|
|
2435
2741
|
*/
|
|
2436
|
-
getValidityProofAndRpcContext(hashes?: HashWithTree[], newAddresses?: AddressWithTree[]): Promise<WithContext<
|
|
2742
|
+
getValidityProofAndRpcContext(hashes?: HashWithTree[], newAddresses?: AddressWithTree[]): Promise<WithContext<ValidityProofWithContext>>;
|
|
2437
2743
|
}
|
|
2438
2744
|
|
|
2439
2745
|
/**
|
|
2440
2746
|
* Compress lamports to a solana address
|
|
2441
2747
|
*
|
|
2442
|
-
* @param rpc
|
|
2443
|
-
* @param payer
|
|
2444
|
-
* @param lamports
|
|
2445
|
-
* @param toAddress
|
|
2446
|
-
* @param
|
|
2447
|
-
*
|
|
2748
|
+
* @param rpc RPC to use
|
|
2749
|
+
* @param payer Payer of the transaction and initialization fees
|
|
2750
|
+
* @param lamports Amount of lamports to compress
|
|
2751
|
+
* @param toAddress Address of the recipient compressed account
|
|
2752
|
+
* @param outputStateTreeInfo Optional output state tree. If not provided,
|
|
2753
|
+
* fetches a random active state tree.
|
|
2754
|
+
* @param confirmOptions Options for confirming the transaction
|
|
2448
2755
|
*
|
|
2449
2756
|
* @return Transaction signature
|
|
2450
2757
|
*/
|
|
2451
|
-
declare function compress(rpc: Rpc, payer: Signer, lamports: number | BN, toAddress: PublicKey,
|
|
2758
|
+
declare function compress(rpc: Rpc, payer: Signer, lamports: number | BN, toAddress: PublicKey, outputStateTreeInfo?: StateTreeInfo, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2452
2759
|
|
|
2453
2760
|
/**
|
|
2454
2761
|
* Create compressed account with address
|
|
2455
2762
|
*
|
|
2456
|
-
* @param rpc
|
|
2457
|
-
* @param payer
|
|
2458
|
-
* @param seeds
|
|
2459
|
-
* @param programId
|
|
2460
|
-
* @param
|
|
2461
|
-
*
|
|
2462
|
-
* @param
|
|
2463
|
-
*
|
|
2464
|
-
* @param
|
|
2465
|
-
* shared state tree.
|
|
2466
|
-
* @param confirmOptions Options for confirming the transaction
|
|
2763
|
+
* @param rpc RPC to use
|
|
2764
|
+
* @param payer Payer of the transaction and initialization fees
|
|
2765
|
+
* @param seeds Seeds to derive the new account address
|
|
2766
|
+
* @param programId Owner of the new account
|
|
2767
|
+
* @param addressTreeInfo Optional address tree info. Defaults to a current
|
|
2768
|
+
* shared address tree.
|
|
2769
|
+
* @param outputStateTreeInfo Optional output state tree. Defaults to fetching
|
|
2770
|
+
* a current shared state tree.
|
|
2771
|
+
* @param confirmOptions Options for confirming the transaction
|
|
2467
2772
|
*
|
|
2468
|
-
* @return
|
|
2773
|
+
* @return Transaction signature
|
|
2469
2774
|
*/
|
|
2470
|
-
declare function createAccount(rpc: Rpc, payer: Signer, seeds: Uint8Array[], programId: PublicKey,
|
|
2775
|
+
declare function createAccount(rpc: Rpc, payer: Signer, seeds: Uint8Array[], programId: PublicKey, addressTreeInfo?: AddressTreeInfo, outputStateTreeInfo?: StateTreeInfo, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2471
2776
|
/**
|
|
2472
2777
|
* Create compressed account with address and lamports
|
|
2473
2778
|
*
|
|
2474
|
-
* @param rpc
|
|
2475
|
-
* @param payer
|
|
2476
|
-
* @param seeds
|
|
2477
|
-
* @param lamports
|
|
2478
|
-
*
|
|
2479
|
-
* @param programId
|
|
2480
|
-
* @param
|
|
2481
|
-
*
|
|
2482
|
-
* @param
|
|
2483
|
-
*
|
|
2484
|
-
* @param
|
|
2485
|
-
* shared state tree.
|
|
2486
|
-
* @param confirmOptions Options for confirming the transaction
|
|
2779
|
+
* @param rpc RPC to use
|
|
2780
|
+
* @param payer Payer of the transaction and initialization fees
|
|
2781
|
+
* @param seeds Seeds to derive the new account address
|
|
2782
|
+
* @param lamports Number of compressed lamports to initialize the
|
|
2783
|
+
* account with
|
|
2784
|
+
* @param programId Owner of the new account
|
|
2785
|
+
* @param addressTreeInfo Optional address tree info. Defaults to a
|
|
2786
|
+
* current shared address tree.
|
|
2787
|
+
* @param outputStateTreeInfo Optional output state tree. Defaults to a
|
|
2788
|
+
* current shared state tree.
|
|
2789
|
+
* @param confirmOptions Options for confirming the transaction
|
|
2487
2790
|
*
|
|
2488
|
-
* @return
|
|
2791
|
+
* @return Transaction signature
|
|
2489
2792
|
*/
|
|
2490
|
-
declare function createAccountWithLamports(rpc: Rpc, payer: Signer, seeds: Uint8Array[], lamports: number | BN, programId: PublicKey,
|
|
2793
|
+
declare function createAccountWithLamports(rpc: Rpc, payer: Signer, seeds: Uint8Array[], lamports: number | BN, programId: PublicKey, addressTreeInfo?: AddressTreeInfo, outputStateTreeInfo?: StateTreeInfo, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2491
2794
|
|
|
2492
2795
|
/**
|
|
2493
2796
|
* Decompress lamports into a solana account
|
|
2494
2797
|
*
|
|
2495
|
-
* @param rpc
|
|
2496
|
-
* @param payer
|
|
2497
|
-
* @param lamports
|
|
2498
|
-
* @param toAddress
|
|
2499
|
-
* @param
|
|
2500
|
-
* @param confirmOptions Options for confirming the transaction
|
|
2798
|
+
* @param rpc RPC to use
|
|
2799
|
+
* @param payer Payer of the transaction and initialization fees
|
|
2800
|
+
* @param lamports Amount of lamports to compress
|
|
2801
|
+
* @param toAddress Address of the recipient compressed account
|
|
2802
|
+
* @param confirmOptions Options for confirming the transaction
|
|
2501
2803
|
*
|
|
2502
2804
|
* @return Transaction signature
|
|
2503
2805
|
*/
|
|
2504
|
-
declare function decompress(rpc: Rpc, payer: Signer, lamports: number | BN, recipient: PublicKey,
|
|
2505
|
-
|
|
2506
|
-
/** @internal remove signer from signers if part of signers */
|
|
2507
|
-
declare function dedupeSigner(signer: Signer, signers: Signer[]): Signer[];
|
|
2806
|
+
declare function decompress(rpc: Rpc, payer: Signer, lamports: number | BN, recipient: PublicKey, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2508
2807
|
|
|
2509
2808
|
/**
|
|
2510
2809
|
* Transfer compressed lamports from one owner to another
|
|
2511
2810
|
*
|
|
2512
|
-
* @param rpc
|
|
2513
|
-
* @param payer
|
|
2514
|
-
* @param lamports
|
|
2515
|
-
* @param owner
|
|
2516
|
-
* @param toAddress
|
|
2517
|
-
* @param
|
|
2518
|
-
* inserted into. Defaults to the default state tree account.
|
|
2519
|
-
* @param confirmOptions Options for confirming the transaction
|
|
2520
|
-
* @param config Configuration for fetching compressed accounts
|
|
2521
|
-
*
|
|
2811
|
+
* @param rpc Rpc to use
|
|
2812
|
+
* @param payer Payer of transaction fees
|
|
2813
|
+
* @param lamports Number of lamports to transfer
|
|
2814
|
+
* @param owner Owner of the compressed lamports
|
|
2815
|
+
* @param toAddress Destination address of the recipient
|
|
2816
|
+
* @param confirmOptions Options for confirming the transaction
|
|
2522
2817
|
*
|
|
2523
2818
|
* @return Signature of the confirmed transaction
|
|
2524
2819
|
*/
|
|
2525
|
-
declare function transfer(rpc: Rpc, payer: Signer, lamports: number | BN, owner: Signer, toAddress: PublicKey,
|
|
2820
|
+
declare function transfer(rpc: Rpc, payer: Signer, lamports: number | BN, owner: Signer, toAddress: PublicKey, outputStateTreeInfo?: StateTreeInfo, confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
2526
2821
|
|
|
2527
2822
|
/**
|
|
2528
2823
|
* @internal Finds the index of a PublicKey in an array, or adds it if not
|
|
@@ -2542,20 +2837,10 @@ declare function getIndexOrAdd(accountsArray: PublicKey[], key: PublicKey): numb
|
|
|
2542
2837
|
* outputCompressedAccounts.
|
|
2543
2838
|
* @param numberOfOutputCompressedAccounts The number of output
|
|
2544
2839
|
* compressed accounts.
|
|
2545
|
-
* @param inputCompressedAccountsWithMerkleContext The input compressed
|
|
2546
|
-
* accounts with merkle
|
|
2547
|
-
* context.
|
|
2548
|
-
* @param activeTreeBundles Optional active tree bundles
|
|
2549
|
-
* to be used as fallback for
|
|
2550
|
-
* padding. Prioritizes ones
|
|
2551
|
-
* that are explicitly passed
|
|
2552
|
-
* via outputStateMerkleTrees
|
|
2553
|
-
* or
|
|
2554
|
-
* inputCompressedAccountsWithMerkleContext.
|
|
2555
2840
|
*
|
|
2556
2841
|
* @returns Padded output state trees.
|
|
2557
2842
|
*/
|
|
2558
|
-
declare function padOutputStateMerkleTrees(outputStateMerkleTrees: PublicKey
|
|
2843
|
+
declare function padOutputStateMerkleTrees(outputStateMerkleTrees: PublicKey, numberOfOutputCompressedAccounts: number): PublicKey[];
|
|
2559
2844
|
declare function toAccountMetas(remainingAccounts: PublicKey[]): AccountMeta[];
|
|
2560
2845
|
/**
|
|
2561
2846
|
* Packs Compressed Accounts.
|
|
@@ -2568,22 +2853,14 @@ declare function toAccountMetas(remainingAccounts: PublicKey[]): AccountMeta[];
|
|
|
2568
2853
|
* input state. The expiry is tied to
|
|
2569
2854
|
* the proof.
|
|
2570
2855
|
* @param outputCompressedAccounts Ix output state to be created
|
|
2571
|
-
* @param
|
|
2572
|
-
*
|
|
2573
|
-
*
|
|
2574
|
-
* the input state. Gets padded to the
|
|
2575
|
-
* length of outputCompressedAccounts.
|
|
2576
|
-
*
|
|
2577
|
-
* @param activeTreeBundles Optional active tree bundles to be
|
|
2578
|
-
* used as fallback for padding.
|
|
2579
|
-
* Prioritizes ones that are explicitly
|
|
2580
|
-
* passed via outputStateMerkleTrees or
|
|
2581
|
-
* inputCompressedAccountsWithMerkleContext.
|
|
2856
|
+
* @param outputStateTreeInfo The output state tree info. Gets
|
|
2857
|
+
* padded to the length of
|
|
2858
|
+
* outputCompressedAccounts.
|
|
2582
2859
|
*
|
|
2583
2860
|
* @param remainingAccounts Optional existing array of accounts
|
|
2584
2861
|
* to append to.
|
|
2585
2862
|
**/
|
|
2586
|
-
declare function packCompressedAccounts(inputCompressedAccounts: CompressedAccountWithMerkleContext[], inputStateRootIndices: number[], outputCompressedAccounts: CompressedAccount[],
|
|
2863
|
+
declare function packCompressedAccounts(inputCompressedAccounts: CompressedAccountWithMerkleContext[], inputStateRootIndices: number[], outputCompressedAccounts: CompressedAccount[], outputStateTreeInfo?: StateTreeInfo, remainingAccounts?: PublicKey[]): {
|
|
2587
2864
|
packedInputCompressedAccounts: PackedCompressedAccountWithMerkleContext[];
|
|
2588
2865
|
packedOutputCompressedAccounts: OutputCompressedAccountWithPackedContext[];
|
|
2589
2866
|
remainingAccounts: PublicKey[];
|
|
@@ -2599,21 +2876,24 @@ type CreateAccountWithSeedParams = {
|
|
|
2599
2876
|
*/
|
|
2600
2877
|
payer: PublicKey;
|
|
2601
2878
|
/**
|
|
2602
|
-
* Address params for the new compressed account
|
|
2879
|
+
* Address params for the new compressed account.
|
|
2603
2880
|
*/
|
|
2604
2881
|
newAddressParams: NewAddressParams;
|
|
2882
|
+
/**
|
|
2883
|
+
* Address of the new compressed account
|
|
2884
|
+
*/
|
|
2605
2885
|
newAddress: number[];
|
|
2606
2886
|
/**
|
|
2607
2887
|
* Recent validity proof proving that there's no existing compressed account
|
|
2608
2888
|
* registered with newAccountAddress
|
|
2609
2889
|
*/
|
|
2610
|
-
recentValidityProof:
|
|
2890
|
+
recentValidityProof: ValidityProof;
|
|
2611
2891
|
/**
|
|
2612
2892
|
* State tree pubkey. Defaults to a public state tree if unspecified.
|
|
2613
2893
|
*/
|
|
2614
|
-
|
|
2894
|
+
outputStateTreeInfo?: StateTreeInfo;
|
|
2615
2895
|
/**
|
|
2616
|
-
* Public key of the program to assign as the owner of the created account
|
|
2896
|
+
* Public key of the program to assign as the owner of the created account.
|
|
2617
2897
|
*/
|
|
2618
2898
|
programId?: PublicKey;
|
|
2619
2899
|
/**
|
|
@@ -2644,11 +2924,11 @@ type TransferParams = {
|
|
|
2644
2924
|
*/
|
|
2645
2925
|
inputCompressedAccounts: CompressedAccountWithMerkleContext[];
|
|
2646
2926
|
/**
|
|
2647
|
-
* Recipient address
|
|
2927
|
+
* Recipient address.
|
|
2648
2928
|
*/
|
|
2649
2929
|
toAddress: PublicKey;
|
|
2650
2930
|
/**
|
|
2651
|
-
*
|
|
2931
|
+
* Amount of lamports to transfer.
|
|
2652
2932
|
*/
|
|
2653
2933
|
lamports: number | BN;
|
|
2654
2934
|
/**
|
|
@@ -2662,13 +2942,7 @@ type TransferParams = {
|
|
|
2662
2942
|
* The recent validity proof for state inclusion of the input state. It
|
|
2663
2943
|
* expires after n slots.
|
|
2664
2944
|
*/
|
|
2665
|
-
recentValidityProof:
|
|
2666
|
-
/**
|
|
2667
|
-
* The state trees that the tx output should be inserted into. This can be a
|
|
2668
|
-
* single PublicKey or an array of PublicKey. Defaults to the 0th state tree
|
|
2669
|
-
* of input state.
|
|
2670
|
-
*/
|
|
2671
|
-
outputStateTrees?: PublicKey[] | PublicKey;
|
|
2945
|
+
recentValidityProof: ValidityProof;
|
|
2672
2946
|
};
|
|
2673
2947
|
/**
|
|
2674
2948
|
* Defines the parameters for the transfer method
|
|
@@ -2690,7 +2964,7 @@ type CompressParams = {
|
|
|
2690
2964
|
* The state tree that the tx output should be inserted into. Defaults to a
|
|
2691
2965
|
* public state tree if unspecified.
|
|
2692
2966
|
*/
|
|
2693
|
-
|
|
2967
|
+
outputStateTreeInfo: StateTreeInfo;
|
|
2694
2968
|
};
|
|
2695
2969
|
/**
|
|
2696
2970
|
* Defines the parameters for the transfer method
|
|
@@ -2723,13 +2997,7 @@ type DecompressParams = {
|
|
|
2723
2997
|
* The recent validity proof for state inclusion of the input state. It
|
|
2724
2998
|
* expires after n slots.
|
|
2725
2999
|
*/
|
|
2726
|
-
recentValidityProof:
|
|
2727
|
-
/**
|
|
2728
|
-
* The state trees that the tx output should be inserted into. This can be a
|
|
2729
|
-
* single PublicKey or an array of PublicKey. Defaults to the 0th state tree
|
|
2730
|
-
* of input state.
|
|
2731
|
-
*/
|
|
2732
|
-
outputStateTree?: PublicKey;
|
|
3000
|
+
recentValidityProof: ValidityProof;
|
|
2733
3001
|
};
|
|
2734
3002
|
declare class LightSystemProgram$1 {
|
|
2735
3003
|
/**
|
|
@@ -2737,7 +3005,7 @@ declare class LightSystemProgram$1 {
|
|
|
2737
3005
|
*/
|
|
2738
3006
|
constructor();
|
|
2739
3007
|
/**
|
|
2740
|
-
*
|
|
3008
|
+
* The LightSystemProgram program ID.
|
|
2741
3009
|
*/
|
|
2742
3010
|
static programId: PublicKey;
|
|
2743
3011
|
/**
|
|
@@ -2758,22 +3026,22 @@ declare class LightSystemProgram$1 {
|
|
|
2758
3026
|
*
|
|
2759
3027
|
* TODO: support transfer of lamports to the new account.
|
|
2760
3028
|
*/
|
|
2761
|
-
static createAccount({ payer, newAddressParams, newAddress, recentValidityProof,
|
|
3029
|
+
static createAccount({ payer, newAddressParams, newAddress, recentValidityProof, outputStateTreeInfo, inputCompressedAccounts, inputStateRootIndices, lamports, }: CreateAccountWithSeedParams): Promise<TransactionInstruction>;
|
|
2762
3030
|
/**
|
|
2763
3031
|
* Creates a transaction instruction that transfers compressed lamports from
|
|
2764
3032
|
* one owner to another.
|
|
2765
3033
|
*/
|
|
2766
|
-
static transfer({ payer, inputCompressedAccounts, toAddress, lamports, recentInputStateRootIndices, recentValidityProof,
|
|
3034
|
+
static transfer({ payer, inputCompressedAccounts, toAddress, lamports, recentInputStateRootIndices, recentValidityProof, }: TransferParams): Promise<TransactionInstruction>;
|
|
2767
3035
|
/**
|
|
2768
3036
|
* Creates a transaction instruction that transfers compressed lamports from
|
|
2769
3037
|
* one owner to another.
|
|
2770
3038
|
*/
|
|
2771
|
-
static compress({ payer, toAddress, lamports,
|
|
3039
|
+
static compress({ payer, toAddress, lamports, outputStateTreeInfo, }: CompressParams): Promise<TransactionInstruction>;
|
|
2772
3040
|
/**
|
|
2773
3041
|
* Creates a transaction instruction that transfers compressed lamports from
|
|
2774
3042
|
* one owner to another.
|
|
2775
3043
|
*/
|
|
2776
|
-
static decompress({ payer, inputCompressedAccounts, toAddress, lamports, recentInputStateRootIndices, recentValidityProof,
|
|
3044
|
+
static decompress({ payer, inputCompressedAccounts, toAddress, lamports, recentInputStateRootIndices, recentValidityProof, }: DecompressParams): Promise<TransactionInstruction>;
|
|
2777
3045
|
}
|
|
2778
3046
|
/**
|
|
2779
3047
|
* Selects the minimal number of compressed SOL accounts for a transfer.
|
|
@@ -2793,14 +3061,41 @@ declare const InstructionDataInvokeCpiLayout: Layout<InstructionDataInvokeCpi>;
|
|
|
2793
3061
|
declare function decodeInstructionDataInvoke(buffer: Buffer$1): InstructionDataInvoke;
|
|
2794
3062
|
declare function decodeInstructionDataInvokeCpi(buffer: Buffer$1): InstructionDataInvokeCpi;
|
|
2795
3063
|
type invokeAccountsLayoutParams = {
|
|
3064
|
+
/**
|
|
3065
|
+
* Fee payer.
|
|
3066
|
+
*/
|
|
2796
3067
|
feePayer: PublicKey;
|
|
3068
|
+
/**
|
|
3069
|
+
* Authority.
|
|
3070
|
+
*/
|
|
2797
3071
|
authority: PublicKey;
|
|
3072
|
+
/**
|
|
3073
|
+
* The registered program pda
|
|
3074
|
+
*/
|
|
2798
3075
|
registeredProgramPda: PublicKey;
|
|
3076
|
+
/**
|
|
3077
|
+
* Noop program.
|
|
3078
|
+
*/
|
|
2799
3079
|
noopProgram: PublicKey;
|
|
3080
|
+
/**
|
|
3081
|
+
* Account compression authority.
|
|
3082
|
+
*/
|
|
2800
3083
|
accountCompressionAuthority: PublicKey;
|
|
3084
|
+
/**
|
|
3085
|
+
* Account compression program.
|
|
3086
|
+
*/
|
|
2801
3087
|
accountCompressionProgram: PublicKey;
|
|
3088
|
+
/**
|
|
3089
|
+
* Solana pool pda. Some() if compression or decompression is done.
|
|
3090
|
+
*/
|
|
2802
3091
|
solPoolPda: PublicKey | null;
|
|
3092
|
+
/**
|
|
3093
|
+
* Decompression recipient.
|
|
3094
|
+
*/
|
|
2803
3095
|
decompressionRecipient: PublicKey | null;
|
|
3096
|
+
/**
|
|
3097
|
+
* Solana system program.
|
|
3098
|
+
*/
|
|
2804
3099
|
systemProgram: PublicKey;
|
|
2805
3100
|
};
|
|
2806
3101
|
declare const invokeAccountsLayout: (accounts: invokeAccountsLayoutParams) => AccountMeta[];
|
|
@@ -2822,110 +3117,6 @@ declare function deserializeAppendNullifyCreateAddressInputsIndexer(buffer: Buff
|
|
|
2822
3117
|
};
|
|
2823
3118
|
declare function convertToPublicTransactionEvent(decoded: any, remainingAccounts: PublicKey[], invokeData: InstructionDataInvoke): PublicTransactionEvent;
|
|
2824
3119
|
|
|
2825
|
-
declare const FIELD_SIZE: BN;
|
|
2826
|
-
declare const HIGHEST_ADDRESS_PLUS_ONE: BN;
|
|
2827
|
-
declare const COMPUTE_BUDGET_PATTERN: number[];
|
|
2828
|
-
declare const INVOKE_DISCRIMINATOR: Buffer$1;
|
|
2829
|
-
declare const INVOKE_CPI_DISCRIMINATOR: Buffer$1;
|
|
2830
|
-
declare const INSERT_INTO_QUEUES_DISCRIMINATOR: Buffer$1;
|
|
2831
|
-
declare const noopProgram = "noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV";
|
|
2832
|
-
declare const lightProgram = "SySTEM1eSU2p4BGQfQpimFEWWSC1XDFeun3Nqzz3rT7";
|
|
2833
|
-
declare const accountCompressionProgram = "compr6CUsB5m2jS4Y3831ztGSTnDpnKJTKS95d64XVq";
|
|
2834
|
-
declare const getRegisteredProgramPda: () => PublicKey;
|
|
2835
|
-
declare const getAccountCompressionAuthority: () => PublicKey;
|
|
2836
|
-
declare const defaultStaticAccounts: () => PublicKey[];
|
|
2837
|
-
declare const defaultStaticAccountsStruct: () => {
|
|
2838
|
-
registeredProgramPda: PublicKey;
|
|
2839
|
-
noopProgram: PublicKey;
|
|
2840
|
-
accountCompressionProgram: PublicKey;
|
|
2841
|
-
accountCompressionAuthority: PublicKey;
|
|
2842
|
-
cpiSignatureAccount: null;
|
|
2843
|
-
};
|
|
2844
|
-
type StateTreeLUTPair = {
|
|
2845
|
-
stateTreeLookupTable: PublicKey;
|
|
2846
|
-
nullifyTable: PublicKey;
|
|
2847
|
-
};
|
|
2848
|
-
/**
|
|
2849
|
-
* Returns the Default Public State Tree LUTs for Devnet and Mainnet-Beta.
|
|
2850
|
-
*/
|
|
2851
|
-
declare const defaultStateTreeLookupTables: () => {
|
|
2852
|
-
mainnet: StateTreeLUTPair[];
|
|
2853
|
-
devnet: StateTreeLUTPair[];
|
|
2854
|
-
};
|
|
2855
|
-
/**
|
|
2856
|
-
* @internal
|
|
2857
|
-
*/
|
|
2858
|
-
declare const isLocalTest: (url: string) => boolean;
|
|
2859
|
-
/**
|
|
2860
|
-
* @internal
|
|
2861
|
-
*/
|
|
2862
|
-
declare const localTestActiveStateTreeInfo: () => ActiveTreeBundle[];
|
|
2863
|
-
/**
|
|
2864
|
-
* Use only with Localnet testing.
|
|
2865
|
-
* For public networks, fetch via {@link defaultStateTreeLookupTables} and {@link getLightStateTreeInfo}.
|
|
2866
|
-
*/
|
|
2867
|
-
declare const defaultTestStateTreeAccounts: () => {
|
|
2868
|
-
nullifierQueue: PublicKey;
|
|
2869
|
-
merkleTree: PublicKey;
|
|
2870
|
-
merkleTreeHeight: number;
|
|
2871
|
-
addressTree: PublicKey;
|
|
2872
|
-
addressQueue: PublicKey;
|
|
2873
|
-
};
|
|
2874
|
-
/**
|
|
2875
|
-
* @internal testing only
|
|
2876
|
-
*/
|
|
2877
|
-
declare const defaultTestStateTreeAccounts2: () => {
|
|
2878
|
-
nullifierQueue2: PublicKey;
|
|
2879
|
-
merkleTree2: PublicKey;
|
|
2880
|
-
};
|
|
2881
|
-
declare const stateTreeLookupTableMainnet = "7i86eQs3GSqHjN47WdWLTCGMW6gde1q96G2EVnUyK2st";
|
|
2882
|
-
declare const nullifiedStateTreeLookupTableMainnet = "H9QD4u1fG7KmkAzn2tDXhheushxFe1EcrjGGyEFXeMqT";
|
|
2883
|
-
declare const stateTreeLookupTableDevnet = "8n8rH2bFRVA6cSGNDpgqcKHCndbFCT1bXxAQG89ejVsh";
|
|
2884
|
-
declare const nullifiedStateTreeLookupTableDevnet = "5dhaJLBjnVBQFErr8oiCJmcVsx3Zj6xDekGB2zULPsnP";
|
|
2885
|
-
declare const nullifierQueuePubkey = "nfq1NvQDJ2GEgnS8zt9prAe8rjjpAW1zFkrvZoBR148";
|
|
2886
|
-
declare const cpiContextPubkey = "cpi1uHzrEhBG733DoEJNgHCyRS3XmmyVNZx5fonubE4";
|
|
2887
|
-
declare const merkletreePubkey = "smt1NamzXdq4AMqS2fS2F1i5KTYPZRhoHgWx38d8WsT";
|
|
2888
|
-
declare const addressTree = "amt1Ayt45jfbdw5YSo7iz6WZxUmnZsQTYXy82hVwyC2";
|
|
2889
|
-
declare const addressQueue = "aq1S9z4reTSQAdgWHGD2zDaS39sjGrAxbR31vxJ2F4F";
|
|
2890
|
-
declare const merkleTree2Pubkey = "smt2rJAFdyJJupwMKAqTNAJwvjhmiZ4JYGZmbVRw1Ho";
|
|
2891
|
-
declare const nullifierQueue2Pubkey = "nfq2hgS7NYemXsFaFUCe3EMXSDSfnZnAe27jC6aPP1X";
|
|
2892
|
-
declare const cpiContext2Pubkey = "cpi2cdhkH5roePvcudTgUL8ppEBfTay1desGh8G8QxK";
|
|
2893
|
-
declare const confirmConfig: ConfirmOptions;
|
|
2894
|
-
declare const DEFAULT_MERKLE_TREE_HEIGHT = 26;
|
|
2895
|
-
declare const DEFAULT_MERKLE_TREE_ROOTS = 2800;
|
|
2896
|
-
/** Threshold (per asset) at which new in-UTXOs get merged, in order to reduce UTXO pool size */
|
|
2897
|
-
declare const UTXO_MERGE_THRESHOLD = 20;
|
|
2898
|
-
declare const UTXO_MERGE_MAXIMUM = 10;
|
|
2899
|
-
/**
|
|
2900
|
-
* Treshold after which the currently used transaction Merkle tree is switched
|
|
2901
|
-
* to the next one
|
|
2902
|
-
*/
|
|
2903
|
-
declare const TRANSACTION_MERKLE_TREE_ROLLOVER_THRESHOLD: BN;
|
|
2904
|
-
/**
|
|
2905
|
-
* Fee to provide continous funding for the state Merkle tree.
|
|
2906
|
-
* Once the state Merkle tree is at 95% capacity the accumulated fees
|
|
2907
|
-
* will be used to fund the next state Merkle tree with the same parameters.
|
|
2908
|
-
*
|
|
2909
|
-
* Is charged per output compressed account.
|
|
2910
|
-
*/
|
|
2911
|
-
declare const STATE_MERKLE_TREE_ROLLOVER_FEE: BN;
|
|
2912
|
-
/**
|
|
2913
|
-
* Fee to provide continous funding for the address queue and address Merkle tree.
|
|
2914
|
-
* Once the address Merkle tree is at 95% capacity the accumulated fees
|
|
2915
|
-
* will be used to fund the next address queue and address tree with the same parameters.
|
|
2916
|
-
*
|
|
2917
|
-
* Is charged per newly created address.
|
|
2918
|
-
*/
|
|
2919
|
-
declare const ADDRESS_QUEUE_ROLLOVER_FEE: BN;
|
|
2920
|
-
/**
|
|
2921
|
-
* Is charged if the transaction nullifies at least one compressed account.
|
|
2922
|
-
*/
|
|
2923
|
-
declare const STATE_MERKLE_TREE_NETWORK_FEE: BN;
|
|
2924
|
-
/**
|
|
2925
|
-
* Is charged if the transaction creates at least one address.
|
|
2926
|
-
*/
|
|
2927
|
-
declare const ADDRESS_TREE_NETWORK_FEE: BN;
|
|
2928
|
-
|
|
2929
3120
|
declare enum UtxoErrorCode {
|
|
2930
3121
|
NEGATIVE_LAMPORTS = "NEGATIVE_LAMPORTS",
|
|
2931
3122
|
NOT_U64 = "NOT_U64",
|
|
@@ -4020,4 +4211,4 @@ type LightSystemProgram = {
|
|
|
4020
4211
|
};
|
|
4021
4212
|
declare const IDL: LightSystemProgram;
|
|
4022
4213
|
|
|
4023
|
-
export { ADDRESS_QUEUE_ROLLOVER_FEE, ADDRESS_TREE_NETWORK_FEE, ALICE, AccountProofResult, type ActiveTreeBundle, type AddressWithTree, AppendLeavesInputLayout, AppendNullifyCreateAddressInputsMetaLayout, type BN254, BOB, BalanceResult, CHARLIE, COMPUTE_BUDGET_PATTERN, type ClientSubscriptionId, type CompressedAccount, type CompressedAccountData, CompressedAccountLayout, CompressedAccountResult, type CompressedAccountWithMerkleContext, CompressedAccountsByOwnerResult, type CompressedCpiContext, type CompressedMintTokenHolders, CompressedMintTokenHoldersResult, type CompressedProof, type CompressedProofWithContext, CompressedTokenAccountResult, CompressedTokenAccountsByOwnerOrDelegateResult, type CompressedTransaction, CompressedTransactionResult, type CompressionApiInterface, CreateUtxoError, CreateUtxoErrorCode, DAVE, DEFAULT_MERKLE_TREE_HEIGHT, DEFAULT_MERKLE_TREE_ROOTS, DEFAULT_ZERO, type EventWithParsedTokenTlvData, FIELD_SIZE, type GetCompressedAccountConfig, type GetCompressedAccountsByOwnerConfig, type GetCompressedAccountsConfig, type GetCompressedAccountsFilter, type GetCompressedTokenAccountsByOwnerOrDelegateOptions, HIGHEST_ADDRESS_PLUS_ONE, HashError, HashErrorCode, type HashWithTree, HealthResult, type HexBatchInputsForProver, type HexInputsForProver, IDL, INSERT_INTO_QUEUES_DISCRIMINATOR, INVOKE_CPI_DISCRIMINATOR, INVOKE_DISCRIMINATOR, IndexedArray, IndexedElement, IndexedElementBundle, type InputTokenDataWithContext, InsertAddressInputLayout, InsertNullifierInputLayout, type InstructionDataInvoke, type InstructionDataInvokeCpi, InstructionDataInvokeCpiLayout, InstructionDataInvokeLayout, type LatestNonVotingSignatures, type LatestNonVotingSignaturesPaginated, LatestNonVotingSignaturesResult, LatestNonVotingSignaturesResultPaginated, LightSystemProgram$1 as LightSystemProgram, type LightSystemProgram as LightSystemProgramIDL, type LightWasm, LookupTableError, LookupTableErrorCode, MerkeProofResult, type MerkleContext, MerkleContextLayout, type MerkleContextWithMerkleProof, type MerkleContextWithNewAddressProof, MerkleTree, MerkleTreeError, MerkleTreeErrorCode, type MerkleTreeSequenceNumber, MerkleTreeSequenceNumberLayout, MultipleCompressedAccountsResult, MultipleMerkleProofsResult, NativeBalanceResult, type NewAddressParams, NewAddressParamsLayout, type NewAddressParamsPacked, NewAddressProofResult, type NonInclusionJsonStruct, type NonInclusionMerkleProofInputs, type OutputCompressedAccountWithPackedContext, type PackedCompressedAccountWithMerkleContext, type PackedMerkleContext, type PaginatedOptions, type ParsedTokenAccount, ProofError, ProofErrorCode, type PublicTransactionEvent, PublicTransactionEventLayout, type QueueIndex, Rpc, RpcError, RpcErrorCode, type RpcResult, type RpcResultError, type RpcResultSuccess, STATE_MERKLE_TREE_NETWORK_FEE, STATE_MERKLE_TREE_ROLLOVER_FEE, SelectInUtxosError, SelectInUtxosErrorCode, SignatureListResult, SignatureListWithCursorResult, type SignatureWithMetadata, SlotResult, type StateTreeLUTPair, TRANSACTION_MERKLE_TREE_ROLLOVER_THRESHOLD, TestRpc, type TestRpcConfig, type TokenBalance, TokenBalanceListResult, TokenBalanceListResultV2, TokenBalanceResult, type TokenData$1 as TokenData, TokenDataLayout, TokenDataResult, TreeType, UTXO_MERGE_MAXIMUM, UTXO_MERGE_THRESHOLD, UtilsError, UtilsErrorCode, UtxoError, UtxoErrorCode, ValidityProofResult, type WithContext, type WithCursor, type WithRpcContext, accountCompressionProgram, addressQueue, addressTree, airdropSol, bn, bufToDecStr, buildAndSignTx, buildTx, byteArrayToKeypair, calculateComputeUnitPrice, checkValidityProofShape, compress, confirmConfig, confirmTransaction, confirmTx, convertMerkleProofsWithContextToHex, convertNonInclusionMerkleProofInputsToHex, convertToPublicTransactionEvent, cpiContext2Pubkey, cpiContextPubkey, createAccount, createAccountWithLamports, createBN254, createCompressedAccount, createCompressedAccountWithMerkleContext, createMerkleContext, createRpc, createRpcResult, createStateTreeLookupTable, decodeInstructionDataInvoke, decodeInstructionDataInvokeCpi, decodePublicTransactionEvent, decompress, dedupeSigner, deepEqual, defaultStateTreeLookupTables, defaultStaticAccounts, defaultStaticAccountsStruct, defaultTestStateTreeAccounts, defaultTestStateTreeAccounts2, deriveAddress, deriveAddressSeed, deserializeAppendNullifyCreateAddressInputsIndexer, encodeBN254toBase58, encodeInstructionDataInvoke, encodePublicTransactionEvent, extendStateTreeLookupTable, getAccountCompressionAuthority, getCompressedTokenAccountByHashTest, getCompressedTokenAccounts, getCompressedTokenAccountsByDelegateTest, getCompressedTokenAccountsByOwnerTest, getConnection,
|
|
4214
|
+
export { ADDRESS_QUEUE_ROLLOVER_FEE, ADDRESS_TREE_NETWORK_FEE, ALICE, AccountProofResult, type ActiveTreeBundle, type AddressTreeInfo, type AddressWithTree, type AddressWithTreeInfo, AppendLeavesInputLayout, AppendNullifyCreateAddressInputsMetaLayout, type BN254, BOB, BalanceResult, CHARLIE, COMPRESSED_TOKEN_PROGRAM_ID, COMPUTE_BUDGET_PATTERN, type ClientSubscriptionId, type CompressedAccount, type CompressedAccountData, CompressedAccountLayout, CompressedAccountResult, type CompressedAccountWithMerkleContext, CompressedAccountsByOwnerResult, type CompressedCpiContext, type CompressedMintTokenHolders, CompressedMintTokenHoldersResult, type CompressedProof, type CompressedProofWithContext, CompressedTokenAccountResult, CompressedTokenAccountsByOwnerOrDelegateResult, type CompressedTransaction, CompressedTransactionResult, type CompressionApiInterface, CreateUtxoError, CreateUtxoErrorCode, DAVE, DEFAULT_MERKLE_TREE_HEIGHT, DEFAULT_MERKLE_TREE_ROOTS, DEFAULT_ZERO, type EventWithParsedTokenTlvData, FIELD_SIZE, type GetCompressedAccountConfig, type GetCompressedAccountsByOwnerConfig, type GetCompressedAccountsConfig, type GetCompressedAccountsFilter, type GetCompressedTokenAccountsByOwnerOrDelegateOptions, HIGHEST_ADDRESS_PLUS_ONE, HashError, HashErrorCode, type HashWithTree, type HashWithTreeInfo, HealthResult, type HexBatchInputsForProver, type HexInputsForProver, IDL, INSERT_INTO_QUEUES_DISCRIMINATOR, INVOKE_CPI_DISCRIMINATOR, INVOKE_DISCRIMINATOR, IndexedArray, IndexedElement, IndexedElementBundle, type InputTokenDataWithContext, InsertAddressInputLayout, InsertNullifierInputLayout, type InstructionDataInvoke, type InstructionDataInvokeCpi, InstructionDataInvokeCpiLayout, InstructionDataInvokeLayout, type LatestNonVotingSignatures, type LatestNonVotingSignaturesPaginated, LatestNonVotingSignaturesResult, LatestNonVotingSignaturesResultPaginated, LightSystemProgram$1 as LightSystemProgram, type LightSystemProgram as LightSystemProgramIDL, type LightWasm, LookupTableError, LookupTableErrorCode, MerkeProofResult, type MerkleContext, MerkleContextLayout, type MerkleContextLegacy, type MerkleContextWithMerkleProof, type MerkleContextWithNewAddressProof, MerkleTree, MerkleTreeError, MerkleTreeErrorCode, type MerkleTreeSequenceNumber, MerkleTreeSequenceNumberLayout, MultipleCompressedAccountsResult, MultipleMerkleProofsResult, NativeBalanceResult, type NewAddressParams, NewAddressParamsLayout, type NewAddressParamsPacked, NewAddressProofResult, type NonInclusionJsonStruct, type NonInclusionMerkleProofInputs, type OutputCompressedAccountWithPackedContext, type PackedCompressedAccountWithMerkleContext, type PackedMerkleContext, type PaginatedOptions, type ParsedTokenAccount, ProofError, ProofErrorCode, type PublicTransactionEvent, PublicTransactionEventLayout, type QueueIndex, Rpc, RpcError, RpcErrorCode, type RpcResult, type RpcResultError, type RpcResultSuccess, STATE_MERKLE_TREE_NETWORK_FEE, STATE_MERKLE_TREE_ROLLOVER_FEE, SelectInUtxosError, SelectInUtxosErrorCode, SignatureListResult, SignatureListWithCursorResult, type SignatureWithMetadata, SlotResult, type StateTreeInfo, type StateTreeLUTPair, TRANSACTION_MERKLE_TREE_ROLLOVER_THRESHOLD, TestRpc, type TestRpcConfig, type TokenBalance, TokenBalanceListResult, TokenBalanceListResultV2, TokenBalanceResult, type TokenData$1 as TokenData, TokenDataLayout, TokenDataResult, TreeType, UTXO_MERGE_MAXIMUM, UTXO_MERGE_THRESHOLD, UtilsError, UtilsErrorCode, UtxoError, UtxoErrorCode, type ValidityProof, ValidityProofResult, type ValidityProofWithContext, type WithContext, type WithCursor, type WithRpcContext, accountCompressionProgram, addressQueue, addressTree, airdropSol, bn, bufToDecStr, buildAndSignTx, buildTx, byteArrayToKeypair, calculateComputeUnitPrice, checkValidityProofShape, compress, confirmConfig, confirmTransaction, confirmTx, convertMerkleProofsWithContextToHex, convertNonInclusionMerkleProofInputsToHex, convertToPublicTransactionEvent, cpiContext2Pubkey, cpiContextPubkey, createAccount, createAccountWithLamports, createBN254, createCompressedAccount, createCompressedAccountWithMerkleContext, createMerkleContext, createRpc, createRpcResult, createStateTreeLookupTable, decodeInstructionDataInvoke, decodeInstructionDataInvokeCpi, decodePublicTransactionEvent, decompress, dedupeSigner, deepEqual, defaultStateTreeLookupTables, defaultStaticAccounts, defaultStaticAccountsStruct, defaultTestStateTreeAccounts, defaultTestStateTreeAccounts2, deriveAddress, deriveAddressSeed, deserializeAppendNullifyCreateAddressInputsIndexer, encodeBN254toBase58, encodeInstructionDataInvoke, encodePublicTransactionEvent, extendStateTreeLookupTable, getAccountCompressionAuthority, getAllStateTreeInfos, getCompressedTokenAccountByHashTest, getCompressedTokenAccounts, getCompressedTokenAccountsByDelegateTest, getCompressedTokenAccountsByOwnerTest, getConnection, getDefaultAddressTreeInfo, getIndexOrAdd, getParsedEvents, getPublicInputHash, getRegisteredProgramPda, getTestKeypair, getTestRpc, getTreeForQueue, hashToBn254FieldSizeBe, hashvToBn254FieldSizeBe, invokeAccountsLayout, type invokeAccountsLayoutParams, isLocalTest, isSmallerThanBn254FieldSizeBe, jsonRpcResult, jsonRpcResultAndContext, lightProgram, localTestActiveStateTreeInfo, merkleTree2Pubkey, merkletreePubkey, negateAndCompressProof, newAccountWithLamports, noopProgram, nullifiedStateTreeLookupTableDevnet, nullifiedStateTreeLookupTableMainnet, nullifierQueue2Pubkey, nullifierQueuePubkey, nullifyLookupTable, packCompressedAccounts, packNewAddressParams, padOutputStateMerkleTrees, parseAccountData, parseEvents, parseLightTransaction, parsePublicTransactionEventWithIdl, parseTokenLayoutWithIdl, pickRandomTreeAndQueue, pipe, placeholderValidityProof, proofFromJsonStruct, proverRequest, pushUniqueItems, rpcRequest, selectMinCompressedSolAccountsForTransfer, selectStateTreeInfo, sendAndConfirmTx, sleep, stateTreeLookupTableDevnet, stateTreeLookupTableMainnet, sumUpLamports, toAccountMetas, toArray, toCamelCase, toHex, toUnixTimestamp, transfer, validateNumbers, validateNumbersForInclusionProof, validateNumbersForNonInclusionProof, validateNumbersForProof, validateSameOwner, validateSufficientBalance, wrapBigNumbersAsStrings };
|