@lightprotocol/stateless.js 0.22.1-alpha.1 → 0.22.1-alpha.3
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 +29 -8
- package/dist/cjs/browser/index.cjs +1 -1
- package/dist/cjs/browser/index.cjs.map +1 -1
- package/dist/cjs/browser/rpc-interface.d.ts +96 -2
- package/dist/cjs/browser/rpc.d.ts +81 -3
- 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 +6 -0
- package/dist/cjs/browser/utils/get-state-tree-infos.d.ts +15 -0
- package/dist/cjs/browser/utils/index.d.ts +1 -0
- package/dist/cjs/browser/utils/pack-decompress.d.ts +31 -0
- package/dist/cjs/node/constants.d.ts +29 -8
- package/dist/cjs/node/index.cjs +1 -1
- package/dist/cjs/node/index.cjs.map +1 -1
- package/dist/cjs/node/rpc-interface.d.ts +96 -2
- package/dist/cjs/node/rpc.d.ts +81 -3
- 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 +6 -0
- package/dist/cjs/node/utils/get-state-tree-infos.d.ts +15 -0
- package/dist/cjs/node/utils/index.d.ts +1 -0
- package/dist/cjs/node/utils/pack-decompress.d.ts +31 -0
- package/dist/es/browser/constants.d.ts +29 -8
- package/dist/es/browser/index.js +1 -1
- package/dist/es/browser/index.js.map +1 -1
- package/dist/es/browser/rpc-interface.d.ts +96 -2
- package/dist/es/browser/rpc.d.ts +81 -3
- package/dist/es/browser/test-helpers/test-rpc/get-compressed-token-accounts.d.ts +0 -2
- package/dist/es/browser/test-helpers/test-rpc/test-rpc.d.ts +6 -0
- package/dist/es/browser/utils/get-state-tree-infos.d.ts +15 -0
- package/dist/es/browser/utils/index.d.ts +1 -0
- package/dist/es/browser/utils/pack-decompress.d.ts +31 -0
- package/dist/types/index.d.ts +251 -11
- package/package.json +5 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { PublicKey, MemcmpFilter, DataSlice } from '@solana/web3.js';
|
|
1
|
+
import { PublicKey, MemcmpFilter, DataSlice, Commitment, GetAccountInfoConfig, AccountInfo, ConfirmedSignatureInfo, SignaturesForAddressOptions, TokenAmount } from '@solana/web3.js';
|
|
2
2
|
import { Struct } from 'superstruct';
|
|
3
|
-
import { BN254, ValidityProof, CompressedAccountWithMerkleContext, MerkleContextWithMerkleProof, TokenData, TreeInfo, AddressTreeInfo, CompressedProof } from './state';
|
|
3
|
+
import { BN254, ValidityProof, CompressedAccountWithMerkleContext, MerkleContextWithMerkleProof, TokenData, TreeInfo, AddressTreeInfo, CompressedProof, MerkleContext } from './state';
|
|
4
4
|
import BN from 'bn.js';
|
|
5
5
|
export interface LatestNonVotingSignatures {
|
|
6
6
|
context: {
|
|
@@ -83,6 +83,14 @@ export interface AddressWithTreeInfo {
|
|
|
83
83
|
address: BN254;
|
|
84
84
|
treeInfo: AddressTreeInfo;
|
|
85
85
|
}
|
|
86
|
+
export interface AddressWithTreeInfoV2 {
|
|
87
|
+
address: Uint8Array;
|
|
88
|
+
treeInfo: TreeInfo;
|
|
89
|
+
}
|
|
90
|
+
export declare enum DerivationMode {
|
|
91
|
+
compressible = "compressible",
|
|
92
|
+
standard = "standard"
|
|
93
|
+
}
|
|
86
94
|
export interface CompressedTransaction {
|
|
87
95
|
compressionInfo: {
|
|
88
96
|
closedAccounts: {
|
|
@@ -2761,6 +2769,15 @@ export interface CompressionApiInterface {
|
|
|
2761
2769
|
getLatestCompressionSignatures(cursor?: string, limit?: number): Promise<LatestNonVotingSignaturesPaginated>;
|
|
2762
2770
|
getIndexerHealth(): Promise<string>;
|
|
2763
2771
|
getIndexerSlot(): Promise<number>;
|
|
2772
|
+
getAccountInfoInterface(address: PublicKey, programId: PublicKey, commitmentOrConfig?: Commitment | GetAccountInfoConfig, addressSpace?: TreeInfo): Promise<{
|
|
2773
|
+
accountInfo: AccountInfo<Buffer>;
|
|
2774
|
+
isCold: boolean;
|
|
2775
|
+
loadContext?: MerkleContext;
|
|
2776
|
+
} | null>;
|
|
2777
|
+
getSignaturesForAddressInterface(address: PublicKey, options?: SignaturesForAddressOptions, compressedOptions?: PaginatedOptions): Promise<SignaturesForAddressInterfaceResult>;
|
|
2778
|
+
getSignaturesForOwnerInterface(owner: PublicKey, options?: SignaturesForAddressOptions, compressedOptions?: PaginatedOptions): Promise<SignaturesForAddressInterfaceResult>;
|
|
2779
|
+
getTokenAccountBalanceInterface(address: PublicKey, owner: PublicKey, mint: PublicKey, commitment?: Commitment): Promise<UnifiedTokenBalance>;
|
|
2780
|
+
getBalanceInterface(address: PublicKey, commitment?: Commitment): Promise<UnifiedBalance>;
|
|
2764
2781
|
}
|
|
2765
2782
|
export type RpcResultSuccess<T> = {
|
|
2766
2783
|
jsonrpc: '2.0';
|
|
@@ -2777,3 +2794,80 @@ export type RpcResultError = {
|
|
|
2777
2794
|
};
|
|
2778
2795
|
};
|
|
2779
2796
|
export type RpcResult<T> = RpcResultSuccess<T> | RpcResultError;
|
|
2797
|
+
/**
|
|
2798
|
+
* Source type for signature data.
|
|
2799
|
+
*/
|
|
2800
|
+
export declare const SignatureSource: {
|
|
2801
|
+
/** From standard Solana RPC (getSignaturesForAddress) */
|
|
2802
|
+
readonly Solana: "solana";
|
|
2803
|
+
/** From compression indexer (getCompressionSignaturesFor*) */
|
|
2804
|
+
readonly Compressed: "compressed";
|
|
2805
|
+
};
|
|
2806
|
+
export type SignatureSourceType = (typeof SignatureSource)[keyof typeof SignatureSource];
|
|
2807
|
+
/**
|
|
2808
|
+
* Unified signature info combining data from both Solana RPC and compression indexer.
|
|
2809
|
+
*
|
|
2810
|
+
* Design rationale:
|
|
2811
|
+
* - `sources` array indicates where this signature was found (can be both!)
|
|
2812
|
+
* - Primary data comes from Solana RPC when available (richer: err, memo, confirmationStatus)
|
|
2813
|
+
* - Compression-only signatures still included for complete transaction history
|
|
2814
|
+
*/
|
|
2815
|
+
export interface UnifiedSignatureInfo {
|
|
2816
|
+
/** Transaction signature (base58) */
|
|
2817
|
+
signature: string;
|
|
2818
|
+
/** Slot when the transaction was processed */
|
|
2819
|
+
slot: number;
|
|
2820
|
+
/** Block time (unix timestamp), null if not available */
|
|
2821
|
+
blockTime: number | null;
|
|
2822
|
+
/** Transaction error, null if successful. Only from Solana RPC. */
|
|
2823
|
+
err: any | null;
|
|
2824
|
+
/** Memo data. Only from Solana RPC. */
|
|
2825
|
+
memo: string | null;
|
|
2826
|
+
/** Confirmation status. Only from Solana RPC. */
|
|
2827
|
+
confirmationStatus?: string;
|
|
2828
|
+
/**
|
|
2829
|
+
* Sources where this signature was found.
|
|
2830
|
+
* - ['solana'] = only in Solana RPC
|
|
2831
|
+
* - ['compressed'] = only in compression indexer
|
|
2832
|
+
* - ['solana', 'compressed'] = found in both (compression tx indexed by both)
|
|
2833
|
+
*/
|
|
2834
|
+
sources: SignatureSourceType[];
|
|
2835
|
+
}
|
|
2836
|
+
/**
|
|
2837
|
+
* Result of getSignaturesForAddressInterface / getSignaturesForOwnerInterface.
|
|
2838
|
+
*
|
|
2839
|
+
* Design rationale:
|
|
2840
|
+
* - `signatures`: Unified view, merged and deduplicated, sorted by slot desc
|
|
2841
|
+
* - `solana` / `compressed`: Raw responses preserved for clients that need source-specific data
|
|
2842
|
+
* - Allows callers to use the unified view OR drill into specific sources
|
|
2843
|
+
*/
|
|
2844
|
+
export interface SignaturesForAddressInterfaceResult {
|
|
2845
|
+
/** Merged signatures from all sources, sorted by slot (descending) */
|
|
2846
|
+
signatures: UnifiedSignatureInfo[];
|
|
2847
|
+
/** Raw signatures from Solana RPC */
|
|
2848
|
+
solana: ConfirmedSignatureInfo[];
|
|
2849
|
+
/** Raw signatures from compression indexer */
|
|
2850
|
+
compressed: SignatureWithMetadata[];
|
|
2851
|
+
}
|
|
2852
|
+
/**
|
|
2853
|
+
* Unified token balance combining hot and cold token balances.
|
|
2854
|
+
*/
|
|
2855
|
+
export interface UnifiedTokenBalance {
|
|
2856
|
+
/** Total balance (hot + cold) */
|
|
2857
|
+
amount: BN;
|
|
2858
|
+
/** True if any cold balance exists - call load() before usage */
|
|
2859
|
+
hasColdBalance: boolean;
|
|
2860
|
+
/** Token decimals (from on-chain mint or 0 if unknown) */
|
|
2861
|
+
decimals: number;
|
|
2862
|
+
/** Raw Solana RPC TokenAmount response, null if no on-chain account */
|
|
2863
|
+
solana: TokenAmount | null;
|
|
2864
|
+
}
|
|
2865
|
+
/**
|
|
2866
|
+
* Unified SOL balance combining hot and cold SOL balances.
|
|
2867
|
+
*/
|
|
2868
|
+
export interface UnifiedBalance {
|
|
2869
|
+
/** Total balance (hot + cold) in lamports */
|
|
2870
|
+
total: BN;
|
|
2871
|
+
/** True if any cold balance exists - call load() before usage */
|
|
2872
|
+
hasColdBalance: boolean;
|
|
2873
|
+
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { Connection, ConnectionConfig, PublicKey } from '@solana/web3.js';
|
|
1
|
+
import { AccountInfo, Commitment, Connection, ConnectionConfig, GetAccountInfoConfig, PublicKey, SignaturesForAddressOptions } from '@solana/web3.js';
|
|
2
2
|
import { Buffer } from 'buffer';
|
|
3
|
-
import { ValidityProofWithContext, CompressedTransaction, CompressionApiInterface, GetCompressedTokenAccountsByOwnerOrDelegateOptions, HexInputsForProver, ParsedTokenAccount, SignatureWithMetadata, LatestNonVotingSignatures, LatestNonVotingSignaturesPaginated, WithContext, GetCompressedAccountsByOwnerConfig, WithCursor, AddressWithTree, HashWithTree, CompressedMintTokenHolders, TokenBalance, PaginatedOptions } from './rpc-interface';
|
|
4
|
-
import { MerkleContextWithMerkleProof, BN254, CompressedAccountWithMerkleContext, ValidityProof, AddressTreeInfo } from './state';
|
|
3
|
+
import { ValidityProofWithContext, CompressedTransaction, CompressionApiInterface, GetCompressedTokenAccountsByOwnerOrDelegateOptions, HexInputsForProver, ParsedTokenAccount, SignatureWithMetadata, LatestNonVotingSignatures, LatestNonVotingSignaturesPaginated, WithContext, GetCompressedAccountsByOwnerConfig, WithCursor, AddressWithTree, HashWithTree, CompressedMintTokenHolders, TokenBalance, PaginatedOptions, DerivationMode, AddressWithTreeInfoV2, SignaturesForAddressInterfaceResult, UnifiedSignatureInfo, UnifiedTokenBalance, UnifiedBalance } from './rpc-interface';
|
|
4
|
+
import { MerkleContextWithMerkleProof, BN254, CompressedAccountWithMerkleContext, ValidityProof, AddressTreeInfo, MerkleContext } from './state';
|
|
5
5
|
import BN from 'bn.js';
|
|
6
|
+
import { ConfirmedSignatureInfo } from '@solana/web3.js';
|
|
6
7
|
import { LightWasm } from './test-helpers';
|
|
7
8
|
import { TreeInfo } from './state/types';
|
|
8
9
|
/** @internal */
|
|
@@ -72,6 +73,12 @@ export interface NullifierMetadata {
|
|
|
72
73
|
nullifier: BN254;
|
|
73
74
|
txHash: BN254;
|
|
74
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* Merge signatures from Solana RPC and compression indexer.
|
|
78
|
+
* Deduplicates by signature, tracking sources in the `sources` array.
|
|
79
|
+
* When a signature exists in both, uses Solana data (richer) but marks both sources.
|
|
80
|
+
*/
|
|
81
|
+
export declare function mergeSignatures(solanaSignatures: ConfirmedSignatureInfo[], compressedSignatures: SignatureWithMetadata[]): UnifiedSignatureInfo[];
|
|
75
82
|
/**
|
|
76
83
|
*
|
|
77
84
|
*/
|
|
@@ -94,6 +101,7 @@ export declare class Rpc extends Connection implements CompressionApiInterface {
|
|
|
94
101
|
/**
|
|
95
102
|
* Get a list of all state tree infos. If not already cached, fetches from
|
|
96
103
|
* the cluster.
|
|
104
|
+
* if featureFlags.isV2(), returns v2 trees too.
|
|
97
105
|
*/
|
|
98
106
|
getStateTreeInfos(): Promise<TreeInfo[]>;
|
|
99
107
|
/**
|
|
@@ -264,6 +272,17 @@ export declare class Rpc extends Connection implements CompressionApiInterface {
|
|
|
264
272
|
* @returns validity proof with context
|
|
265
273
|
*/
|
|
266
274
|
getValidityProofV0(hashes?: HashWithTree[], newAddresses?: AddressWithTree[]): Promise<ValidityProofWithContext>;
|
|
275
|
+
/**
|
|
276
|
+
* Fetch the latest validity proof for (1) compressed accounts specified by
|
|
277
|
+
* an array of account Merkle contexts, and (2) new unique addresses specified by
|
|
278
|
+
* an array of address objects with tree info.
|
|
279
|
+
*
|
|
280
|
+
* Validity proofs prove the presence of compressed accounts in state trees
|
|
281
|
+
* and the non-existence of addresses in address trees, respectively. They
|
|
282
|
+
* enable verification without recomputing the merkle proof path, thus
|
|
283
|
+
* lowering verification and data costs.
|
|
284
|
+
*/
|
|
285
|
+
getValidityProofV2(accountMerkleContexts?: (MerkleContext | undefined)[], newAddresses?: AddressWithTreeInfoV2[], derivationMode?: DerivationMode): Promise<ValidityProofWithContext>;
|
|
267
286
|
/**
|
|
268
287
|
* Fetch the latest validity proof for (1) compressed accounts specified by
|
|
269
288
|
* an array of account hashes. (2) new unique addresses specified by an
|
|
@@ -281,4 +300,63 @@ export declare class Rpc extends Connection implements CompressionApiInterface {
|
|
|
281
300
|
* @returns validity proof with context
|
|
282
301
|
*/
|
|
283
302
|
getValidityProofAndRpcContext(hashes?: HashWithTree[], newAddresses?: AddressWithTree[]): Promise<WithContext<ValidityProofWithContext>>;
|
|
303
|
+
/**
|
|
304
|
+
* Fetch the account info for the specified public key. Returns metadata
|
|
305
|
+
* to load in case the account is cold.
|
|
306
|
+
* @param address The account address to fetch.
|
|
307
|
+
* @param programId The owner program ID.
|
|
308
|
+
* @param commitmentOrConfig Optional. The commitment or config to use
|
|
309
|
+
* for the onchain account fetch.
|
|
310
|
+
* @param addressSpace Optional. The address space info that was
|
|
311
|
+
* used at init.
|
|
312
|
+
*
|
|
313
|
+
* @returns Account info with load info, or null if
|
|
314
|
+
* account doesn't exist. LoadContext is always
|
|
315
|
+
* some if the account is compressible. isCold
|
|
316
|
+
* indicates the current state of the account,
|
|
317
|
+
* if true the account must referenced in a
|
|
318
|
+
* load instruction before use.
|
|
319
|
+
*/
|
|
320
|
+
getAccountInfoInterface(address: PublicKey, programId: PublicKey, commitmentOrConfig?: Commitment | GetAccountInfoConfig, addressSpace?: TreeInfo): Promise<{
|
|
321
|
+
accountInfo: AccountInfo<Buffer>;
|
|
322
|
+
isCold: boolean;
|
|
323
|
+
loadContext?: MerkleContext;
|
|
324
|
+
} | null>;
|
|
325
|
+
/**
|
|
326
|
+
* Get signatures for an address from both Solana and compression indexer.
|
|
327
|
+
*
|
|
328
|
+
* @param address Address to fetch signatures for.
|
|
329
|
+
* @param options Options for the Solana getSignaturesForAddress call.
|
|
330
|
+
* @param compressedOptions Options for the compression getCompressionSignaturesForAddress call.
|
|
331
|
+
* @returns Unified signatures from both sources.
|
|
332
|
+
*/
|
|
333
|
+
getSignaturesForAddressInterface(address: PublicKey, options?: SignaturesForAddressOptions, compressedOptions?: PaginatedOptions): Promise<SignaturesForAddressInterfaceResult>;
|
|
334
|
+
/**
|
|
335
|
+
* Get signatures for an owner from both Solana and compression indexer.
|
|
336
|
+
*
|
|
337
|
+
* @param owner Owner address to fetch signatures for.
|
|
338
|
+
* @param options Options for the Solana getSignaturesForAddress call.
|
|
339
|
+
* @param compressedOptions Options for the compression getCompressionSignaturesForOwner call.
|
|
340
|
+
* @returns Unified signatures from both sources.
|
|
341
|
+
*/
|
|
342
|
+
getSignaturesForOwnerInterface(owner: PublicKey, options?: SignaturesForAddressOptions, compressedOptions?: PaginatedOptions): Promise<SignaturesForAddressInterfaceResult>;
|
|
343
|
+
/**
|
|
344
|
+
* Get token account balance for an address, regardless of whether the token
|
|
345
|
+
* account is hot or cold.
|
|
346
|
+
*
|
|
347
|
+
* @param address Token account address.
|
|
348
|
+
* @param owner Owner public key.
|
|
349
|
+
* @param mint Mint public key.
|
|
350
|
+
* @param commitment Commitment level for on-chain query.
|
|
351
|
+
* @returns Unified token balance from both sources.
|
|
352
|
+
*/
|
|
353
|
+
getTokenAccountBalanceInterface(address: PublicKey, owner: PublicKey, mint: PublicKey, commitment?: Commitment): Promise<UnifiedTokenBalance>;
|
|
354
|
+
/**
|
|
355
|
+
* Get SOL balance for an address, regardless of whether the account is hot or cold.
|
|
356
|
+
*
|
|
357
|
+
* @param address Address to fetch balance for.
|
|
358
|
+
* @param commitment Commitment level for on-chain query.
|
|
359
|
+
* @returns Unified SOL balance.
|
|
360
|
+
*/
|
|
361
|
+
getBalanceInterface(address: PublicKey, commitment?: Commitment): Promise<UnifiedBalance>;
|
|
284
362
|
}
|
|
@@ -3,7 +3,6 @@ import BN from 'bn.js';
|
|
|
3
3
|
import { Rpc } from '../../rpc';
|
|
4
4
|
import { ParsedTokenAccount, WithCursor } from '../../rpc-interface';
|
|
5
5
|
import { PublicTransactionEvent, CompressedAccountLegacy } from '../../state';
|
|
6
|
-
import { Layout } from '@coral-xyz/borsh';
|
|
7
6
|
type TokenData = {
|
|
8
7
|
mint: PublicKey;
|
|
9
8
|
owner: PublicKey;
|
|
@@ -12,7 +11,6 @@ type TokenData = {
|
|
|
12
11
|
state: number;
|
|
13
12
|
tlv: Buffer | null;
|
|
14
13
|
};
|
|
15
|
-
export declare const TokenDataLayout: Layout<TokenData>;
|
|
16
14
|
export type EventWithParsedTokenTlvData = {
|
|
17
15
|
inputCompressedAccountHashes: number[][];
|
|
18
16
|
outputCompressedAccounts: ParsedTokenAccount[];
|
|
@@ -236,4 +236,10 @@ export declare class TestRpc extends Connection implements CompressionApiInterfa
|
|
|
236
236
|
*/
|
|
237
237
|
getValidityProof(hashes?: BN254[], newAddresses?: BN254[]): Promise<ValidityProofWithContext>;
|
|
238
238
|
getValidityProofV0(hashes?: HashWithTree[], newAddresses?: AddressWithTree[]): Promise<ValidityProofWithContext>;
|
|
239
|
+
getValidityProofV2(accountMerkleContexts?: any[], newAddresses?: any[], derivationMode?: any): Promise<ValidityProofWithContext>;
|
|
240
|
+
getAccountInfoInterface(_address: PublicKey, _programId: PublicKey, _addressSpaceInfo: any): Promise<any>;
|
|
241
|
+
getSignaturesForAddressInterface(_address: PublicKey, _options?: any, _compressedOptions?: PaginatedOptions): Promise<any>;
|
|
242
|
+
getSignaturesForOwnerInterface(_owner: PublicKey, _options?: any, _compressedOptions?: PaginatedOptions): Promise<any>;
|
|
243
|
+
getTokenAccountBalanceInterface(_address: PublicKey, _owner: PublicKey, _mint: PublicKey, _commitment?: any): Promise<any>;
|
|
244
|
+
getBalanceInterface(_address: PublicKey, _commitment?: any): Promise<any>;
|
|
239
245
|
}
|
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
import { Connection, PublicKey } from '@solana/web3.js';
|
|
2
2
|
import { TreeInfo, TreeType } from '../state/types';
|
|
3
|
+
import { MerkleContext } from '../state/compressed-account';
|
|
3
4
|
import { StateTreeLUTPair } from '../constants';
|
|
5
|
+
/**
|
|
6
|
+
* Get the currently active output queue from a merkle context.
|
|
7
|
+
*
|
|
8
|
+
* @param merkleContext The merkle context to get the output queue from
|
|
9
|
+
* @returns The output queue public key
|
|
10
|
+
*/
|
|
11
|
+
export declare function getOutputQueue(merkleContext: MerkleContext): PublicKey;
|
|
12
|
+
/**
|
|
13
|
+
* Get the currently active output tree info from a merkle context.
|
|
14
|
+
*
|
|
15
|
+
* @param merkleContext The merkle context to get the output tree info from
|
|
16
|
+
* @returns The output tree info
|
|
17
|
+
*/
|
|
18
|
+
export declare function getOutputTreeInfo(merkleContext: MerkleContext): TreeInfo;
|
|
4
19
|
/**
|
|
5
20
|
* @deprecated use {@link getTreeInfoByPubkey} instead
|
|
6
21
|
*/
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { PublicKey, AccountMeta } from '@solana/web3.js';
|
|
2
|
+
import { ValidityProof } from '../state';
|
|
3
|
+
import { TreeInfo } from '../state/types';
|
|
4
|
+
export interface AccountDataWithTreeInfo {
|
|
5
|
+
key: string;
|
|
6
|
+
data: any;
|
|
7
|
+
treeInfo: TreeInfo;
|
|
8
|
+
}
|
|
9
|
+
export interface PackedDecompressResult {
|
|
10
|
+
proofOption: {
|
|
11
|
+
0: ValidityProof | null;
|
|
12
|
+
};
|
|
13
|
+
compressedAccounts: any[];
|
|
14
|
+
systemAccountsOffset: number;
|
|
15
|
+
remainingAccounts: AccountMeta[];
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Pack accounts and proof for decompressAccountsIdempotent instruction.
|
|
19
|
+
* This function prepares compressed account data, validity proof, and remaining accounts
|
|
20
|
+
* for idempotent decompression operations.
|
|
21
|
+
*
|
|
22
|
+
* @param programId - The program ID
|
|
23
|
+
* @param proof - The validity proof with context
|
|
24
|
+
* @param accountsData - Array of account data with tree info
|
|
25
|
+
* @param addresses - Array of account addresses
|
|
26
|
+
* @returns Packed instruction parameters
|
|
27
|
+
*/
|
|
28
|
+
export declare function packDecompressAccountsIdempotent(programId: PublicKey, proof: {
|
|
29
|
+
compressedProof: ValidityProof | null;
|
|
30
|
+
treeInfos: TreeInfo[];
|
|
31
|
+
}, accountsData: AccountDataWithTreeInfo[], addresses: PublicKey[]): Promise<PackedDecompressResult>;
|
|
@@ -57,14 +57,24 @@ export declare const defaultStateTreeLookupTables: () => {
|
|
|
57
57
|
* @internal
|
|
58
58
|
*/
|
|
59
59
|
export declare const isLocalTest: (url: string) => boolean;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
export declare const getDefaultAddressSpace: () => {
|
|
61
|
+
tree: PublicKey;
|
|
62
|
+
queue: PublicKey;
|
|
63
|
+
cpiContext: undefined;
|
|
64
|
+
treeType: TreeType;
|
|
65
|
+
nextTreeInfo: null;
|
|
66
|
+
};
|
|
64
67
|
export declare const getDefaultAddressTreeInfo: () => {
|
|
65
68
|
tree: PublicKey;
|
|
66
69
|
queue: PublicKey;
|
|
67
|
-
cpiContext:
|
|
70
|
+
cpiContext: undefined;
|
|
71
|
+
treeType: TreeType;
|
|
72
|
+
nextTreeInfo: null;
|
|
73
|
+
};
|
|
74
|
+
export declare const getBatchAddressTreeInfo: () => {
|
|
75
|
+
tree: PublicKey;
|
|
76
|
+
queue: PublicKey;
|
|
77
|
+
cpiContext: undefined;
|
|
68
78
|
treeType: TreeType;
|
|
69
79
|
nextTreeInfo: null;
|
|
70
80
|
};
|
|
@@ -89,6 +99,7 @@ export declare const defaultTestStateTreeAccounts2: () => {
|
|
|
89
99
|
merkleTree2: PublicKey;
|
|
90
100
|
};
|
|
91
101
|
export declare const COMPRESSED_TOKEN_PROGRAM_ID: PublicKey;
|
|
102
|
+
export declare const CTOKEN_PROGRAM_ID: PublicKey;
|
|
92
103
|
export declare const stateTreeLookupTableMainnet = "7i86eQs3GSqHjN47WdWLTCGMW6gde1q96G2EVnUyK2st";
|
|
93
104
|
export declare const nullifiedStateTreeLookupTableMainnet = "H9QD4u1fG7KmkAzn2tDXhheushxFe1EcrjGGyEFXeMqT";
|
|
94
105
|
export declare const stateTreeLookupTableDevnet = "Dk9mNkbiZXJZ4By8DfSP6HEE4ojZzRvucwpawLeuwq8q";
|
|
@@ -117,9 +128,15 @@ export declare const batchMerkleTree5 = "bmt5yU97jC88YXTuSukYHa8Z5Bi2ZDUtmzfkDTA
|
|
|
117
128
|
export declare const batchQueue5 = "oq5oh5ZR3yGomuQgFduNDzjtGvVWfDRGLuDVjv9a96P";
|
|
118
129
|
export declare const batchCpiContext5 = "cpi5ZTjdgYpZ1Xr7B1cMLLUE81oTtJbNNAyKary2nV6";
|
|
119
130
|
export declare const batchAddressTree = "amt2kaJA14v3urZbZvnc5v2np8jqvc4Z8zDep5wbtzx";
|
|
120
|
-
export declare const testBatchAddressTree = "EzKE84aVTkCUhDHLELqyJaq1Y7UVVmqxXqZjVHwHY3rK";
|
|
121
131
|
export declare const batchMerkleTree = "bmt1LryLZUMmF7ZtqESaw7wifBXLfXHQYoE4GAmrahU";
|
|
122
132
|
export declare const batchQueue = "oq1na8gojfdUhsfCpyjNt6h4JaDWtHf1yQj4koBWfto";
|
|
133
|
+
/**
|
|
134
|
+
* @internal
|
|
135
|
+
* Returns local test tree infos.
|
|
136
|
+
* V1: 2 state trees (smt/nfq/cpi pairs)
|
|
137
|
+
* V2: 5 batched state trees (bmt/oq/cpi triplets) + 1 address tree (amt2)
|
|
138
|
+
*/
|
|
139
|
+
export declare const localTestActiveStateTreeInfos: () => TreeInfo[];
|
|
123
140
|
export declare const confirmConfig: ConfirmOptions;
|
|
124
141
|
export declare const DEFAULT_MERKLE_TREE_HEIGHT = 26;
|
|
125
142
|
export declare const DEFAULT_MERKLE_TREE_ROOTS = 2800;
|
|
@@ -152,6 +169,10 @@ export declare const ADDRESS_QUEUE_ROLLOVER_FEE: BN;
|
|
|
152
169
|
*/
|
|
153
170
|
export declare const STATE_MERKLE_TREE_NETWORK_FEE: BN;
|
|
154
171
|
/**
|
|
155
|
-
* Is charged
|
|
172
|
+
* Is charged per address the transaction creates.
|
|
173
|
+
*/
|
|
174
|
+
export declare const ADDRESS_TREE_NETWORK_FEE_V1: BN;
|
|
175
|
+
/**
|
|
176
|
+
* Is charged per address the transaction creates.
|
|
156
177
|
*/
|
|
157
|
-
export declare const
|
|
178
|
+
export declare const ADDRESS_TREE_NETWORK_FEE_V2: BN;
|