@lightprotocol/stateless.js 0.22.1-alpha.0 → 0.22.1-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -1
- package/dist/cjs/browser/constants.d.ts +41 -7
- package/dist/cjs/browser/index.cjs +1 -1
- package/dist/cjs/browser/index.cjs.map +1 -1
- package/dist/cjs/browser/index.d.ts +0 -1
- package/dist/cjs/browser/programs/system/pack.d.ts +10 -79
- package/dist/cjs/browser/rpc-interface.d.ts +371 -277
- package/dist/cjs/browser/rpc.d.ts +79 -12
- package/dist/cjs/browser/test-helpers/test-rpc/get-compressed-token-accounts.d.ts +0 -2
- package/dist/cjs/browser/test-helpers/test-rpc/test-rpc.d.ts +12 -6
- package/dist/cjs/browser/utils/address.d.ts +7 -19
- package/dist/cjs/browser/utils/conversion.d.ts +1 -1
- package/dist/cjs/browser/utils/get-state-tree-infos.d.ts +15 -0
- package/dist/cjs/browser/utils/index.d.ts +2 -1
- package/dist/cjs/browser/utils/instruction.d.ts +35 -0
- package/dist/cjs/browser/utils/pack-decompress.d.ts +31 -0
- package/dist/cjs/node/constants.d.ts +41 -7
- package/dist/cjs/node/index.cjs +1 -1
- package/dist/cjs/node/index.cjs.map +1 -1
- package/dist/cjs/node/index.d.ts +0 -1
- package/dist/cjs/node/programs/system/pack.d.ts +10 -79
- package/dist/cjs/node/rpc-interface.d.ts +371 -277
- package/dist/cjs/node/rpc.d.ts +79 -12
- package/dist/cjs/node/test-helpers/test-rpc/get-compressed-token-accounts.d.ts +0 -2
- package/dist/cjs/node/test-helpers/test-rpc/test-rpc.d.ts +12 -6
- package/dist/cjs/node/utils/address.d.ts +7 -19
- package/dist/cjs/node/utils/conversion.d.ts +1 -1
- package/dist/cjs/node/utils/get-state-tree-infos.d.ts +15 -0
- package/dist/cjs/node/utils/index.d.ts +2 -1
- package/dist/cjs/node/utils/instruction.d.ts +35 -0
- package/dist/cjs/node/utils/pack-decompress.d.ts +31 -0
- package/dist/es/browser/actions/compress.d.ts +18 -0
- package/dist/es/browser/actions/create-account.d.ts +38 -0
- package/dist/es/browser/actions/decompress.d.ts +15 -0
- package/dist/es/browser/actions/index.d.ts +5 -0
- package/dist/es/browser/actions/transfer.d.ts +16 -0
- package/dist/es/browser/constants.d.ts +176 -0
- package/dist/es/browser/errors.d.ts +74 -0
- package/dist/es/browser/index.d.ts +9 -0
- package/dist/es/browser/index.js +2 -0
- package/dist/es/browser/index.js.map +1 -0
- package/dist/es/browser/programs/index.d.ts +1 -0
- package/dist/es/browser/programs/system/idl.d.ts +997 -0
- package/dist/es/browser/programs/system/index.d.ts +5 -0
- package/dist/es/browser/programs/system/layout.d.ts +77 -0
- package/dist/es/browser/programs/system/pack.d.ts +74 -0
- package/dist/es/browser/programs/system/program.d.ts +175 -0
- package/dist/es/browser/programs/system/select-compressed-accounts.d.ts +10 -0
- package/dist/es/browser/rpc-interface.d.ts +2873 -0
- package/dist/es/browser/rpc.d.ts +361 -0
- package/dist/es/browser/state/BN254.d.ts +13 -0
- package/dist/es/browser/state/bn.d.ts +3 -0
- package/dist/es/browser/state/compressed-account.d.ts +205 -0
- package/dist/es/browser/state/index.d.ts +4 -0
- package/dist/es/browser/state/types.d.ts +449 -0
- package/dist/es/browser/test-helpers/index.d.ts +3 -0
- package/dist/es/browser/test-helpers/merkle-tree/index.d.ts +2 -0
- package/dist/es/browser/test-helpers/merkle-tree/indexed-array.d.ts +85 -0
- package/dist/es/browser/test-helpers/merkle-tree/merkle-tree.d.ts +92 -0
- package/dist/es/browser/test-helpers/test-rpc/get-compressed-accounts.d.ts +7 -0
- package/dist/es/browser/test-helpers/test-rpc/get-compressed-token-accounts.d.ts +38 -0
- package/dist/es/browser/test-helpers/test-rpc/get-parsed-events.d.ts +15 -0
- package/dist/es/browser/test-helpers/test-rpc/index.d.ts +3 -0
- package/dist/es/browser/test-helpers/test-rpc/test-rpc.d.ts +245 -0
- package/dist/es/browser/test-helpers/test-utils.d.ts +31 -0
- package/dist/es/browser/utils/address.d.ts +64 -0
- package/dist/es/browser/utils/airdrop.d.ts +7 -0
- package/dist/es/browser/utils/calculate-compute-unit-price.d.ts +7 -0
- package/dist/es/browser/utils/conversion.d.ts +36 -0
- package/dist/es/browser/utils/dedupe-signer.d.ts +3 -0
- package/dist/es/browser/utils/get-state-tree-infos.d.ts +63 -0
- package/dist/es/browser/utils/index.d.ts +14 -0
- package/dist/es/browser/utils/instruction.d.ts +35 -0
- package/dist/es/browser/utils/pack-decompress.d.ts +31 -0
- package/dist/es/browser/utils/parse-validity-proof.d.ts +20 -0
- package/dist/es/browser/utils/pipe.d.ts +2 -0
- package/dist/es/browser/utils/send-and-confirm.d.ts +52 -0
- package/dist/es/browser/utils/sleep.d.ts +1 -0
- package/dist/es/browser/utils/state-tree-lookup-table.d.ts +68 -0
- package/dist/es/browser/utils/validation.d.ts +8 -0
- package/dist/types/index.d.ts +340 -661
- package/package.json +18 -10
- package/dist/cjs/browser/compressible/action.d.ts +0 -77
- package/dist/cjs/browser/compressible/index.d.ts +0 -13
- package/dist/cjs/browser/compressible/instruction.d.ts +0 -177
- package/dist/cjs/browser/compressible/layout.d.ts +0 -47
- package/dist/cjs/browser/compressible/types.d.ts +0 -112
- package/dist/cjs/browser/compressible/utils.d.ts +0 -16
- package/dist/cjs/browser/utils/packed-accounts.d.ts +0 -161
- package/dist/cjs/node/compressible/action.d.ts +0 -77
- package/dist/cjs/node/compressible/index.d.ts +0 -13
- package/dist/cjs/node/compressible/instruction.d.ts +0 -177
- package/dist/cjs/node/compressible/layout.d.ts +0 -47
- package/dist/cjs/node/compressible/types.d.ts +0 -112
- package/dist/cjs/node/compressible/utils.d.ts +0 -16
- package/dist/cjs/node/utils/packed-accounts.d.ts +0 -161
package/dist/types/index.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import * as _solana_web3_js from '@solana/web3.js';
|
|
2
|
-
import { PublicKey, Connection, Commitment, Keypair, Signer, TransactionInstruction, AddressLookupTableAccount, VersionedTransaction, ConfirmOptions, TransactionSignature, RpcResponseAndContext, SignatureResult,
|
|
2
|
+
import { PublicKey, Connection, Commitment, Keypair, Signer, AccountMeta, TransactionInstruction, AddressLookupTableAccount, VersionedTransaction, ConfirmOptions, TransactionSignature, RpcResponseAndContext, SignatureResult, DataSlice, MemcmpFilter, GetAccountInfoConfig, AccountInfo, SignaturesForAddressOptions, ConfirmedSignatureInfo, TokenAmount, ConnectionConfig, ParsedTransactionWithMeta } 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';
|
|
6
6
|
import * as buffer_layout from 'buffer-layout';
|
|
7
|
-
import * as borsh from '@coral-xyz/borsh';
|
|
8
7
|
import { Layout } from '@coral-xyz/borsh';
|
|
9
8
|
|
|
10
9
|
/**
|
|
@@ -21,30 +20,18 @@ declare function encodeBN254toBase58(bigintNumber: BN): string;
|
|
|
21
20
|
|
|
22
21
|
declare const bn: (number: string | number | BN | Buffer$1 | Uint8Array | number[], base?: number | "hex" | undefined, endian?: BN.Endianness | undefined) => BN;
|
|
23
22
|
|
|
24
|
-
/**
|
|
25
|
-
* Derive an address for a compressed account from a seed and an address Merkle
|
|
26
|
-
* tree public key.
|
|
27
|
-
*
|
|
28
|
-
* @param seed 32 bytes seed to derive the address from
|
|
29
|
-
* @param addressMerkleTreePubkey Address Merkle tree public key as bytes.
|
|
30
|
-
* @param programIdBytes Program ID bytes.
|
|
31
|
-
* @returns Derived address as bytes
|
|
32
|
-
*/
|
|
33
|
-
declare function deriveAddressV2(seed: Uint8Array, addressMerkleTreePubkey: Uint8Array, programIdBytes: Uint8Array): Uint8Array;
|
|
34
|
-
declare function hashVWithBumpSeed(bytes: Uint8Array[]): Uint8Array;
|
|
35
23
|
declare function deriveAddressSeed(seeds: Uint8Array[], programId: PublicKey): Uint8Array;
|
|
24
|
+
declare function deriveAddress(seed: Uint8Array, addressMerkleTreePubkey?: PublicKey): PublicKey;
|
|
25
|
+
declare function deriveAddressSeedV2(seeds: Uint8Array[]): Uint8Array;
|
|
36
26
|
/**
|
|
37
|
-
*
|
|
27
|
+
* Derives an address from a seed using the v2 method (matching Rust's derive_address_from_seed)
|
|
38
28
|
*
|
|
39
|
-
*
|
|
40
|
-
* tree public key
|
|
41
|
-
*
|
|
42
|
-
* @param seed Seed to derive the address from
|
|
43
|
-
* @param addressMerkleTreePubkey Merkle tree public key. Defaults to
|
|
44
|
-
* defaultTestStateTreeAccounts().addressTree
|
|
29
|
+
* @param addressSeed The address seed (32 bytes)
|
|
30
|
+
* @param addressMerkleTreePubkey Merkle tree public key
|
|
31
|
+
* @param programId Program ID
|
|
45
32
|
* @returns Derived address
|
|
46
33
|
*/
|
|
47
|
-
declare function
|
|
34
|
+
declare function deriveAddressV2(addressSeed: Uint8Array, addressMerkleTreePubkey: PublicKey, programId: PublicKey): PublicKey;
|
|
48
35
|
interface NewAddressParams {
|
|
49
36
|
/**
|
|
50
37
|
* Seed for the compressed account. Must be seed used to derive
|
|
@@ -131,8 +118,8 @@ declare const toCamelCase: (object: any) => any;
|
|
|
131
118
|
* @deprecated Use `hashvToBn254FieldSizeBe` instead.
|
|
132
119
|
*/
|
|
133
120
|
declare function hashToBn254FieldSizeBe(bytes: Buffer$1): [Buffer$1, number] | null;
|
|
121
|
+
declare function hashvToBn254FieldSizeBeU8Array(bytes: Uint8Array[]): Uint8Array;
|
|
134
122
|
/**
|
|
135
|
-
* TODO: make consistent with latest rust. (use u8::max bumpseed)
|
|
136
123
|
* Hash the provided `bytes` with Keccak256 and ensure that the result fits in
|
|
137
124
|
* the BN254 prime field by truncating the resulting hash to 31 bytes.
|
|
138
125
|
*
|
|
@@ -148,6 +135,41 @@ declare function convertInvokeCpiWithReadOnlyToInvoke(data: any): InstructionDat
|
|
|
148
135
|
/** @internal remove signer from signers if part of signers */
|
|
149
136
|
declare function dedupeSigner(signer: Signer, signers: Signer[]): Signer[];
|
|
150
137
|
|
|
138
|
+
declare class PackedAccounts {
|
|
139
|
+
private preAccounts;
|
|
140
|
+
private systemAccounts;
|
|
141
|
+
private nextIndex;
|
|
142
|
+
private map;
|
|
143
|
+
static newWithSystemAccounts(config: SystemAccountMetaConfig): PackedAccounts;
|
|
144
|
+
static newWithSystemAccountsV2(config: SystemAccountMetaConfig): PackedAccounts;
|
|
145
|
+
addPreAccountsSigner(pubkey: PublicKey): void;
|
|
146
|
+
addPreAccountsSignerMut(pubkey: PublicKey): void;
|
|
147
|
+
addPreAccountsMeta(accountMeta: AccountMeta): void;
|
|
148
|
+
addSystemAccounts(config: SystemAccountMetaConfig): void;
|
|
149
|
+
addSystemAccountsV2(config: SystemAccountMetaConfig): void;
|
|
150
|
+
insertOrGet(pubkey: PublicKey): number;
|
|
151
|
+
insertOrGetReadOnly(pubkey: PublicKey): number;
|
|
152
|
+
insertOrGetConfig(pubkey: PublicKey, isSigner: boolean, isWritable: boolean): number;
|
|
153
|
+
private hashSetAccountsToMetas;
|
|
154
|
+
private getOffsets;
|
|
155
|
+
toAccountMetas(): {
|
|
156
|
+
remainingAccounts: AccountMeta[];
|
|
157
|
+
systemStart: number;
|
|
158
|
+
packedStart: number;
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
declare class SystemAccountMetaConfig {
|
|
162
|
+
selfProgram: PublicKey;
|
|
163
|
+
cpiContext?: PublicKey;
|
|
164
|
+
solCompressionRecipient?: PublicKey;
|
|
165
|
+
solPoolPda?: PublicKey;
|
|
166
|
+
private constructor();
|
|
167
|
+
static new(selfProgram: PublicKey): SystemAccountMetaConfig;
|
|
168
|
+
static newWithCpiContext(selfProgram: PublicKey, cpiContext: PublicKey): SystemAccountMetaConfig;
|
|
169
|
+
}
|
|
170
|
+
declare function getLightSystemAccountMetas(config: SystemAccountMetaConfig): AccountMeta[];
|
|
171
|
+
declare function getLightSystemAccountMetasV2(config: SystemAccountMetaConfig): AccountMeta[];
|
|
172
|
+
|
|
151
173
|
interface GnarkProofJson {
|
|
152
174
|
ar: string[];
|
|
153
175
|
bs: string[][];
|
|
@@ -357,10 +379,24 @@ declare const isLocalTest: (url: string) => boolean;
|
|
|
357
379
|
* @internal
|
|
358
380
|
*/
|
|
359
381
|
declare const localTestActiveStateTreeInfos: () => TreeInfo[];
|
|
382
|
+
declare const getDefaultAddressSpace: () => {
|
|
383
|
+
tree: PublicKey;
|
|
384
|
+
queue: PublicKey;
|
|
385
|
+
cpiContext: undefined;
|
|
386
|
+
treeType: TreeType;
|
|
387
|
+
nextTreeInfo: null;
|
|
388
|
+
};
|
|
360
389
|
declare const getDefaultAddressTreeInfo: () => {
|
|
361
390
|
tree: PublicKey;
|
|
362
391
|
queue: PublicKey;
|
|
363
|
-
cpiContext:
|
|
392
|
+
cpiContext: undefined;
|
|
393
|
+
treeType: TreeType;
|
|
394
|
+
nextTreeInfo: null;
|
|
395
|
+
};
|
|
396
|
+
declare const getBatchAddressTreeInfo: () => {
|
|
397
|
+
tree: PublicKey;
|
|
398
|
+
queue: PublicKey;
|
|
399
|
+
cpiContext: undefined;
|
|
364
400
|
treeType: TreeType;
|
|
365
401
|
nextTreeInfo: null;
|
|
366
402
|
};
|
|
@@ -385,6 +421,7 @@ declare const defaultTestStateTreeAccounts2: () => {
|
|
|
385
421
|
merkleTree2: PublicKey;
|
|
386
422
|
};
|
|
387
423
|
declare const COMPRESSED_TOKEN_PROGRAM_ID: PublicKey;
|
|
424
|
+
declare const CTOKEN_PROGRAM_ID: PublicKey;
|
|
388
425
|
declare const stateTreeLookupTableMainnet = "7i86eQs3GSqHjN47WdWLTCGMW6gde1q96G2EVnUyK2st";
|
|
389
426
|
declare const nullifiedStateTreeLookupTableMainnet = "H9QD4u1fG7KmkAzn2tDXhheushxFe1EcrjGGyEFXeMqT";
|
|
390
427
|
declare const stateTreeLookupTableDevnet = "Dk9mNkbiZXJZ4By8DfSP6HEE4ojZzRvucwpawLeuwq8q";
|
|
@@ -394,13 +431,28 @@ declare const cpiContextPubkey = "cpi1uHzrEhBG733DoEJNgHCyRS3XmmyVNZx5fonubE4";
|
|
|
394
431
|
declare const merkletreePubkey = "smt1NamzXdq4AMqS2fS2F1i5KTYPZRhoHgWx38d8WsT";
|
|
395
432
|
declare const addressTree = "amt1Ayt45jfbdw5YSo7iz6WZxUmnZsQTYXy82hVwyC2";
|
|
396
433
|
declare const addressQueue = "aq1S9z4reTSQAdgWHGD2zDaS39sjGrAxbR31vxJ2F4F";
|
|
397
|
-
declare const addressTreeV2: PublicKey;
|
|
398
434
|
declare const merkleTree2Pubkey = "smt2rJAFdyJJupwMKAqTNAJwvjhmiZ4JYGZmbVRw1Ho";
|
|
399
435
|
declare const nullifierQueue2Pubkey = "nfq2hgS7NYemXsFaFUCe3EMXSDSfnZnAe27jC6aPP1X";
|
|
400
436
|
declare const cpiContext2Pubkey = "cpi2cdhkH5roePvcudTgUL8ppEBfTay1desGh8G8QxK";
|
|
401
|
-
declare const
|
|
402
|
-
declare const
|
|
403
|
-
declare const
|
|
437
|
+
declare const batchMerkleTree1 = "bmt1LryLZUMmF7ZtqESaw7wifBXLfXHQYoE4GAmrahU";
|
|
438
|
+
declare const batchQueue1 = "oq1na8gojfdUhsfCpyjNt6h4JaDWtHf1yQj4koBWfto";
|
|
439
|
+
declare const batchCpiContext1 = "cpi15BoVPKgEPw5o8wc2T816GE7b378nMXnhH3Xbq4y";
|
|
440
|
+
declare const batchMerkleTree2 = "bmt2UxoBxB9xWev4BkLvkGdapsz6sZGkzViPNph7VFi";
|
|
441
|
+
declare const batchQueue2 = "oq2UkeMsJLfXt2QHzim242SUi3nvjJs8Pn7Eac9H9vg";
|
|
442
|
+
declare const batchCpiContext2 = "cpi2yGapXUR3As5SjnHBAVvmApNiLsbeZpF3euWnW6B";
|
|
443
|
+
declare const batchMerkleTree3 = "bmt3ccLd4bqSVZVeCJnH1F6C8jNygAhaDfxDwePyyGb";
|
|
444
|
+
declare const batchQueue3 = "oq3AxjekBWgo64gpauB6QtuZNesuv19xrhaC1ZM1THQ";
|
|
445
|
+
declare const batchCpiContext3 = "cpi3mbwMpSX8FAGMZVP85AwxqCaQMfEk9Em1v8QK9Rf";
|
|
446
|
+
declare const batchMerkleTree4 = "bmt4d3p1a4YQgk9PeZv5s4DBUmbF5NxqYpk9HGjQsd8";
|
|
447
|
+
declare const batchQueue4 = "oq4ypwvVGzCUMoiKKHWh4S1SgZJ9vCvKpcz6RT6A8dq";
|
|
448
|
+
declare const batchCpiContext4 = "cpi4yyPDc4bCgHAnsenunGA8Y77j3XEDyjgfyCKgcoc";
|
|
449
|
+
declare const batchMerkleTree5 = "bmt5yU97jC88YXTuSukYHa8Z5Bi2ZDUtmzfkDTA2mG2";
|
|
450
|
+
declare const batchQueue5 = "oq5oh5ZR3yGomuQgFduNDzjtGvVWfDRGLuDVjv9a96P";
|
|
451
|
+
declare const batchCpiContext5 = "cpi5ZTjdgYpZ1Xr7B1cMLLUE81oTtJbNNAyKary2nV6";
|
|
452
|
+
declare const batchAddressTree = "amt2kaJA14v3urZbZvnc5v2np8jqvc4Z8zDep5wbtzx";
|
|
453
|
+
declare const testBatchAddressTree = "EzKE84aVTkCUhDHLELqyJaq1Y7UVVmqxXqZjVHwHY3rK";
|
|
454
|
+
declare const batchMerkleTree = "bmt1LryLZUMmF7ZtqESaw7wifBXLfXHQYoE4GAmrahU";
|
|
455
|
+
declare const batchQueue = "oq1na8gojfdUhsfCpyjNt6h4JaDWtHf1yQj4koBWfto";
|
|
404
456
|
declare const confirmConfig: ConfirmOptions;
|
|
405
457
|
declare const DEFAULT_MERKLE_TREE_HEIGHT = 26;
|
|
406
458
|
declare const DEFAULT_MERKLE_TREE_ROOTS = 2800;
|
|
@@ -433,10 +485,28 @@ declare const ADDRESS_QUEUE_ROLLOVER_FEE: BN;
|
|
|
433
485
|
*/
|
|
434
486
|
declare const STATE_MERKLE_TREE_NETWORK_FEE: BN;
|
|
435
487
|
/**
|
|
436
|
-
* Is charged
|
|
488
|
+
* Is charged per address the transaction creates.
|
|
489
|
+
*/
|
|
490
|
+
declare const ADDRESS_TREE_NETWORK_FEE_V1: BN;
|
|
491
|
+
/**
|
|
492
|
+
* Is charged per address the transaction creates.
|
|
437
493
|
*/
|
|
438
|
-
declare const
|
|
494
|
+
declare const ADDRESS_TREE_NETWORK_FEE_V2: BN;
|
|
439
495
|
|
|
496
|
+
/**
|
|
497
|
+
* Get the currently active output queue from a merkle context.
|
|
498
|
+
*
|
|
499
|
+
* @param merkleContext The merkle context to get the output queue from
|
|
500
|
+
* @returns The output queue public key
|
|
501
|
+
*/
|
|
502
|
+
declare function getOutputQueue(merkleContext: MerkleContext): PublicKey;
|
|
503
|
+
/**
|
|
504
|
+
* Get the currently active output tree info from a merkle context.
|
|
505
|
+
*
|
|
506
|
+
* @param merkleContext The merkle context to get the output tree info from
|
|
507
|
+
* @returns The output tree info
|
|
508
|
+
*/
|
|
509
|
+
declare function getOutputTreeInfo(merkleContext: MerkleContext): TreeInfo;
|
|
440
510
|
/**
|
|
441
511
|
* @deprecated use {@link getTreeInfoByPubkey} instead
|
|
442
512
|
*/
|
|
@@ -483,166 +553,34 @@ declare function getAllStateTreeInfos({ connection, stateTreeLUTPairs, }: {
|
|
|
483
553
|
stateTreeLUTPairs: StateTreeLUTPair[];
|
|
484
554
|
}): Promise<TreeInfo[]>;
|
|
485
555
|
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
* - Includes: LightSystemProgram, Authority, RegisteredProgramPda, NoopProgram,
|
|
491
|
-
* AccountCompressionAuthority, AccountCompressionProgram, InvokingProgram,
|
|
492
|
-
* [Optional: SolPoolPda, DecompressionRecipient], SystemProgram, [Optional: CpiContext]
|
|
493
|
-
*
|
|
494
|
-
* 2. PackedAccountsSmall - Matches CpiAccountsSmall (9 system accounts max)
|
|
495
|
-
* - Includes: LightSystemProgram, Authority, RegisteredProgramPda,
|
|
496
|
-
* AccountCompressionAuthority, AccountCompressionProgram, SystemProgram,
|
|
497
|
-
* [Optional: SolPoolPda, DecompressionRecipient, CpiContext]
|
|
498
|
-
* - Excludes: NoopProgram and InvokingProgram for a more compact structure
|
|
499
|
-
*/
|
|
500
|
-
/**
|
|
501
|
-
* Create a PackedAccounts instance to pack the light protocol system accounts
|
|
502
|
-
* for your custom program instruction. Typically, you will append them to the
|
|
503
|
-
* end of your instruction's accounts / remainingAccounts.
|
|
504
|
-
*
|
|
505
|
-
* This matches the full CpiAccounts structure with 11 system accounts including
|
|
506
|
-
* NoopProgram and InvokingProgram. For a more compact version, use PackedAccountsSmall.
|
|
507
|
-
*
|
|
508
|
-
* @example
|
|
509
|
-
* ```ts
|
|
510
|
-
* const packedAccounts = PackedAccounts.newWithSystemAccounts(config);
|
|
511
|
-
*
|
|
512
|
-
* const instruction = new TransactionInstruction({
|
|
513
|
-
* keys: [...yourInstructionAccounts, ...packedAccounts.toAccountMetas()],
|
|
514
|
-
* programId: selfProgram,
|
|
515
|
-
* data: data,
|
|
516
|
-
* });
|
|
517
|
-
* ```
|
|
518
|
-
*/
|
|
519
|
-
declare class PackedAccounts {
|
|
520
|
-
private preAccounts;
|
|
521
|
-
private systemAccounts;
|
|
522
|
-
private nextIndex;
|
|
523
|
-
private map;
|
|
524
|
-
static newWithSystemAccounts(config: SystemAccountMetaConfig): PackedAccounts;
|
|
525
|
-
addPreAccountsSigner(pubkey: PublicKey): void;
|
|
526
|
-
addPreAccountsSignerMut(pubkey: PublicKey): void;
|
|
527
|
-
addPreAccountsMeta(accountMeta: AccountMeta): void;
|
|
528
|
-
addSystemAccounts(config: SystemAccountMetaConfig): void;
|
|
529
|
-
insertOrGet(pubkey: PublicKey): number;
|
|
530
|
-
insertOrGetReadOnly(pubkey: PublicKey): number;
|
|
531
|
-
insertOrGetConfig(pubkey: PublicKey, isSigner: boolean, isWritable: boolean): number;
|
|
532
|
-
private hashSetAccountsToMetas;
|
|
533
|
-
private getOffsets;
|
|
534
|
-
toAccountMetas(): {
|
|
535
|
-
remainingAccounts: AccountMeta[];
|
|
536
|
-
systemStart: number;
|
|
537
|
-
packedStart: number;
|
|
538
|
-
};
|
|
539
|
-
}
|
|
540
|
-
/**
|
|
541
|
-
* Creates a PackedAccounts instance with system accounts for the specified
|
|
542
|
-
* program. This is a convenience wrapper around SystemAccountMetaConfig.new()
|
|
543
|
-
* and PackedAccounts.newWithSystemAccounts().
|
|
544
|
-
*
|
|
545
|
-
* @param programId - The program ID that will be using these system accounts
|
|
546
|
-
* @returns A new PackedAccounts instance with system accounts configured
|
|
547
|
-
*
|
|
548
|
-
* @example
|
|
549
|
-
* ```ts
|
|
550
|
-
* const packedAccounts = createPackedAccounts(myProgram.programId);
|
|
551
|
-
*
|
|
552
|
-
* const instruction = new TransactionInstruction({
|
|
553
|
-
* keys: [...yourInstructionAccounts, ...packedAccounts.toAccountMetas().remainingAccounts],
|
|
554
|
-
* programId: myProgram.programId,
|
|
555
|
-
* data: instructionData,
|
|
556
|
-
* });
|
|
557
|
-
* ```
|
|
558
|
-
*/
|
|
559
|
-
declare function createPackedAccounts(programId: PublicKey): PackedAccounts;
|
|
560
|
-
/**
|
|
561
|
-
* Creates a PackedAccounts instance with system accounts and CPI context for the specified program.
|
|
562
|
-
* This is a convenience wrapper that includes CPI context configuration.
|
|
563
|
-
*
|
|
564
|
-
* @param programId - The program ID that will be using these system accounts
|
|
565
|
-
* @param cpiContext - The CPI context account public key
|
|
566
|
-
* @returns A new PackedAccounts instance with system accounts and CPI context configured
|
|
567
|
-
*
|
|
568
|
-
* @example
|
|
569
|
-
* ```ts
|
|
570
|
-
* const packedAccounts = createPackedAccountsWithCpiContext(
|
|
571
|
-
* myProgram.programId,
|
|
572
|
-
* cpiContextAccount
|
|
573
|
-
* );
|
|
574
|
-
* ```
|
|
575
|
-
*/
|
|
576
|
-
declare function createPackedAccountsWithCpiContext(programId: PublicKey, cpiContext: PublicKey): PackedAccounts;
|
|
577
|
-
declare class SystemAccountMetaConfig {
|
|
578
|
-
selfProgram: PublicKey;
|
|
579
|
-
cpiContext?: PublicKey;
|
|
580
|
-
solCompressionRecipient?: PublicKey;
|
|
581
|
-
solPoolPda?: PublicKey;
|
|
582
|
-
private constructor();
|
|
583
|
-
static new(selfProgram: PublicKey): SystemAccountMetaConfig;
|
|
584
|
-
static newWithCpiContext(selfProgram: PublicKey, cpiContext: PublicKey): SystemAccountMetaConfig;
|
|
556
|
+
interface AccountDataWithTreeInfo {
|
|
557
|
+
key: string;
|
|
558
|
+
data: any;
|
|
559
|
+
treeInfo: TreeInfo;
|
|
585
560
|
}
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
*/
|
|
590
|
-
declare function getLightSystemAccountMetas(config: SystemAccountMetaConfig): AccountMeta[];
|
|
591
|
-
/**
|
|
592
|
-
* PackedAccountsSmall matches the CpiAccountsSmall structure with simplified account ordering.
|
|
593
|
-
* This is a more compact version that excludes NoopProgram and InvokingProgram.
|
|
594
|
-
*/
|
|
595
|
-
declare class PackedAccountsSmall {
|
|
596
|
-
private preAccounts;
|
|
597
|
-
private systemAccounts;
|
|
598
|
-
private nextIndex;
|
|
599
|
-
private map;
|
|
600
|
-
static newWithSystemAccounts(config: SystemAccountMetaConfig): PackedAccountsSmall;
|
|
601
|
-
/**
|
|
602
|
-
* Returns the internal map of pubkey to [index, AccountMeta].
|
|
603
|
-
* For debugging purposes only.
|
|
604
|
-
*/
|
|
605
|
-
getNamedMetas(): Map<string, [number, AccountMeta]>;
|
|
606
|
-
addPreAccountsSigner(pubkey: PublicKey): void;
|
|
607
|
-
addPreAccountsSignerMut(pubkey: PublicKey): void;
|
|
608
|
-
addPreAccountsMeta(accountMeta: AccountMeta): void;
|
|
609
|
-
addSystemAccounts(config: SystemAccountMetaConfig): void;
|
|
610
|
-
insertOrGet(pubkey: PublicKey): number;
|
|
611
|
-
insertOrGetReadOnly(pubkey: PublicKey): number;
|
|
612
|
-
insertOrGetConfig(pubkey: PublicKey, isSigner: boolean, isWritable: boolean): number;
|
|
613
|
-
private hashSetAccountsToMetas;
|
|
614
|
-
private getOffsets;
|
|
615
|
-
toAccountMetas(): {
|
|
616
|
-
remainingAccounts: AccountMeta[];
|
|
617
|
-
systemStart: number;
|
|
618
|
-
packedStart: number;
|
|
561
|
+
interface PackedDecompressResult {
|
|
562
|
+
proofOption: {
|
|
563
|
+
0: ValidityProof | null;
|
|
619
564
|
};
|
|
565
|
+
compressedAccounts: any[];
|
|
566
|
+
systemAccountsOffset: number;
|
|
567
|
+
remainingAccounts: AccountMeta[];
|
|
620
568
|
}
|
|
621
569
|
/**
|
|
622
|
-
*
|
|
623
|
-
* This
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
*
|
|
628
|
-
*
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
/**
|
|
632
|
-
* Creates a PackedAccountsSmall instance with system accounts and CPI context.
|
|
570
|
+
* Pack accounts and proof for decompressAccountsIdempotent instruction.
|
|
571
|
+
* This function prepares compressed account data, validity proof, and remaining accounts
|
|
572
|
+
* for idempotent decompression operations.
|
|
573
|
+
*
|
|
574
|
+
* @param programId - The program ID
|
|
575
|
+
* @param proof - The validity proof with context
|
|
576
|
+
* @param accountsData - Array of account data with tree info
|
|
577
|
+
* @param addresses - Array of account addresses
|
|
578
|
+
* @returns Packed instruction parameters
|
|
633
579
|
*/
|
|
634
|
-
declare function
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
accountCompressionProgram: PublicKey;
|
|
639
|
-
accountCompressionAuthority: PublicKey;
|
|
640
|
-
registeredProgramPda: PublicKey;
|
|
641
|
-
noopProgram: PublicKey;
|
|
642
|
-
solPoolPda: PublicKey;
|
|
643
|
-
private constructor();
|
|
644
|
-
static default(): SystemAccountPubkeys;
|
|
645
|
-
}
|
|
580
|
+
declare function packDecompressAccountsIdempotent(programId: PublicKey, proof: {
|
|
581
|
+
compressedProof: ValidityProof | null;
|
|
582
|
+
treeInfos: TreeInfo[];
|
|
583
|
+
}, accountsData: AccountDataWithTreeInfo[], addresses: PublicKey[]): Promise<PackedDecompressResult>;
|
|
646
584
|
|
|
647
585
|
declare enum TreeType {
|
|
648
586
|
/**
|
|
@@ -790,7 +728,7 @@ interface CompressedAccountLegacy {
|
|
|
790
728
|
/**
|
|
791
729
|
* Optional data attached to the account.
|
|
792
730
|
*/
|
|
793
|
-
data: CompressedAccountData
|
|
731
|
+
data: CompressedAccountData | null;
|
|
794
732
|
}
|
|
795
733
|
/**
|
|
796
734
|
* @deprecated Use {@link CompressedAccountMeta} instead.
|
|
@@ -824,7 +762,7 @@ type NewAddressProofInput = {
|
|
|
824
762
|
/**
|
|
825
763
|
* Describes compressed account data.
|
|
826
764
|
*/
|
|
827
|
-
interface CompressedAccountData
|
|
765
|
+
interface CompressedAccountData {
|
|
828
766
|
/**
|
|
829
767
|
* 8 bytes.
|
|
830
768
|
*/
|
|
@@ -1119,7 +1057,7 @@ type CompressedAccount = {
|
|
|
1119
1057
|
/**
|
|
1120
1058
|
* Optional data attached to the account.
|
|
1121
1059
|
*/
|
|
1122
|
-
data: CompressedAccountData
|
|
1060
|
+
data: CompressedAccountData | null;
|
|
1123
1061
|
} & MerkleContext & {
|
|
1124
1062
|
/**
|
|
1125
1063
|
* Read only.
|
|
@@ -1281,11 +1219,11 @@ interface PackedCompressedAccountWithMerkleContext {
|
|
|
1281
1219
|
/**
|
|
1282
1220
|
* @deprecated use {@link createCompressedAccountMeta} instead.
|
|
1283
1221
|
*/
|
|
1284
|
-
declare const createCompressedAccountLegacy: (owner: PublicKey, lamports?: BN, data?: CompressedAccountData
|
|
1222
|
+
declare const createCompressedAccountLegacy: (owner: PublicKey, lamports?: BN, data?: CompressedAccountData, address?: number[]) => CompressedAccountLegacy;
|
|
1285
1223
|
/**
|
|
1286
1224
|
* @deprecated.
|
|
1287
1225
|
*/
|
|
1288
|
-
declare const createCompressedAccountWithMerkleContextLegacy: (merkleContext: MerkleContext, owner: PublicKey, lamports?: BN, data?: CompressedAccountData
|
|
1226
|
+
declare const createCompressedAccountWithMerkleContextLegacy: (merkleContext: MerkleContext, owner: PublicKey, lamports?: BN, data?: CompressedAccountData, address?: number[]) => CompressedAccountWithMerkleContext;
|
|
1289
1227
|
/**
|
|
1290
1228
|
* @deprecated use {@link createCompressedAccountMeta} instead.
|
|
1291
1229
|
*/
|
|
@@ -1372,6 +1310,14 @@ interface AddressWithTreeInfo {
|
|
|
1372
1310
|
address: BN254;
|
|
1373
1311
|
treeInfo: AddressTreeInfo;
|
|
1374
1312
|
}
|
|
1313
|
+
interface AddressWithTreeInfoV2 {
|
|
1314
|
+
address: Uint8Array;
|
|
1315
|
+
treeInfo: TreeInfo;
|
|
1316
|
+
}
|
|
1317
|
+
declare enum DerivationMode {
|
|
1318
|
+
compressible = "compressible",
|
|
1319
|
+
standard = "standard"
|
|
1320
|
+
}
|
|
1375
1321
|
interface CompressedTransaction {
|
|
1376
1322
|
compressionInfo: {
|
|
1377
1323
|
closedAccounts: {
|
|
@@ -2584,21 +2530,21 @@ declare const HealthResult: Struct<string, null>;
|
|
|
2584
2530
|
*/
|
|
2585
2531
|
declare const LatestNonVotingSignaturesResult: Struct<{
|
|
2586
2532
|
items: {
|
|
2533
|
+
signature: string;
|
|
2587
2534
|
error: string | null;
|
|
2588
2535
|
slot: number;
|
|
2589
|
-
signature: string;
|
|
2590
2536
|
blockTime: number;
|
|
2591
2537
|
}[];
|
|
2592
2538
|
}, {
|
|
2593
2539
|
items: Struct<{
|
|
2540
|
+
signature: string;
|
|
2594
2541
|
error: string | null;
|
|
2595
2542
|
slot: number;
|
|
2596
|
-
signature: string;
|
|
2597
2543
|
blockTime: number;
|
|
2598
2544
|
}[], Struct<{
|
|
2545
|
+
signature: string;
|
|
2599
2546
|
error: string | null;
|
|
2600
2547
|
slot: number;
|
|
2601
|
-
signature: string;
|
|
2602
2548
|
blockTime: number;
|
|
2603
2549
|
}, {
|
|
2604
2550
|
signature: Struct<string, null>;
|
|
@@ -2612,19 +2558,19 @@ declare const LatestNonVotingSignaturesResult: Struct<{
|
|
|
2612
2558
|
*/
|
|
2613
2559
|
declare const LatestNonVotingSignaturesResultPaginated: Struct<{
|
|
2614
2560
|
items: {
|
|
2615
|
-
slot: number;
|
|
2616
2561
|
signature: string;
|
|
2562
|
+
slot: number;
|
|
2617
2563
|
blockTime: number;
|
|
2618
2564
|
}[];
|
|
2619
2565
|
cursor: string | null;
|
|
2620
2566
|
}, {
|
|
2621
2567
|
items: Struct<{
|
|
2622
|
-
slot: number;
|
|
2623
2568
|
signature: string;
|
|
2569
|
+
slot: number;
|
|
2624
2570
|
blockTime: number;
|
|
2625
2571
|
}[], Struct<{
|
|
2626
|
-
slot: number;
|
|
2627
2572
|
signature: string;
|
|
2573
|
+
slot: number;
|
|
2628
2574
|
blockTime: number;
|
|
2629
2575
|
}, {
|
|
2630
2576
|
signature: Struct<string, null>;
|
|
@@ -2639,10 +2585,10 @@ declare const LatestNonVotingSignaturesResultPaginated: Struct<{
|
|
|
2639
2585
|
declare const MerkleProofResult: Struct<{
|
|
2640
2586
|
proof: BN[];
|
|
2641
2587
|
leafIndex: number;
|
|
2588
|
+
root: BN;
|
|
2642
2589
|
hash: BN;
|
|
2643
2590
|
merkleTree: PublicKey;
|
|
2644
2591
|
rootSeq: number;
|
|
2645
|
-
root: BN;
|
|
2646
2592
|
}, {
|
|
2647
2593
|
hash: Struct<BN, null>;
|
|
2648
2594
|
leafIndex: Struct<number, null>;
|
|
@@ -2658,9 +2604,9 @@ declare const MerkleProofResultV2: Struct<{
|
|
|
2658
2604
|
proof: BN[];
|
|
2659
2605
|
leafIndex: number;
|
|
2660
2606
|
proveByIndex: boolean;
|
|
2607
|
+
root: BN;
|
|
2661
2608
|
hash: BN;
|
|
2662
2609
|
rootSeq: number;
|
|
2663
|
-
root: BN;
|
|
2664
2610
|
treeContext: {
|
|
2665
2611
|
cpiContext: PublicKey | null;
|
|
2666
2612
|
tree: PublicKey;
|
|
@@ -2715,9 +2661,9 @@ declare const MerkleProofResultV2: Struct<{
|
|
|
2715
2661
|
declare const NewAddressProofResult: Struct<{
|
|
2716
2662
|
proof: BN[];
|
|
2717
2663
|
address: BN;
|
|
2664
|
+
root: BN;
|
|
2718
2665
|
merkleTree: PublicKey;
|
|
2719
2666
|
rootSeq: number;
|
|
2720
|
-
root: BN;
|
|
2721
2667
|
nextIndex: number;
|
|
2722
2668
|
lowerRangeAddress: BN;
|
|
2723
2669
|
higherRangeAddress: BN;
|
|
@@ -2797,8 +2743,8 @@ declare const ValidityProofResultV2: Struct<{
|
|
|
2797
2743
|
proveByIndex: boolean;
|
|
2798
2744
|
};
|
|
2799
2745
|
leafIndex: number;
|
|
2800
|
-
hash: BN;
|
|
2801
2746
|
root: BN;
|
|
2747
|
+
hash: BN;
|
|
2802
2748
|
}[];
|
|
2803
2749
|
addresses: {
|
|
2804
2750
|
address: BN;
|
|
@@ -2845,8 +2791,8 @@ declare const ValidityProofResultV2: Struct<{
|
|
|
2845
2791
|
proveByIndex: boolean;
|
|
2846
2792
|
};
|
|
2847
2793
|
leafIndex: number;
|
|
2848
|
-
hash: BN;
|
|
2849
2794
|
root: BN;
|
|
2795
|
+
hash: BN;
|
|
2850
2796
|
}[], Struct<{
|
|
2851
2797
|
merkleContext: {
|
|
2852
2798
|
cpiContext: PublicKey | null;
|
|
@@ -2865,8 +2811,8 @@ declare const ValidityProofResultV2: Struct<{
|
|
|
2865
2811
|
proveByIndex: boolean;
|
|
2866
2812
|
};
|
|
2867
2813
|
leafIndex: number;
|
|
2868
|
-
hash: BN;
|
|
2869
2814
|
root: BN;
|
|
2815
|
+
hash: BN;
|
|
2870
2816
|
}, {
|
|
2871
2817
|
hash: Struct<BN, null>;
|
|
2872
2818
|
root: Struct<BN, null>;
|
|
@@ -2979,17 +2925,17 @@ declare const ValidityProofResultV2: Struct<{
|
|
|
2979
2925
|
declare const MultipleMerkleProofsResult: Struct<{
|
|
2980
2926
|
proof: BN[];
|
|
2981
2927
|
leafIndex: number;
|
|
2928
|
+
root: BN;
|
|
2982
2929
|
hash: BN;
|
|
2983
2930
|
merkleTree: PublicKey;
|
|
2984
2931
|
rootSeq: number;
|
|
2985
|
-
root: BN;
|
|
2986
2932
|
}[], Struct<{
|
|
2987
2933
|
proof: BN[];
|
|
2988
2934
|
leafIndex: number;
|
|
2935
|
+
root: BN;
|
|
2989
2936
|
hash: BN;
|
|
2990
2937
|
merkleTree: PublicKey;
|
|
2991
2938
|
rootSeq: number;
|
|
2992
|
-
root: BN;
|
|
2993
2939
|
}, {
|
|
2994
2940
|
hash: Struct<BN, null>;
|
|
2995
2941
|
leafIndex: Struct<number, null>;
|
|
@@ -3005,9 +2951,9 @@ declare const MultipleMerkleProofsResultV2: Struct<{
|
|
|
3005
2951
|
proof: BN[];
|
|
3006
2952
|
leafIndex: number;
|
|
3007
2953
|
proveByIndex: boolean;
|
|
2954
|
+
root: BN;
|
|
3008
2955
|
hash: BN;
|
|
3009
2956
|
rootSeq: number;
|
|
3010
|
-
root: BN;
|
|
3011
2957
|
treeContext: {
|
|
3012
2958
|
cpiContext: PublicKey | null;
|
|
3013
2959
|
tree: PublicKey;
|
|
@@ -3024,9 +2970,9 @@ declare const MultipleMerkleProofsResultV2: Struct<{
|
|
|
3024
2970
|
proof: BN[];
|
|
3025
2971
|
leafIndex: number;
|
|
3026
2972
|
proveByIndex: boolean;
|
|
2973
|
+
root: BN;
|
|
3027
2974
|
hash: BN;
|
|
3028
2975
|
rootSeq: number;
|
|
3029
|
-
root: BN;
|
|
3030
2976
|
treeContext: {
|
|
3031
2977
|
cpiContext: PublicKey | null;
|
|
3032
2978
|
tree: PublicKey;
|
|
@@ -3150,8 +3096,8 @@ declare const CompressedMintTokenHoldersResult: Struct<{
|
|
|
3150
3096
|
}>;
|
|
3151
3097
|
declare const AccountProofResult: Struct<{
|
|
3152
3098
|
proof: number[][];
|
|
3153
|
-
hash: number[];
|
|
3154
3099
|
root: number[];
|
|
3100
|
+
hash: number[];
|
|
3155
3101
|
}, {
|
|
3156
3102
|
hash: Struct<number[], Struct<number, null>>;
|
|
3157
3103
|
root: Struct<number[], Struct<number, null>>;
|
|
@@ -3160,18 +3106,18 @@ declare const AccountProofResult: Struct<{
|
|
|
3160
3106
|
declare const toUnixTimestamp: (blockTime: string) => number;
|
|
3161
3107
|
declare const SignatureListResult: Struct<{
|
|
3162
3108
|
items: {
|
|
3163
|
-
slot: number;
|
|
3164
3109
|
signature: string;
|
|
3110
|
+
slot: number;
|
|
3165
3111
|
blockTime: number;
|
|
3166
3112
|
}[];
|
|
3167
3113
|
}, {
|
|
3168
3114
|
items: Struct<{
|
|
3169
|
-
slot: number;
|
|
3170
3115
|
signature: string;
|
|
3116
|
+
slot: number;
|
|
3171
3117
|
blockTime: number;
|
|
3172
3118
|
}[], Struct<{
|
|
3173
|
-
slot: number;
|
|
3174
3119
|
signature: string;
|
|
3120
|
+
slot: number;
|
|
3175
3121
|
blockTime: number;
|
|
3176
3122
|
}, {
|
|
3177
3123
|
blockTime: Struct<number, null>;
|
|
@@ -3181,19 +3127,19 @@ declare const SignatureListResult: Struct<{
|
|
|
3181
3127
|
}>;
|
|
3182
3128
|
declare const SignatureListWithCursorResult: Struct<{
|
|
3183
3129
|
items: {
|
|
3184
|
-
slot: number;
|
|
3185
3130
|
signature: string;
|
|
3131
|
+
slot: number;
|
|
3186
3132
|
blockTime: number;
|
|
3187
3133
|
}[];
|
|
3188
3134
|
cursor: string | null;
|
|
3189
3135
|
}, {
|
|
3190
3136
|
items: Struct<{
|
|
3191
|
-
slot: number;
|
|
3192
3137
|
signature: string;
|
|
3138
|
+
slot: number;
|
|
3193
3139
|
blockTime: number;
|
|
3194
3140
|
}[], Struct<{
|
|
3195
|
-
slot: number;
|
|
3196
3141
|
signature: string;
|
|
3142
|
+
slot: number;
|
|
3197
3143
|
blockTime: number;
|
|
3198
3144
|
}, {
|
|
3199
3145
|
blockTime: Struct<number, null>;
|
|
@@ -4050,6 +3996,15 @@ interface CompressionApiInterface {
|
|
|
4050
3996
|
getLatestCompressionSignatures(cursor?: string, limit?: number): Promise<LatestNonVotingSignaturesPaginated>;
|
|
4051
3997
|
getIndexerHealth(): Promise<string>;
|
|
4052
3998
|
getIndexerSlot(): Promise<number>;
|
|
3999
|
+
getAccountInfoInterface(address: PublicKey, programId: PublicKey, commitmentOrConfig?: Commitment | GetAccountInfoConfig, addressSpace?: TreeInfo): Promise<{
|
|
4000
|
+
accountInfo: AccountInfo<Buffer>;
|
|
4001
|
+
isCold: boolean;
|
|
4002
|
+
loadContext?: MerkleContext;
|
|
4003
|
+
} | null>;
|
|
4004
|
+
getSignaturesForAddressInterface(address: PublicKey, options?: SignaturesForAddressOptions, compressedOptions?: PaginatedOptions): Promise<SignaturesForAddressInterfaceResult>;
|
|
4005
|
+
getSignaturesForOwnerInterface(owner: PublicKey, options?: SignaturesForAddressOptions, compressedOptions?: PaginatedOptions): Promise<SignaturesForAddressInterfaceResult>;
|
|
4006
|
+
getTokenAccountBalanceInterface(address: PublicKey, owner: PublicKey, mint: PublicKey, commitment?: Commitment): Promise<UnifiedTokenBalance>;
|
|
4007
|
+
getBalanceInterface(address: PublicKey, commitment?: Commitment): Promise<UnifiedBalance>;
|
|
4053
4008
|
}
|
|
4054
4009
|
type RpcResultSuccess<T> = {
|
|
4055
4010
|
jsonrpc: '2.0';
|
|
@@ -4066,6 +4021,83 @@ type RpcResultError = {
|
|
|
4066
4021
|
};
|
|
4067
4022
|
};
|
|
4068
4023
|
type RpcResult<T> = RpcResultSuccess<T> | RpcResultError;
|
|
4024
|
+
/**
|
|
4025
|
+
* Source type for signature data.
|
|
4026
|
+
*/
|
|
4027
|
+
declare const SignatureSource: {
|
|
4028
|
+
/** From standard Solana RPC (getSignaturesForAddress) */
|
|
4029
|
+
readonly Solana: "solana";
|
|
4030
|
+
/** From compression indexer (getCompressionSignaturesFor*) */
|
|
4031
|
+
readonly Compressed: "compressed";
|
|
4032
|
+
};
|
|
4033
|
+
type SignatureSourceType = (typeof SignatureSource)[keyof typeof SignatureSource];
|
|
4034
|
+
/**
|
|
4035
|
+
* Unified signature info combining data from both Solana RPC and compression indexer.
|
|
4036
|
+
*
|
|
4037
|
+
* Design rationale:
|
|
4038
|
+
* - `sources` array indicates where this signature was found (can be both!)
|
|
4039
|
+
* - Primary data comes from Solana RPC when available (richer: err, memo, confirmationStatus)
|
|
4040
|
+
* - Compression-only signatures still included for complete transaction history
|
|
4041
|
+
*/
|
|
4042
|
+
interface UnifiedSignatureInfo {
|
|
4043
|
+
/** Transaction signature (base58) */
|
|
4044
|
+
signature: string;
|
|
4045
|
+
/** Slot when the transaction was processed */
|
|
4046
|
+
slot: number;
|
|
4047
|
+
/** Block time (unix timestamp), null if not available */
|
|
4048
|
+
blockTime: number | null;
|
|
4049
|
+
/** Transaction error, null if successful. Only from Solana RPC. */
|
|
4050
|
+
err: any | null;
|
|
4051
|
+
/** Memo data. Only from Solana RPC. */
|
|
4052
|
+
memo: string | null;
|
|
4053
|
+
/** Confirmation status. Only from Solana RPC. */
|
|
4054
|
+
confirmationStatus?: string;
|
|
4055
|
+
/**
|
|
4056
|
+
* Sources where this signature was found.
|
|
4057
|
+
* - ['solana'] = only in Solana RPC
|
|
4058
|
+
* - ['compressed'] = only in compression indexer
|
|
4059
|
+
* - ['solana', 'compressed'] = found in both (compression tx indexed by both)
|
|
4060
|
+
*/
|
|
4061
|
+
sources: SignatureSourceType[];
|
|
4062
|
+
}
|
|
4063
|
+
/**
|
|
4064
|
+
* Result of getSignaturesForAddressInterface / getSignaturesForOwnerInterface.
|
|
4065
|
+
*
|
|
4066
|
+
* Design rationale:
|
|
4067
|
+
* - `signatures`: Unified view, merged and deduplicated, sorted by slot desc
|
|
4068
|
+
* - `solana` / `compressed`: Raw responses preserved for clients that need source-specific data
|
|
4069
|
+
* - Allows callers to use the unified view OR drill into specific sources
|
|
4070
|
+
*/
|
|
4071
|
+
interface SignaturesForAddressInterfaceResult {
|
|
4072
|
+
/** Merged signatures from all sources, sorted by slot (descending) */
|
|
4073
|
+
signatures: UnifiedSignatureInfo[];
|
|
4074
|
+
/** Raw signatures from Solana RPC */
|
|
4075
|
+
solana: ConfirmedSignatureInfo[];
|
|
4076
|
+
/** Raw signatures from compression indexer */
|
|
4077
|
+
compressed: SignatureWithMetadata[];
|
|
4078
|
+
}
|
|
4079
|
+
/**
|
|
4080
|
+
* Unified token balance combining hot and cold token balances.
|
|
4081
|
+
*/
|
|
4082
|
+
interface UnifiedTokenBalance {
|
|
4083
|
+
/** Total balance (hot + cold) */
|
|
4084
|
+
amount: BN;
|
|
4085
|
+
/** True if any cold balance exists - call load() before usage */
|
|
4086
|
+
hasColdBalance: boolean;
|
|
4087
|
+
/** Token decimals (from on-chain mint or 0 if unknown) */
|
|
4088
|
+
decimals: number;
|
|
4089
|
+
/** Raw Solana RPC TokenAmount response, null if no on-chain account */
|
|
4090
|
+
solana: TokenAmount | null;
|
|
4091
|
+
}
|
|
4092
|
+
/**
|
|
4093
|
+
* Unified SOL balance combining hot and cold SOL balances.
|
|
4094
|
+
*/
|
|
4095
|
+
interface UnifiedBalance {
|
|
4096
|
+
/** Total balance (hot + cold) in lamports */
|
|
4097
|
+
total: BN;
|
|
4098
|
+
/** True if any cold balance exists - call load() before usage */
|
|
4099
|
+
hasColdBalance: boolean;
|
|
4100
|
+
}
|
|
4069
4101
|
|
|
4070
4102
|
interface TestRpcConfig {
|
|
4071
4103
|
/**
|
|
@@ -4145,6 +4177,10 @@ declare class TestRpc extends Connection implements CompressionApiInterface {
|
|
|
4145
4177
|
*/
|
|
4146
4178
|
getStateTreeInfos(): Promise<TreeInfo[]>;
|
|
4147
4179
|
doFetch(): Promise<TreeInfo[]>;
|
|
4180
|
+
/**
|
|
4181
|
+
* Get a V2 address tree info.
|
|
4182
|
+
*/
|
|
4183
|
+
getAddressTreeInfoV2(): Promise<TreeInfo>;
|
|
4148
4184
|
/**
|
|
4149
4185
|
* Fetch the compressed account for the specified account hash
|
|
4150
4186
|
*/
|
|
@@ -4294,10 +4330,12 @@ declare class TestRpc extends Connection implements CompressionApiInterface {
|
|
|
4294
4330
|
*/
|
|
4295
4331
|
getValidityProof(hashes?: BN254[], newAddresses?: BN254[]): Promise<ValidityProofWithContext>;
|
|
4296
4332
|
getValidityProofV0(hashes?: HashWithTree[], newAddresses?: AddressWithTree[]): Promise<ValidityProofWithContext>;
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4333
|
+
getValidityProofV2(accountMerkleContexts?: any[], newAddresses?: any[], derivationMode?: any): Promise<ValidityProofWithContext>;
|
|
4334
|
+
getAccountInfoInterface(_address: PublicKey, _programId: PublicKey, _addressSpaceInfo: any): Promise<any>;
|
|
4335
|
+
getSignaturesForAddressInterface(_address: PublicKey, _options?: any, _compressedOptions?: PaginatedOptions): Promise<any>;
|
|
4336
|
+
getSignaturesForOwnerInterface(_owner: PublicKey, _options?: any, _compressedOptions?: PaginatedOptions): Promise<any>;
|
|
4337
|
+
getTokenAccountBalanceInterface(_address: PublicKey, _owner: PublicKey, _mint: PublicKey, _commitment?: any): Promise<any>;
|
|
4338
|
+
getBalanceInterface(_address: PublicKey, _commitment?: any): Promise<any>;
|
|
4301
4339
|
}
|
|
4302
4340
|
|
|
4303
4341
|
declare class IndexedElement {
|
|
@@ -4495,7 +4533,6 @@ type TokenData = {
|
|
|
4495
4533
|
state: number;
|
|
4496
4534
|
tlv: Buffer | null;
|
|
4497
4535
|
};
|
|
4498
|
-
declare const TokenDataLayout: Layout<TokenData>;
|
|
4499
4536
|
type EventWithParsedTokenTlvData = {
|
|
4500
4537
|
inputCompressedAccountHashes: number[][];
|
|
4501
4538
|
outputCompressedAccounts: ParsedTokenAccount[];
|
|
@@ -4618,6 +4655,12 @@ interface NullifierMetadata {
|
|
|
4618
4655
|
nullifier: BN254;
|
|
4619
4656
|
txHash: BN254;
|
|
4620
4657
|
}
|
|
4658
|
+
/**
|
|
4659
|
+
* Merge signatures from Solana RPC and compression indexer.
|
|
4660
|
+
* Deduplicates by signature, tracking sources in the `sources` array.
|
|
4661
|
+
* When a signature exists in both, uses Solana data (richer) but marks both sources.
|
|
4662
|
+
*/
|
|
4663
|
+
declare function mergeSignatures(solanaSignatures: ConfirmedSignatureInfo[], compressedSignatures: SignatureWithMetadata[]): UnifiedSignatureInfo[];
|
|
4621
4664
|
/**
|
|
4622
4665
|
*
|
|
4623
4666
|
*/
|
|
@@ -4646,6 +4689,10 @@ declare class Rpc extends Connection implements CompressionApiInterface {
|
|
|
4646
4689
|
* @internal
|
|
4647
4690
|
*/
|
|
4648
4691
|
doFetch(): Promise<TreeInfo[]>;
|
|
4692
|
+
/**
|
|
4693
|
+
* Get a V2 address tree info.
|
|
4694
|
+
*/
|
|
4695
|
+
getAddressTreeInfoV2(): Promise<TreeInfo>;
|
|
4649
4696
|
/**
|
|
4650
4697
|
* Fetch the compressed account for the specified account address or hash
|
|
4651
4698
|
*/
|
|
@@ -4806,6 +4853,17 @@ declare class Rpc extends Connection implements CompressionApiInterface {
|
|
|
4806
4853
|
* @returns validity proof with context
|
|
4807
4854
|
*/
|
|
4808
4855
|
getValidityProofV0(hashes?: HashWithTree[], newAddresses?: AddressWithTree[]): Promise<ValidityProofWithContext>;
|
|
4856
|
+
/**
|
|
4857
|
+
* Fetch the latest validity proof for (1) compressed accounts specified by
|
|
4858
|
+
* an array of account Merkle contexts, and (2) new unique addresses specified by
|
|
4859
|
+
* an array of address objects with tree info.
|
|
4860
|
+
*
|
|
4861
|
+
* Validity proofs prove the presence of compressed accounts in state trees
|
|
4862
|
+
* and the non-existence of addresses in address trees, respectively. They
|
|
4863
|
+
* enable verification without recomputing the merkle proof path, thus
|
|
4864
|
+
* lowering verification and data costs.
|
|
4865
|
+
*/
|
|
4866
|
+
getValidityProofV2(accountMerkleContexts?: (MerkleContext | undefined)[], newAddresses?: AddressWithTreeInfoV2[], derivationMode?: DerivationMode): Promise<ValidityProofWithContext>;
|
|
4809
4867
|
/**
|
|
4810
4868
|
* Fetch the latest validity proof for (1) compressed accounts specified by
|
|
4811
4869
|
* an array of account hashes. (2) new unique addresses specified by an
|
|
@@ -4824,19 +4882,64 @@ declare class Rpc extends Connection implements CompressionApiInterface {
|
|
|
4824
4882
|
*/
|
|
4825
4883
|
getValidityProofAndRpcContext(hashes?: HashWithTree[], newAddresses?: AddressWithTree[]): Promise<WithContext<ValidityProofWithContext>>;
|
|
4826
4884
|
/**
|
|
4827
|
-
*
|
|
4828
|
-
*
|
|
4829
|
-
* @param
|
|
4830
|
-
* @param
|
|
4831
|
-
* @param
|
|
4885
|
+
* Fetch the account info for the specified public key. Returns metadata
|
|
4886
|
+
* to load in case the account is cold.
|
|
4887
|
+
* @param address The account address to fetch.
|
|
4888
|
+
* @param programId The owner program ID.
|
|
4889
|
+
* @param commitmentOrConfig Optional. The commitment or config to use
|
|
4890
|
+
* for the onchain account fetch.
|
|
4891
|
+
* @param addressSpace Optional. The address space info that was
|
|
4892
|
+
* used at init.
|
|
4832
4893
|
*
|
|
4833
|
-
* @returns
|
|
4834
|
-
*
|
|
4835
|
-
|
|
4836
|
-
|
|
4894
|
+
* @returns Account info with load info, or null if
|
|
4895
|
+
* account doesn't exist. LoadContext is always
|
|
4896
|
+
* some if the account is compressible. isCold
|
|
4897
|
+
* indicates the current state of the account,
|
|
4898
|
+
* if true the account must referenced in a
|
|
4899
|
+
* load instruction before use.
|
|
4900
|
+
*/
|
|
4901
|
+
getAccountInfoInterface(address: PublicKey, programId: PublicKey, commitmentOrConfig?: Commitment | GetAccountInfoConfig, addressSpace?: TreeInfo): Promise<{
|
|
4837
4902
|
accountInfo: AccountInfo<Buffer$1>;
|
|
4838
|
-
|
|
4903
|
+
isCold: boolean;
|
|
4904
|
+
loadContext?: MerkleContext;
|
|
4839
4905
|
} | null>;
|
|
4906
|
+
/**
|
|
4907
|
+
* Get signatures for an address from both Solana and compression indexer.
|
|
4908
|
+
*
|
|
4909
|
+
* @param address Address to fetch signatures for.
|
|
4910
|
+
* @param options Options for the Solana getSignaturesForAddress call.
|
|
4911
|
+
* @param compressedOptions Options for the compression getCompressionSignaturesForAddress call.
|
|
4912
|
+
* @returns Unified signatures from both sources.
|
|
4913
|
+
*/
|
|
4914
|
+
getSignaturesForAddressInterface(address: PublicKey, options?: SignaturesForAddressOptions, compressedOptions?: PaginatedOptions): Promise<SignaturesForAddressInterfaceResult>;
|
|
4915
|
+
/**
|
|
4916
|
+
* Get signatures for an owner from both Solana and compression indexer.
|
|
4917
|
+
*
|
|
4918
|
+
* @param owner Owner address to fetch signatures for.
|
|
4919
|
+
* @param options Options for the Solana getSignaturesForAddress call.
|
|
4920
|
+
* @param compressedOptions Options for the compression getCompressionSignaturesForOwner call.
|
|
4921
|
+
* @returns Unified signatures from both sources.
|
|
4922
|
+
*/
|
|
4923
|
+
getSignaturesForOwnerInterface(owner: PublicKey, options?: SignaturesForAddressOptions, compressedOptions?: PaginatedOptions): Promise<SignaturesForAddressInterfaceResult>;
|
|
4924
|
+
/**
|
|
4925
|
+
* Get token account balance for an address, regardless of whether the token
|
|
4926
|
+
* account is hot or cold.
|
|
4927
|
+
*
|
|
4928
|
+
* @param address Token account address.
|
|
4929
|
+
* @param owner Owner public key.
|
|
4930
|
+
* @param mint Mint public key.
|
|
4931
|
+
* @param commitment Commitment level for on-chain query.
|
|
4932
|
+
* @returns Unified token balance from both sources.
|
|
4933
|
+
*/
|
|
4934
|
+
getTokenAccountBalanceInterface(address: PublicKey, owner: PublicKey, mint: PublicKey, commitment?: Commitment): Promise<UnifiedTokenBalance>;
|
|
4935
|
+
/**
|
|
4936
|
+
* Get SOL balance for an address, regardless of whether the account is hot or cold.
|
|
4937
|
+
*
|
|
4938
|
+
* @param address Address to fetch balance for.
|
|
4939
|
+
* @param commitment Commitment level for on-chain query.
|
|
4940
|
+
* @returns Unified SOL balance.
|
|
4941
|
+
*/
|
|
4942
|
+
getBalanceInterface(address: PublicKey, commitment?: Commitment): Promise<UnifiedBalance>;
|
|
4840
4943
|
}
|
|
4841
4944
|
|
|
4842
4945
|
/**
|
|
@@ -6011,8 +6114,15 @@ declare function getIndexOrAdd(accountsArray: PublicKey[], key: PublicKey): numb
|
|
|
6011
6114
|
*/
|
|
6012
6115
|
declare function padOutputStateMerkleTrees(outputStateMerkleTrees: PublicKey, numberOfOutputCompressedAccounts: number): PublicKey[];
|
|
6013
6116
|
declare function toAccountMetas(remainingAccounts: PublicKey[]): AccountMeta[];
|
|
6117
|
+
interface PackedStateTreeInfos {
|
|
6118
|
+
packedTreeInfos: PackedStateTreeInfo[];
|
|
6119
|
+
outputTreeIndex: number;
|
|
6120
|
+
}
|
|
6121
|
+
interface PackedTreeInfos {
|
|
6122
|
+
stateTrees?: PackedStateTreeInfos;
|
|
6123
|
+
addressTrees: PackedAddressTreeInfo[];
|
|
6124
|
+
}
|
|
6014
6125
|
/**
|
|
6015
|
-
* @deprecated Use {@link packTreeInfos} instead.
|
|
6016
6126
|
* Packs TreeInfos. Replaces PublicKey with index pointer to remaining accounts.
|
|
6017
6127
|
*
|
|
6018
6128
|
* Only use for MUT, CLOSE, NEW_ADDRESSES. For INIT, pass
|
|
@@ -6028,7 +6138,7 @@ declare function toAccountMetas(remainingAccounts: PublicKey[]): AccountMeta[];
|
|
|
6028
6138
|
* @returns Remaining accounts, packed state and address tree infos, state tree
|
|
6029
6139
|
* output index and address tree infos.
|
|
6030
6140
|
*/
|
|
6031
|
-
declare function
|
|
6141
|
+
declare function packTreeInfos(remainingAccounts: PublicKey[], accountProofInputs: AccountProofInput[], newAddressProofInputs: NewAddressProofInput[]): PackedTreeInfos;
|
|
6032
6142
|
/**
|
|
6033
6143
|
* Packs Compressed Accounts.
|
|
6034
6144
|
*
|
|
@@ -6052,80 +6162,6 @@ declare function packCompressedAccounts(inputCompressedAccounts: CompressedAccou
|
|
|
6052
6162
|
packedOutputCompressedAccounts: OutputCompressedAccountWithPackedContext[];
|
|
6053
6163
|
remainingAccounts: PublicKey[];
|
|
6054
6164
|
};
|
|
6055
|
-
/**
|
|
6056
|
-
* Root index for state tree proofs.
|
|
6057
|
-
*/
|
|
6058
|
-
type RootIndex = {
|
|
6059
|
-
proofByIndex: boolean;
|
|
6060
|
-
rootIndex: number;
|
|
6061
|
-
};
|
|
6062
|
-
/**
|
|
6063
|
-
* Creates a RootIndex for proving by merkle proof.
|
|
6064
|
-
*/
|
|
6065
|
-
declare function createRootIndex(rootIndex: number): RootIndex;
|
|
6066
|
-
/**
|
|
6067
|
-
* Creates a RootIndex for proving by leaf index.
|
|
6068
|
-
*/
|
|
6069
|
-
declare function createRootIndexByIndex(): RootIndex;
|
|
6070
|
-
/**
|
|
6071
|
-
* Account proof inputs for state tree accounts.
|
|
6072
|
-
*/
|
|
6073
|
-
type AccountProofInputs = {
|
|
6074
|
-
hash: Uint8Array;
|
|
6075
|
-
root: Uint8Array;
|
|
6076
|
-
rootIndex: RootIndex;
|
|
6077
|
-
leafIndex: number;
|
|
6078
|
-
treeInfo: TreeInfo;
|
|
6079
|
-
};
|
|
6080
|
-
/**
|
|
6081
|
-
* Address proof inputs for address tree accounts.
|
|
6082
|
-
*/
|
|
6083
|
-
type AddressProofInputs = {
|
|
6084
|
-
address: Uint8Array;
|
|
6085
|
-
root: Uint8Array;
|
|
6086
|
-
rootIndex: number;
|
|
6087
|
-
treeInfo: TreeInfo;
|
|
6088
|
-
};
|
|
6089
|
-
/**
|
|
6090
|
-
* Validity proof with context structure that matches Rust implementation.
|
|
6091
|
-
*/
|
|
6092
|
-
type ValidityProofWithContextV2 = {
|
|
6093
|
-
proof: ValidityProof | null;
|
|
6094
|
-
accounts: AccountProofInputs[];
|
|
6095
|
-
addresses: AddressProofInputs[];
|
|
6096
|
-
};
|
|
6097
|
-
/**
|
|
6098
|
-
* Packed state tree infos.
|
|
6099
|
-
*/
|
|
6100
|
-
type PackedStateTreeInfos = {
|
|
6101
|
-
packedTreeInfos: PackedStateTreeInfo[];
|
|
6102
|
-
outputTreeIndex: number;
|
|
6103
|
-
};
|
|
6104
|
-
/**
|
|
6105
|
-
* Packed tree infos containing both state and address trees.
|
|
6106
|
-
*/
|
|
6107
|
-
type PackedTreeInfos = {
|
|
6108
|
-
stateTrees: PackedStateTreeInfos | null;
|
|
6109
|
-
addressTrees: PackedAddressTreeInfo[];
|
|
6110
|
-
};
|
|
6111
|
-
/**
|
|
6112
|
-
* Packs tree infos from ValidityProofWithContext into packed format. This is a
|
|
6113
|
-
* TypeScript equivalent of the Rust pack_tree_infos method.
|
|
6114
|
-
*
|
|
6115
|
-
* @param validityProof - The validity proof with context (flat format)
|
|
6116
|
-
* @param packedAccounts - The packed accounts manager (supports both PackedAccounts and PackedAccountsSmall)
|
|
6117
|
-
* @returns Packed tree infos
|
|
6118
|
-
*/
|
|
6119
|
-
declare function packTreeInfos(validityProof: ValidityProofWithContext, packedAccounts: PackedAccounts | PackedAccountsSmall): PackedTreeInfos;
|
|
6120
|
-
/**
|
|
6121
|
-
* Packs tree infos from ValidityProofWithContextV2 into packed format. This is
|
|
6122
|
-
* a TypeScript equivalent of the Rust pack_tree_infos method.
|
|
6123
|
-
*
|
|
6124
|
-
* @param validityProof - The validity proof with context (structured format)
|
|
6125
|
-
* @param packedAccounts - The packed accounts manager (supports both PackedAccounts and PackedAccountsSmall)
|
|
6126
|
-
* @returns Packed tree infos
|
|
6127
|
-
*/
|
|
6128
|
-
declare function packTreeInfos(validityProof: ValidityProofWithContextV2, packedAccounts: PackedAccounts | PackedAccountsSmall): PackedTreeInfos;
|
|
6129
6165
|
|
|
6130
6166
|
declare const sumUpLamports: (accounts: CompressedAccountWithMerkleContext[]) => BN;
|
|
6131
6167
|
/**
|
|
@@ -6381,361 +6417,4 @@ declare class MerkleTreeError extends MetaError {
|
|
|
6381
6417
|
declare class UtilsError extends MetaError {
|
|
6382
6418
|
}
|
|
6383
6419
|
|
|
6384
|
-
|
|
6385
|
-
* Standard instruction discriminators for compressible instructions
|
|
6386
|
-
* These match the Rust implementation discriminators
|
|
6387
|
-
*/
|
|
6388
|
-
declare const COMPRESSIBLE_DISCRIMINATORS: {
|
|
6389
|
-
readonly INITIALIZE_COMPRESSION_CONFIG: readonly [133, 228, 12, 169, 56, 76, 222, 61];
|
|
6390
|
-
readonly UPDATE_COMPRESSION_CONFIG: readonly [135, 215, 243, 81, 163, 146, 33, 70];
|
|
6391
|
-
readonly DECOMPRESS_ACCOUNTS_IDEMPOTENT: readonly [114, 67, 61, 123, 234, 31, 1, 112];
|
|
6392
|
-
};
|
|
6393
|
-
/**
|
|
6394
|
-
* Generic compressed account data structure for decompress operations
|
|
6395
|
-
* This is generic over the account variant type, allowing programs to use their specific enums
|
|
6396
|
-
*/
|
|
6397
|
-
type CompressedAccountData<T = any> = {
|
|
6398
|
-
/** The compressed account metadata containing tree info, address, and output index */
|
|
6399
|
-
meta: CompressedAccountMeta;
|
|
6400
|
-
/** Program-specific account variant enum */
|
|
6401
|
-
data: T;
|
|
6402
|
-
/** PDA seeds (without bump) used to derive the PDA address */
|
|
6403
|
-
seeds: Uint8Array[];
|
|
6404
|
-
};
|
|
6405
|
-
/**
|
|
6406
|
-
* Instruction data structure for decompress_accounts_idempotent
|
|
6407
|
-
* This matches the exact format expected by Anchor programs
|
|
6408
|
-
*/
|
|
6409
|
-
type DecompressMultipleAccountsIdempotentData<T = any> = {
|
|
6410
|
-
proof: ValidityProof;
|
|
6411
|
-
compressedAccounts: CompressedAccountData<T>[];
|
|
6412
|
-
bumps: number[];
|
|
6413
|
-
systemAccountsOffset: number;
|
|
6414
|
-
};
|
|
6415
|
-
/**
|
|
6416
|
-
* Instruction data for update compression config
|
|
6417
|
-
*/
|
|
6418
|
-
type UpdateCompressionConfigData = {
|
|
6419
|
-
newCompressionDelay: number | null;
|
|
6420
|
-
newRentRecipient: PublicKey | null;
|
|
6421
|
-
newAddressSpace: PublicKey[] | null;
|
|
6422
|
-
newUpdateAuthority: PublicKey | null;
|
|
6423
|
-
};
|
|
6424
|
-
/**
|
|
6425
|
-
* Generic instruction data for compress account
|
|
6426
|
-
* This matches the expected format for compress account instructions
|
|
6427
|
-
*/
|
|
6428
|
-
type GenericCompressAccountInstruction = {
|
|
6429
|
-
proof: ValidityProof;
|
|
6430
|
-
compressedAccountMeta: CompressedAccountMeta;
|
|
6431
|
-
};
|
|
6432
|
-
|
|
6433
|
-
/**
|
|
6434
|
-
* Borsh schema for updateCompressionConfig instruction data
|
|
6435
|
-
*/
|
|
6436
|
-
declare const UpdateCompressionConfigSchema: borsh.Layout<UpdateCompressionConfigData>;
|
|
6437
|
-
/**
|
|
6438
|
-
* Borsh schema for ValidityProof
|
|
6439
|
-
*/
|
|
6440
|
-
declare const ValidityProofSchema: borsh.Layout<ValidityProof>;
|
|
6441
|
-
/**
|
|
6442
|
-
* Borsh schema for PackedStateTreeInfo
|
|
6443
|
-
*/
|
|
6444
|
-
declare const PackedStateTreeInfoSchema: borsh.Layout<PackedStateTreeInfo>;
|
|
6445
|
-
/**
|
|
6446
|
-
* Borsh schema for CompressedAccountMeta
|
|
6447
|
-
*/
|
|
6448
|
-
declare const CompressedAccountMetaSchema: borsh.Layout<CompressedAccountMeta>;
|
|
6449
|
-
/**
|
|
6450
|
-
* Borsh schema for GenericCompressAccountInstruction
|
|
6451
|
-
*/
|
|
6452
|
-
declare const GenericCompressAccountInstructionSchema: borsh.Layout<GenericCompressAccountInstruction>;
|
|
6453
|
-
/**
|
|
6454
|
-
* Helper function to create borsh schema for CompressedAccountData
|
|
6455
|
-
* This is generic to work with any data type T
|
|
6456
|
-
*/
|
|
6457
|
-
declare function createCompressedAccountDataSchema<T>(dataSchema: borsh.Layout<T>): borsh.Layout<CompressedAccountData<T>>;
|
|
6458
|
-
/**
|
|
6459
|
-
* Helper function to create borsh schema for DecompressMultipleAccountsIdempotentData
|
|
6460
|
-
* This is generic to work with any data type T
|
|
6461
|
-
*/
|
|
6462
|
-
declare function createDecompressMultipleAccountsIdempotentDataSchema<T>(dataSchema: borsh.Layout<T>): borsh.Layout<DecompressMultipleAccountsIdempotentData<T>>;
|
|
6463
|
-
/**
|
|
6464
|
-
* Serialize instruction data with custom discriminator
|
|
6465
|
-
*/
|
|
6466
|
-
declare function serializeInstructionData<T>(schema: borsh.Layout<T>, data: T, discriminator: Uint8Array | number[]): Buffer;
|
|
6467
|
-
/**
|
|
6468
|
-
* Serialize instruction data for initializeCompressionConfig using Borsh
|
|
6469
|
-
*/
|
|
6470
|
-
declare function serializeInitializeCompressionConfigData(compressionDelay: number, rentRecipient: _solana_web3_js.PublicKey, addressSpace: _solana_web3_js.PublicKey[], configBump: number | null): Buffer;
|
|
6471
|
-
|
|
6472
|
-
/**
|
|
6473
|
-
* Create an instruction to initialize a compression config.
|
|
6474
|
-
*
|
|
6475
|
-
* @param programId Program ID for the compressible program
|
|
6476
|
-
* @param discriminator Instruction discriminator (8 bytes)
|
|
6477
|
-
* @param payer Fee payer
|
|
6478
|
-
* @param authority Program upgrade authority
|
|
6479
|
-
* @param compressionDelay Compression delay (in slots)
|
|
6480
|
-
* @param rentRecipient Rent recipient public key
|
|
6481
|
-
* @param addressSpace Array of address space public keys
|
|
6482
|
-
* @param configBump Optional config bump (defaults to 0)
|
|
6483
|
-
* @returns TransactionInstruction
|
|
6484
|
-
*/
|
|
6485
|
-
declare function createInitializeCompressionConfigInstruction(programId: PublicKey, discriminator: Uint8Array | number[], payer: PublicKey, authority: PublicKey, compressionDelay: number, rentRecipient: PublicKey, addressSpace: PublicKey[], configBump?: number | null): TransactionInstruction;
|
|
6486
|
-
/**
|
|
6487
|
-
* Create an instruction to update a compression config.
|
|
6488
|
-
*
|
|
6489
|
-
* @param programId Program ID for the compressible program
|
|
6490
|
-
* @param discriminator Instruction discriminator (8 bytes)
|
|
6491
|
-
* @param authority Current config authority
|
|
6492
|
-
* @param newCompressionDelay Optional new compression delay
|
|
6493
|
-
* @param newRentRecipient Optional new rent recipient
|
|
6494
|
-
* @param newAddressSpace Optional new address space array
|
|
6495
|
-
* @param newUpdateAuthority Optional new update authority
|
|
6496
|
-
* @returns TransactionInstruction
|
|
6497
|
-
*/
|
|
6498
|
-
declare function createUpdateCompressionConfigInstruction(programId: PublicKey, discriminator: Uint8Array | number[], authority: PublicKey, newCompressionDelay?: number | null, newRentRecipient?: PublicKey | null, newAddressSpace?: PublicKey[] | null, newUpdateAuthority?: PublicKey | null): TransactionInstruction;
|
|
6499
|
-
/**
|
|
6500
|
-
* Create an instruction to compress a generic compressible account.
|
|
6501
|
-
*
|
|
6502
|
-
* @param programId Program ID for the compressible program
|
|
6503
|
-
* @param discriminator Instruction discriminator (8 bytes)
|
|
6504
|
-
* @param payer Fee payer
|
|
6505
|
-
* @param pdaToCompress PDA to compress
|
|
6506
|
-
* @param rentRecipient Rent recipient public key
|
|
6507
|
-
* @param compressedAccountMeta Compressed account metadata
|
|
6508
|
-
* @param validityProof Validity proof for compression
|
|
6509
|
-
* @param systemAccounts Additional system accounts (optional)
|
|
6510
|
-
* @returns TransactionInstruction
|
|
6511
|
-
*/
|
|
6512
|
-
declare function createCompressAccountInstruction(programId: PublicKey, discriminator: Uint8Array | number[], payer: PublicKey, pdaToCompress: PublicKey, rentRecipient: PublicKey, compressedAccountMeta: CompressedAccountMeta, validityProof: ValidityProof, systemAccounts?: AccountMeta[]): TransactionInstruction;
|
|
6513
|
-
/**
|
|
6514
|
-
* Create an instruction to decompress one or more compressed accounts idempotently.
|
|
6515
|
-
*
|
|
6516
|
-
* @param programId Program ID for the compressible program
|
|
6517
|
-
* @param discriminator Instruction discriminator (8 bytes)
|
|
6518
|
-
* @param feePayer Fee payer
|
|
6519
|
-
* @param rentPayer Rent payer
|
|
6520
|
-
* @param solanaAccounts Array of PDA accounts to decompress
|
|
6521
|
-
* @param compressedAccountsData Array of compressed account data
|
|
6522
|
-
* @param bumps Array of PDA bumps
|
|
6523
|
-
* @param validityProof Validity proof for decompression
|
|
6524
|
-
* @param systemAccounts Additional system accounts (optional)
|
|
6525
|
-
* @param coder Borsh schema for account data
|
|
6526
|
-
* @returns TransactionInstruction
|
|
6527
|
-
*/
|
|
6528
|
-
declare function createDecompressAccountsIdempotentInstruction<T = any>(programId: PublicKey, discriminator: Uint8Array | number[], feePayer: PublicKey, rentPayer: PublicKey, solanaAccounts: PublicKey[], compressedAccountsData: CompressedAccountData<T>[], bumps: number[], validityProof: ValidityProof, systemAccounts: AccountMeta[] | undefined, coder: (data: any) => Buffer): TransactionInstruction;
|
|
6529
|
-
/**
|
|
6530
|
-
* Instruction builders for compressible accounts, following Solana SDK patterns.
|
|
6531
|
-
*/
|
|
6532
|
-
declare class CompressibleInstruction {
|
|
6533
|
-
/**
|
|
6534
|
-
* Create an instruction to initialize a compression config.
|
|
6535
|
-
*
|
|
6536
|
-
* @param programId Program ID for the compressible program
|
|
6537
|
-
* @param discriminator Instruction discriminator (8 bytes)
|
|
6538
|
-
* @param payer Fee payer
|
|
6539
|
-
* @param authority Program upgrade authority
|
|
6540
|
-
* @param compressionDelay Compression delay (in slots)
|
|
6541
|
-
* @param rentRecipient Rent recipient public key
|
|
6542
|
-
* @param addressSpace Array of address space public keys
|
|
6543
|
-
* @param configBump Optional config bump (defaults to 0)
|
|
6544
|
-
* @returns TransactionInstruction
|
|
6545
|
-
*/
|
|
6546
|
-
static initializeCompressionConfig(programId: PublicKey, discriminator: Uint8Array | number[], payer: PublicKey, authority: PublicKey, compressionDelay: number, rentRecipient: PublicKey, addressSpace: PublicKey[], configBump?: number | null): TransactionInstruction;
|
|
6547
|
-
/**
|
|
6548
|
-
* Create an instruction to update a compression config.
|
|
6549
|
-
*
|
|
6550
|
-
* @param programId Program ID for the compressible program
|
|
6551
|
-
* @param discriminator Instruction discriminator (8 bytes)
|
|
6552
|
-
* @param authority Current config authority
|
|
6553
|
-
* @param newCompressionDelay Optional new compression delay
|
|
6554
|
-
* @param newRentRecipient Optional new rent recipient
|
|
6555
|
-
* @param newAddressSpace Optional new address space array
|
|
6556
|
-
* @param newUpdateAuthority Optional new update authority
|
|
6557
|
-
* @returns TransactionInstruction
|
|
6558
|
-
*/
|
|
6559
|
-
static updateCompressionConfig(programId: PublicKey, discriminator: Uint8Array | number[], authority: PublicKey, newCompressionDelay?: number | null, newRentRecipient?: PublicKey | null, newAddressSpace?: PublicKey[] | null, newUpdateAuthority?: PublicKey | null): TransactionInstruction;
|
|
6560
|
-
/**
|
|
6561
|
-
* Create an instruction to compress a generic compressible account.
|
|
6562
|
-
*
|
|
6563
|
-
* @param programId Program ID for the compressible program
|
|
6564
|
-
* @param discriminator Instruction discriminator (8 bytes)
|
|
6565
|
-
* @param payer Fee payer
|
|
6566
|
-
* @param pdaToCompress PDA to compress
|
|
6567
|
-
* @param rentRecipient Rent recipient public key
|
|
6568
|
-
* @param compressedAccountMeta Compressed account metadata
|
|
6569
|
-
* @param validityProof Validity proof for compression
|
|
6570
|
-
* @param systemAccounts Additional system accounts (optional)
|
|
6571
|
-
* @returns TransactionInstruction
|
|
6572
|
-
*/
|
|
6573
|
-
static compressAccount(programId: PublicKey, discriminator: Uint8Array | number[], payer: PublicKey, pdaToCompress: PublicKey, rentRecipient: PublicKey, compressedAccountMeta: CompressedAccountMeta, validityProof: ValidityProof, systemAccounts?: AccountMeta[]): TransactionInstruction;
|
|
6574
|
-
/**
|
|
6575
|
-
* Create an instruction to decompress one or more compressed accounts idempotently.
|
|
6576
|
-
*
|
|
6577
|
-
* @param programId Program ID for the compressible program
|
|
6578
|
-
* @param discriminator Instruction discriminator (8 bytes)
|
|
6579
|
-
* @param feePayer Fee payer
|
|
6580
|
-
* @param rentPayer Rent payer
|
|
6581
|
-
* @param solanaAccounts Array of PDA accounts to decompress
|
|
6582
|
-
* @param compressedAccountsData Array of compressed account data
|
|
6583
|
-
* @param bumps Array of PDA bumps
|
|
6584
|
-
* @param validityProof Validity proof for decompression
|
|
6585
|
-
* @param systemAccounts Additional system accounts (optional)
|
|
6586
|
-
* @param dataSchema Borsh schema for account data
|
|
6587
|
-
* @returns TransactionInstruction
|
|
6588
|
-
*/
|
|
6589
|
-
static decompressAccountsIdempotent<T = any>(programId: PublicKey, discriminator: Uint8Array | number[], feePayer: PublicKey, rentPayer: PublicKey, solanaAccounts: PublicKey[], compressedAccountsData: CompressedAccountData<T>[], bumps: number[], validityProof: ValidityProof, systemAccounts?: AccountMeta[], dataSchema?: any): TransactionInstruction;
|
|
6590
|
-
/**
|
|
6591
|
-
* Standard instruction discriminators for compressible instructions
|
|
6592
|
-
*/
|
|
6593
|
-
static readonly DISCRIMINATORS: {
|
|
6594
|
-
readonly INITIALIZE_COMPRESSION_CONFIG: readonly [133, 228, 12, 169, 56, 76, 222, 61];
|
|
6595
|
-
readonly UPDATE_COMPRESSION_CONFIG: readonly [135, 215, 243, 81, 163, 146, 33, 70];
|
|
6596
|
-
readonly DECOMPRESS_ACCOUNTS_IDEMPOTENT: readonly [114, 67, 61, 123, 234, 31, 1, 112];
|
|
6597
|
-
};
|
|
6598
|
-
/**
|
|
6599
|
-
* Derive the compression config PDA address
|
|
6600
|
-
*
|
|
6601
|
-
* @param programId Program ID for the compressible program
|
|
6602
|
-
* @param configIndex Config index (defaults to 0)
|
|
6603
|
-
* @returns [PDA address, bump seed]
|
|
6604
|
-
*/
|
|
6605
|
-
static deriveCompressionConfigAddress(programId: PublicKey, configIndex?: number): [PublicKey, number];
|
|
6606
|
-
/**
|
|
6607
|
-
* Get the program data account address and its raw data for a given program
|
|
6608
|
-
*
|
|
6609
|
-
* @param programId Program ID
|
|
6610
|
-
* @param connection Solana connection
|
|
6611
|
-
* @returns Program data address and account info
|
|
6612
|
-
*/
|
|
6613
|
-
static getProgramDataAccount(programId: PublicKey, connection: _solana_web3_js.Connection): Promise<{
|
|
6614
|
-
programDataAddress: PublicKey;
|
|
6615
|
-
programDataAccountInfo: _solana_web3_js.AccountInfo<Buffer>;
|
|
6616
|
-
}>;
|
|
6617
|
-
/**
|
|
6618
|
-
* Check that the provided authority matches the program's upgrade authority
|
|
6619
|
-
*
|
|
6620
|
-
* @param programDataAccountInfo Program data account info
|
|
6621
|
-
* @param providedAuthority Authority to validate
|
|
6622
|
-
* @throws Error if authority doesn't match
|
|
6623
|
-
*/
|
|
6624
|
-
static checkProgramUpdateAuthority(programDataAccountInfo: _solana_web3_js.AccountInfo<Buffer>, providedAuthority: PublicKey): void;
|
|
6625
|
-
/**
|
|
6626
|
-
* Serialize instruction data for initializeCompressionConfig using Borsh
|
|
6627
|
-
*
|
|
6628
|
-
* @param compressionDelay Compression delay (in slots)
|
|
6629
|
-
* @param rentRecipient Rent recipient public key
|
|
6630
|
-
* @param addressSpace Array of address space public keys
|
|
6631
|
-
* @param configBump Optional config bump
|
|
6632
|
-
* @returns Serialized instruction data with discriminator
|
|
6633
|
-
*/
|
|
6634
|
-
static serializeInitializeCompressionConfigData(compressionDelay: number, rentRecipient: PublicKey, addressSpace: PublicKey[], configBump: number | null): Buffer;
|
|
6635
|
-
/**
|
|
6636
|
-
* Convert a compressed account to the format expected by instruction builders
|
|
6637
|
-
*
|
|
6638
|
-
* @param compressedAccount Compressed account from state
|
|
6639
|
-
* @param data Program-specific account data
|
|
6640
|
-
* @param seeds PDA seeds (without bump)
|
|
6641
|
-
* @param outputStateTreeIndex Output state tree index
|
|
6642
|
-
* @returns Compressed account data for instructions
|
|
6643
|
-
*/
|
|
6644
|
-
static createCompressedAccountData<T>(compressedAccount: CompressedAccount, data: T, seeds: Uint8Array[], outputStateTreeIndex: number): CompressedAccountData<T>;
|
|
6645
|
-
}
|
|
6646
|
-
|
|
6647
|
-
/**
|
|
6648
|
-
* Initialize a compression config for a compressible program
|
|
6649
|
-
*
|
|
6650
|
-
* @param rpc RPC connection to use
|
|
6651
|
-
* @param payer Fee payer
|
|
6652
|
-
* @param programId Program ID for the compressible program
|
|
6653
|
-
* @param authority Program upgrade authority
|
|
6654
|
-
* @param compressionDelay Compression delay (in slots)
|
|
6655
|
-
* @param rentRecipient Rent recipient public key
|
|
6656
|
-
* @param addressSpace Array of address space public keys
|
|
6657
|
-
* @param configBump Optional config bump (defaults to 0)
|
|
6658
|
-
* @param discriminator Optional custom discriminator (defaults to standard)
|
|
6659
|
-
* @param confirmOptions Options for confirming the transaction
|
|
6660
|
-
*
|
|
6661
|
-
* @return Signature of the confirmed transaction
|
|
6662
|
-
*/
|
|
6663
|
-
declare function initializeCompressionConfig(rpc: Rpc, payer: Signer, programId: PublicKey, authority: Signer, compressionDelay: number, rentRecipient: PublicKey, addressSpace: PublicKey[], configBump?: number | null, discriminator?: Uint8Array | number[], confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
6664
|
-
/**
|
|
6665
|
-
* Update a compression config for a compressible program
|
|
6666
|
-
*
|
|
6667
|
-
* @param rpc RPC connection to use
|
|
6668
|
-
* @param payer Fee payer
|
|
6669
|
-
* @param programId Program ID for the compressible program
|
|
6670
|
-
* @param authority Current config authority
|
|
6671
|
-
* @param newCompressionDelay Optional new compression delay
|
|
6672
|
-
* @param newRentRecipient Optional new rent recipient
|
|
6673
|
-
* @param newAddressSpace Optional new address space array
|
|
6674
|
-
* @param newUpdateAuthority Optional new update authority
|
|
6675
|
-
* @param discriminator Optional custom discriminator (defaults to standard)
|
|
6676
|
-
* @param confirmOptions Options for confirming the transaction
|
|
6677
|
-
*
|
|
6678
|
-
* @return Signature of the confirmed transaction
|
|
6679
|
-
*/
|
|
6680
|
-
declare function updateCompressionConfig(rpc: Rpc, payer: Signer, programId: PublicKey, authority: Signer, newCompressionDelay?: number | null, newRentRecipient?: PublicKey | null, newAddressSpace?: PublicKey[] | null, newUpdateAuthority?: PublicKey | null, discriminator?: Uint8Array | number[], confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
6681
|
-
/**
|
|
6682
|
-
* Compress a generic compressible account
|
|
6683
|
-
*
|
|
6684
|
-
* @param rpc RPC connection to use
|
|
6685
|
-
* @param payer Fee payer and signer
|
|
6686
|
-
* @param programId Program ID for the compressible program
|
|
6687
|
-
* @param pdaToCompress PDA to compress
|
|
6688
|
-
* @param rentRecipient Rent recipient public key
|
|
6689
|
-
* @param compressedAccountMeta Compressed account metadata
|
|
6690
|
-
* @param validityProof Validity proof for compression
|
|
6691
|
-
* @param systemAccounts Additional system accounts (trees, queues, etc.)
|
|
6692
|
-
* @param discriminator Custom instruction discriminator (8 bytes)
|
|
6693
|
-
* @param confirmOptions Options for confirming the transaction
|
|
6694
|
-
*
|
|
6695
|
-
* @return Signature of the confirmed transaction
|
|
6696
|
-
*/
|
|
6697
|
-
declare function compressAccount(rpc: Rpc, payer: Signer, programId: PublicKey, pdaToCompress: PublicKey, rentRecipient: PublicKey, compressedAccountMeta: CompressedAccountMeta, validityProof: ValidityProof, systemAccounts: AccountMeta[], discriminator: Uint8Array | number[], confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
6698
|
-
/**
|
|
6699
|
-
* Decompress one or more compressed accounts idempotently
|
|
6700
|
-
*
|
|
6701
|
-
* @param rpc RPC connection to use
|
|
6702
|
-
* @param payer Fee payer
|
|
6703
|
-
* @param programId Program ID for the compressible program
|
|
6704
|
-
* @param feePayer Fee payer (can be same as payer)
|
|
6705
|
-
* @param rentPayer Rent payer
|
|
6706
|
-
* @param solanaAccounts Array of PDA accounts to decompress
|
|
6707
|
-
* @param compressedAccountsData Array of compressed account data
|
|
6708
|
-
* @param bumps Array of PDA bumps
|
|
6709
|
-
* @param validityProof Validity proof for decompression
|
|
6710
|
-
* @param systemAccounts Additional system accounts (trees, queues, etc.)
|
|
6711
|
-
* @param dataSchema Borsh schema for account data serialization
|
|
6712
|
-
* @param discriminator Optional custom discriminator (defaults to standard)
|
|
6713
|
-
* @param confirmOptions Options for confirming the transaction
|
|
6714
|
-
*
|
|
6715
|
-
* @return Signature of the confirmed transaction
|
|
6716
|
-
*/
|
|
6717
|
-
declare function decompressAccountsIdempotent<T = any>(rpc: Rpc, payer: Signer, programId: PublicKey, feePayer: Signer, rentPayer: Signer, solanaAccounts: PublicKey[], compressedAccountsData: CompressedAccountData<T>[], bumps: number[], validityProof: ValidityProof, systemAccounts: AccountMeta[], dataSchema: any, // borsh.Layout<T>
|
|
6718
|
-
discriminator?: Uint8Array | number[], confirmOptions?: ConfirmOptions): Promise<TransactionSignature>;
|
|
6719
|
-
|
|
6720
|
-
/**
|
|
6721
|
-
* Derive the compression config PDA address
|
|
6722
|
-
*/
|
|
6723
|
-
declare function deriveCompressionConfigAddress(programId: PublicKey, configIndex?: number): [PublicKey, number];
|
|
6724
|
-
/**
|
|
6725
|
-
* Get the program data account address and its raw data for a given program.
|
|
6726
|
-
*/
|
|
6727
|
-
declare function getProgramDataAccount(programId: PublicKey, connection: Connection): Promise<{
|
|
6728
|
-
programDataAddress: PublicKey;
|
|
6729
|
-
programDataAccountInfo: AccountInfo<Buffer>;
|
|
6730
|
-
}>;
|
|
6731
|
-
/**
|
|
6732
|
-
* Check that the provided authority matches the program's upgrade authority.
|
|
6733
|
-
*/
|
|
6734
|
-
declare function checkProgramUpdateAuthority(programDataAccountInfo: AccountInfo<Buffer>, providedAuthority: PublicKey): void;
|
|
6735
|
-
|
|
6736
|
-
/**
|
|
6737
|
-
* Convert a compressed account to the format expected by instruction builders
|
|
6738
|
-
*/
|
|
6739
|
-
declare function createCompressedAccountData<T>(compressedAccount: CompressedAccount, data: T, seeds: Uint8Array[], outputStateTreeIndex: number): CompressedAccountData<T>;
|
|
6740
|
-
|
|
6741
|
-
export { ADDRESS_QUEUE_ROLLOVER_FEE, ADDRESS_TREE_NETWORK_FEE, ALICE, type AccountProofInput, type AccountProofInputs, AccountProofResult, type ActiveTreeBundle, type AddressProofInputs, type AddressTreeInfo, type AddressWithTree, type AddressWithTreeInfo, AppendLeavesInputLayout, AppendNullifyCreateAddressInputsMetaLayout, type BN254, BOB, BalanceResult, CHARLIE, COMPRESSED_TOKEN_PROGRAM_ID, COMPRESSIBLE_DISCRIMINATORS, COMPUTE_BUDGET_PATTERN, type ClientSubscriptionId, type CompressedAccount, type CompressedAccountData$1 as CompressedAccountData, CompressedAccountLayout, type CompressedAccountLegacy, type CompressedAccountMeta, CompressedAccountMetaSchema, CompressedAccountResult, CompressedAccountResultV2, type CompressedAccountWithMerkleContext, type CompressedAccountWithMerkleContextLegacy, CompressedAccountsByOwnerResult, CompressedAccountsByOwnerResultV2, type CompressedCpiContext, CompressedCpiContextLayout, type CompressedMintTokenHolders, CompressedMintTokenHoldersResult, type CompressedProof, CompressedProofLayout, type CompressedProofWithContext, CompressedTokenAccountResult, CompressedTokenAccountResultV2, CompressedTokenAccountsByOwnerOrDelegateResult, CompressedTokenAccountsByOwnerOrDelegateResultV2, type CompressedTransaction, CompressedTransactionResult, CompressedTransactionResultV2, CompressibleInstruction, type CompressionApiInterface, CreateUtxoError, CreateUtxoErrorCode, DAVE, DEFAULT_MERKLE_TREE_HEIGHT, DEFAULT_MERKLE_TREE_ROOTS, DEFAULT_ZERO, type DecompressMultipleAccountsIdempotentData, type EventWithParsedTokenTlvData, FIELD_SIZE, type GenericCompressAccountInstruction, GenericCompressAccountInstructionSchema, 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_CPI_WITH_ACCOUNT_INFO_DISCRIMINATOR, INVOKE_CPI_WITH_READ_ONLY_DISCRIMINATOR, INVOKE_DISCRIMINATOR, InAccountLayout, IndexedArray, IndexedElement, IndexedElementBundle, type InputTokenDataWithContext, InsertAddressInputLayout, InsertNullifierInputLayout, type InstructionDataInvoke, type InstructionDataInvokeCpi, InstructionDataInvokeCpiLayout, InstructionDataInvokeCpiWithReadOnlyLayout, InstructionDataInvokeLayout, type LatestNonVotingSignatures, type LatestNonVotingSignaturesPaginated, LatestNonVotingSignaturesResult, LatestNonVotingSignaturesResultPaginated, LightSystemProgram, type LightSystemProgram$1 as LightSystemProgramIDL, type LightWasm, LookupTableError, LookupTableErrorCode, type MerkleContext, MerkleContextLayout, type MerkleContextLegacy, type MerkleContextWithMerkleProof, type MerkleContextWithNewAddressProof, MerkleProofResult, MerkleProofResultV2, MerkleTree, MerkleTreeError, MerkleTreeErrorCode, type MerkleTreeSequenceNumber, MerkleTreeSequenceNumberLayout, MultipleCompressedAccountsResult, MultipleCompressedAccountsResultV2, MultipleMerkleProofsResult, MultipleMerkleProofsResultV2, NativeBalanceResult, type NewAddressParams, NewAddressParamsAssignedPackedLayout, NewAddressParamsLayout, type NewAddressParamsPacked, type NewAddressProofInput, NewAddressProofResult, type NonInclusionJsonStruct, type NonInclusionMerkleProofInputs, type NullifierMetadata, type OutputCompressedAccountWithPackedContext, PackedAccounts, PackedAccountsSmall, type PackedAddressTreeInfo, type PackedCompressedAccountWithMerkleContext, PackedMerkleContextLayout, type PackedMerkleContextLegacy, PackedReadOnlyAddressLayout, PackedReadOnlyCompressedAccountLayout, type PackedStateTreeInfo, PackedStateTreeInfoSchema, type PackedStateTreeInfos, type PackedTreeInfos, type PaginatedOptions, type ParsedTokenAccount, ProofError, ProofErrorCode, type PublicTransactionEvent, PublicTransactionEventLayout, type RootIndex, RootIndexResultV2, 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, SystemAccountMetaConfig, SystemAccountPubkeys, TRANSACTION_MERKLE_TREE_ROLLOVER_THRESHOLD, TestRpc, type TestRpcConfig, type TokenBalance, TokenBalanceListResult, TokenBalanceListResultV2, TokenBalanceResult, type TokenData$1 as TokenData, TokenDataLayout, TokenDataResult, type TreeInfo, TreeType, UTXO_MERGE_MAXIMUM, UTXO_MERGE_THRESHOLD, type UpdateCompressionConfigData, UpdateCompressionConfigSchema, UtilsError, UtilsErrorCode, UtxoError, UtxoErrorCode, VERSION, type ValidityProof, ValidityProofResult, ValidityProofResultV2, ValidityProofSchema, type ValidityProofWithContext, type ValidityProofWithContextV2, type WithContext, type WithCursor, type WithRpcContext, accountCompressionProgram, addressQueue, addressTree, addressTreeV2, airdropSol, batchCpiContext, batchMerkleTree, batchQueue, bn, bufToDecStr, buildAndSignTx, buildTx, byteArrayToKeypair, calculateComputeUnitPrice, checkProgramUpdateAuthority, checkValidityProofShape, compress, compressAccount, CompressibleInstruction as compressibleInstruction, confirmConfig, confirmTransaction, confirmTx, convertInvokeCpiWithReadOnlyToInvoke, convertMerkleProofsWithContextToHex, convertNonInclusionMerkleProofInputsToHex, convertToPublicTransactionEvent, cpiContext2Pubkey, cpiContextPubkey, createAccount, createAccountWithLamports, createBN254, createCompressAccountInstruction, createCompressedAccountData, createCompressedAccountDataSchema, createCompressedAccountLegacy, createCompressedAccountMeta, createCompressedAccountWithMerkleContextLegacy, createDecompressAccountsIdempotentInstruction, createDecompressMultipleAccountsIdempotentDataSchema, createInitializeCompressionConfigInstruction, createMerkleContextLegacy, createPackedAccounts, createPackedAccountsSmall, createPackedAccountsSmallWithCpiContext, createPackedAccountsWithCpiContext, createRootIndex, createRootIndexByIndex, createRpc, createRpcResult, createStateTreeLookupTable, createUpdateCompressionConfigInstruction, decodeInstructionDataInvoke, decodeInstructionDataInvokeCpi, decodeInstructionDataInvokeCpiWithReadOnly, decodePublicTransactionEvent, decompress, decompressAccountsIdempotent, dedupeSigner, deepEqual, defaultStateTreeLookupTables, defaultStaticAccounts, defaultStaticAccountsStruct, defaultTestStateTreeAccounts, defaultTestStateTreeAccounts2, deriveAddress, deriveAddressSeed, deriveAddressV2, deriveCompressionConfigAddress, deserializeAppendNullifyCreateAddressInputsIndexer, encodeBN254toBase58, encodeInstructionDataInvoke, encodePublicTransactionEvent, extendStateTreeLookupTable, featureFlags, getAccountCompressionAuthority, getAllStateTreeInfos, getCompressedTokenAccountByHashTest, getCompressedTokenAccounts, getCompressedTokenAccountsByDelegateTest, getCompressedTokenAccountsByOwnerTest, getConnection, getDefaultAddressTreeInfo, getIndexOrAdd, getLightSystemAccountMetas, getLightSystemAccountMetasSmall, getParsedEvents, getProgramDataAccount, getPublicInputHash, getRegisteredProgramPda, getStateTreeInfoByPubkey, getTestKeypair, getTestRpc, getTreeInfoByPubkey, hashToBn254FieldSizeBe, hashVWithBumpSeed, hashvToBn254FieldSizeBe, initializeCompressionConfig, invokeAccountsLayout, type invokeAccountsLayoutParams, isLocalTest, isSmallerThanBn254FieldSizeBe, jsonRpcResult, jsonRpcResultAndContext, lightSystemProgram, localTestActiveStateTreeInfos, merkleTree2Pubkey, merkletreePubkey, negateAndCompressProof, newAccountWithLamports, noopProgram, nullifiedStateTreeLookupTableDevnet, nullifiedStateTreeLookupTableMainnet, nullifierQueue2Pubkey, nullifierQueuePubkey, nullifyLookupTable, packCompressedAccounts, packNewAddressParams, packTreeInfos, packTreeInfosWithPubkeys, padOutputStateMerkleTrees, parseAccountData, parseEvents, parseLightTransaction, parsePublicTransactionEventWithIdl, parseTokenLayoutWithIdl, pickRandomTreeAndQueue, pipe, placeholderValidityProof, proofFromJsonStruct, proverRequest, pushUniqueItems, rpcRequest, selectMinCompressedSolAccountsForTransfer, selectStateTreeInfo, sendAndConfirmTx, serializeInitializeCompressionConfigData, serializeInstructionData, sleep, stateTreeLookupTableDevnet, stateTreeLookupTableMainnet, sumUpLamports, toAccountMetas, toArray, toCamelCase, toHex, toUnixTimestamp, transfer, updateCompressionConfig, validateNumbers, validateNumbersForInclusionProof, validateNumbersForNonInclusionProof, validateNumbersForProof, validateSameOwner, validateSufficientBalance, versionedEndpoint, wrapBigNumbersAsStrings };
|
|
6420
|
+
export { ADDRESS_QUEUE_ROLLOVER_FEE, ADDRESS_TREE_NETWORK_FEE_V1, ADDRESS_TREE_NETWORK_FEE_V2, ALICE, type AccountDataWithTreeInfo, type AccountProofInput, AccountProofResult, type ActiveTreeBundle, type AddressTreeInfo, type AddressWithTree, type AddressWithTreeInfo, type AddressWithTreeInfoV2, AppendLeavesInputLayout, AppendNullifyCreateAddressInputsMetaLayout, type BN254, BOB, BalanceResult, CHARLIE, COMPRESSED_TOKEN_PROGRAM_ID, COMPUTE_BUDGET_PATTERN, CTOKEN_PROGRAM_ID, type ClientSubscriptionId, type CompressedAccount, type CompressedAccountData, CompressedAccountLayout, type CompressedAccountLegacy, type CompressedAccountMeta, CompressedAccountResult, CompressedAccountResultV2, type CompressedAccountWithMerkleContext, type CompressedAccountWithMerkleContextLegacy, CompressedAccountsByOwnerResult, CompressedAccountsByOwnerResultV2, type CompressedCpiContext, CompressedCpiContextLayout, type CompressedMintTokenHolders, CompressedMintTokenHoldersResult, type CompressedProof, CompressedProofLayout, type CompressedProofWithContext, CompressedTokenAccountResult, CompressedTokenAccountResultV2, CompressedTokenAccountsByOwnerOrDelegateResult, CompressedTokenAccountsByOwnerOrDelegateResultV2, type CompressedTransaction, CompressedTransactionResult, CompressedTransactionResultV2, type CompressionApiInterface, CreateUtxoError, CreateUtxoErrorCode, DAVE, DEFAULT_MERKLE_TREE_HEIGHT, DEFAULT_MERKLE_TREE_ROOTS, DEFAULT_ZERO, DerivationMode, 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_CPI_WITH_ACCOUNT_INFO_DISCRIMINATOR, INVOKE_CPI_WITH_READ_ONLY_DISCRIMINATOR, INVOKE_DISCRIMINATOR, InAccountLayout, IndexedArray, IndexedElement, IndexedElementBundle, type InputTokenDataWithContext, InsertAddressInputLayout, InsertNullifierInputLayout, type InstructionDataInvoke, type InstructionDataInvokeCpi, InstructionDataInvokeCpiLayout, InstructionDataInvokeCpiWithReadOnlyLayout, InstructionDataInvokeLayout, type LatestNonVotingSignatures, type LatestNonVotingSignaturesPaginated, LatestNonVotingSignaturesResult, LatestNonVotingSignaturesResultPaginated, LightSystemProgram, type LightSystemProgram$1 as LightSystemProgramIDL, type LightWasm, LookupTableError, LookupTableErrorCode, type MerkleContext, MerkleContextLayout, type MerkleContextLegacy, type MerkleContextWithMerkleProof, type MerkleContextWithNewAddressProof, MerkleProofResult, MerkleProofResultV2, MerkleTree, MerkleTreeError, MerkleTreeErrorCode, type MerkleTreeSequenceNumber, MerkleTreeSequenceNumberLayout, MultipleCompressedAccountsResult, MultipleCompressedAccountsResultV2, MultipleMerkleProofsResult, MultipleMerkleProofsResultV2, NativeBalanceResult, type NewAddressParams, NewAddressParamsAssignedPackedLayout, NewAddressParamsLayout, type NewAddressParamsPacked, type NewAddressProofInput, NewAddressProofResult, type NonInclusionJsonStruct, type NonInclusionMerkleProofInputs, type NullifierMetadata, type OutputCompressedAccountWithPackedContext, PackedAccounts, type PackedAddressTreeInfo, type PackedCompressedAccountWithMerkleContext, type PackedDecompressResult, PackedMerkleContextLayout, type PackedMerkleContextLegacy, PackedReadOnlyAddressLayout, PackedReadOnlyCompressedAccountLayout, type PackedStateTreeInfo, type PackedStateTreeInfos, type PackedTreeInfos, type PaginatedOptions, type ParsedTokenAccount, ProofError, ProofErrorCode, type PublicTransactionEvent, PublicTransactionEventLayout, RootIndexResultV2, Rpc, RpcError, RpcErrorCode, type RpcResult, type RpcResultError, type RpcResultSuccess, STATE_MERKLE_TREE_NETWORK_FEE, STATE_MERKLE_TREE_ROLLOVER_FEE, SelectInUtxosError, SelectInUtxosErrorCode, SignatureListResult, SignatureListWithCursorResult, SignatureSource, type SignatureSourceType, type SignatureWithMetadata, type SignaturesForAddressInterfaceResult, SlotResult, type StateTreeInfo, type StateTreeLUTPair, SystemAccountMetaConfig, TRANSACTION_MERKLE_TREE_ROLLOVER_THRESHOLD, TestRpc, type TestRpcConfig, type TokenBalance, TokenBalanceListResult, TokenBalanceListResultV2, TokenBalanceResult, type TokenData$1 as TokenData, TokenDataResult, type TreeInfo, TreeType, UTXO_MERGE_MAXIMUM, UTXO_MERGE_THRESHOLD, type UnifiedBalance, type UnifiedSignatureInfo, type UnifiedTokenBalance, UtilsError, UtilsErrorCode, UtxoError, UtxoErrorCode, VERSION, type ValidityProof, ValidityProofResult, ValidityProofResultV2, type ValidityProofWithContext, type WithContext, type WithCursor, type WithRpcContext, accountCompressionProgram, addressQueue, addressTree, airdropSol, batchAddressTree, batchCpiContext1, batchCpiContext2, batchCpiContext3, batchCpiContext4, batchCpiContext5, batchMerkleTree, batchMerkleTree1, batchMerkleTree2, batchMerkleTree3, batchMerkleTree4, batchMerkleTree5, batchQueue, batchQueue1, batchQueue2, batchQueue3, batchQueue4, batchQueue5, bn, bufToDecStr, buildAndSignTx, buildTx, byteArrayToKeypair, calculateComputeUnitPrice, checkValidityProofShape, compress, confirmConfig, confirmTransaction, confirmTx, convertInvokeCpiWithReadOnlyToInvoke, convertMerkleProofsWithContextToHex, convertNonInclusionMerkleProofInputsToHex, convertToPublicTransactionEvent, cpiContext2Pubkey, cpiContextPubkey, createAccount, createAccountWithLamports, createBN254, createCompressedAccountLegacy, createCompressedAccountMeta, createCompressedAccountWithMerkleContextLegacy, createMerkleContextLegacy, createRpc, createRpcResult, createStateTreeLookupTable, decodeInstructionDataInvoke, decodeInstructionDataInvokeCpi, decodeInstructionDataInvokeCpiWithReadOnly, decodePublicTransactionEvent, decompress, dedupeSigner, deepEqual, defaultStateTreeLookupTables, defaultStaticAccounts, defaultStaticAccountsStruct, defaultTestStateTreeAccounts, defaultTestStateTreeAccounts2, deriveAddress, deriveAddressSeed, deriveAddressSeedV2, deriveAddressV2, deserializeAppendNullifyCreateAddressInputsIndexer, encodeBN254toBase58, encodeInstructionDataInvoke, encodePublicTransactionEvent, extendStateTreeLookupTable, featureFlags, getAccountCompressionAuthority, getAllStateTreeInfos, getBatchAddressTreeInfo, getCompressedTokenAccountByHashTest, getCompressedTokenAccounts, getCompressedTokenAccountsByDelegateTest, getCompressedTokenAccountsByOwnerTest, getConnection, getDefaultAddressSpace, getDefaultAddressTreeInfo, getIndexOrAdd, getLightSystemAccountMetas, getLightSystemAccountMetasV2, getOutputQueue, getOutputTreeInfo, getParsedEvents, getPublicInputHash, getRegisteredProgramPda, getStateTreeInfoByPubkey, getTestKeypair, getTestRpc, getTreeInfoByPubkey, hashToBn254FieldSizeBe, hashvToBn254FieldSizeBe, hashvToBn254FieldSizeBeU8Array, invokeAccountsLayout, type invokeAccountsLayoutParams, isLocalTest, isSmallerThanBn254FieldSizeBe, jsonRpcResult, jsonRpcResultAndContext, lightSystemProgram, localTestActiveStateTreeInfos, mergeSignatures, merkleTree2Pubkey, merkletreePubkey, negateAndCompressProof, newAccountWithLamports, noopProgram, nullifiedStateTreeLookupTableDevnet, nullifiedStateTreeLookupTableMainnet, nullifierQueue2Pubkey, nullifierQueuePubkey, nullifyLookupTable, packCompressedAccounts, packDecompressAccountsIdempotent, packNewAddressParams, packTreeInfos, padOutputStateMerkleTrees, parseAccountData, parseEvents, parseLightTransaction, parsePublicTransactionEventWithIdl, parseTokenLayoutWithIdl, pickRandomTreeAndQueue, pipe, placeholderValidityProof, proofFromJsonStruct, proverRequest, pushUniqueItems, rpcRequest, selectMinCompressedSolAccountsForTransfer, selectStateTreeInfo, sendAndConfirmTx, sleep, stateTreeLookupTableDevnet, stateTreeLookupTableMainnet, sumUpLamports, testBatchAddressTree, toAccountMetas, toArray, toCamelCase, toHex, toUnixTimestamp, transfer, validateNumbers, validateNumbersForInclusionProof, validateNumbersForNonInclusionProof, validateNumbersForProof, validateSameOwner, validateSufficientBalance, versionedEndpoint, wrapBigNumbersAsStrings };
|