@lightprotocol/stateless.js 0.22.1-alpha.7 → 0.23.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/browser/constants.d.ts +16 -0
- package/dist/cjs/browser/index.cjs +1 -1
- package/dist/cjs/browser/index.cjs.map +1 -1
- package/dist/cjs/browser/utils/address.d.ts +38 -7
- package/dist/cjs/browser/utils/instruction.d.ts +20 -0
- package/dist/cjs/node/constants.d.ts +16 -0
- package/dist/cjs/node/index.cjs +1 -1
- package/dist/cjs/node/index.cjs.map +1 -1
- package/dist/cjs/node/utils/address.d.ts +38 -7
- package/dist/cjs/node/utils/instruction.d.ts +20 -0
- package/dist/es/browser/constants.d.ts +16 -0
- package/dist/es/browser/index.js +1 -1
- package/dist/es/browser/index.js.map +1 -1
- package/dist/es/browser/utils/address.d.ts +38 -7
- package/dist/es/browser/utils/instruction.d.ts +20 -0
- package/dist/types/index.d.ts +75 -8
- package/package.json +3 -20
|
@@ -1,16 +1,47 @@
|
|
|
1
1
|
import { PublicKey } from '@solana/web3.js';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated Use deriveAddressSeed (no programId param) for V2.
|
|
4
|
+
* V1 seed derivation includes programId in hash.
|
|
5
|
+
*/
|
|
6
|
+
export declare function deriveAddressSeedLegacy(seeds: Uint8Array[], programId: PublicKey): Uint8Array;
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated Use deriveAddress with programId param for V2.
|
|
9
|
+
* V1 address derivation doesn't include programId.
|
|
10
|
+
*/
|
|
11
|
+
export declare function deriveAddressLegacy(seed: Uint8Array, addressMerkleTreePubkey?: PublicKey): PublicKey;
|
|
12
|
+
/**
|
|
13
|
+
* Explicit V2 address seed derivation - always uses V2 behavior regardless of feature flag.
|
|
14
|
+
* Use this when you explicitly want V2 derivation (e.g., in tests).
|
|
15
|
+
*/
|
|
4
16
|
export declare function deriveAddressSeedV2(seeds: Uint8Array[]): Uint8Array;
|
|
5
17
|
/**
|
|
6
|
-
*
|
|
18
|
+
* Derive an address seed from multiple seed components.
|
|
7
19
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* @
|
|
20
|
+
* V2 mode: Does NOT include programId in seed hash. Do not pass programId.
|
|
21
|
+
* V1 mode: Includes programId in seed hash. Must pass programId.
|
|
22
|
+
*
|
|
23
|
+
* @param seeds Array of seed bytes to combine
|
|
24
|
+
* @param programId (V1 only) Program ID - required in V1 mode, must be omitted in V2 mode
|
|
25
|
+
* @returns 32-byte address seed
|
|
26
|
+
*/
|
|
27
|
+
export declare function deriveAddressSeed(seeds: Uint8Array[], programId?: PublicKey): Uint8Array;
|
|
28
|
+
/**
|
|
29
|
+
* Explicit V2 address derivation - always uses V2 behavior regardless of feature flag.
|
|
30
|
+
* Use this when you explicitly want V2 derivation (e.g., in tests).
|
|
12
31
|
*/
|
|
13
32
|
export declare function deriveAddressV2(addressSeed: Uint8Array, addressMerkleTreePubkey: PublicKey, programId: PublicKey): PublicKey;
|
|
33
|
+
/**
|
|
34
|
+
* Derive an address for a compressed account.
|
|
35
|
+
*
|
|
36
|
+
* V2 mode: Requires programId, includes it in final hash.
|
|
37
|
+
* V1 mode: Must not pass programId, uses legacy derivation.
|
|
38
|
+
*
|
|
39
|
+
* @param addressSeed The address seed (32 bytes) from deriveAddressSeed
|
|
40
|
+
* @param addressMerkleTreePubkey Address tree public key
|
|
41
|
+
* @param programId (V2 only) Program ID - required in V2 mode, must be omitted in V1 mode
|
|
42
|
+
* @returns Derived address
|
|
43
|
+
*/
|
|
44
|
+
export declare function deriveAddress(addressSeed: Uint8Array, addressMerkleTreePubkey: PublicKey, programId?: PublicKey): PublicKey;
|
|
14
45
|
export interface NewAddressParams {
|
|
15
46
|
/**
|
|
16
47
|
* Seed for the compressed account. Must be seed used to derive
|
|
@@ -4,12 +4,25 @@ export declare class PackedAccounts {
|
|
|
4
4
|
private systemAccounts;
|
|
5
5
|
private nextIndex;
|
|
6
6
|
private map;
|
|
7
|
+
/**
|
|
8
|
+
* Create PackedAccounts with system accounts pre-added.
|
|
9
|
+
* Auto-selects V1 or V2 account layout based on featureFlags.
|
|
10
|
+
*/
|
|
7
11
|
static newWithSystemAccounts(config: SystemAccountMetaConfig): PackedAccounts;
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated Use newWithSystemAccounts - it auto-selects V2 when appropriate.
|
|
14
|
+
*/
|
|
8
15
|
static newWithSystemAccountsV2(config: SystemAccountMetaConfig): PackedAccounts;
|
|
9
16
|
addPreAccountsSigner(pubkey: PublicKey): void;
|
|
10
17
|
addPreAccountsSignerMut(pubkey: PublicKey): void;
|
|
11
18
|
addPreAccountsMeta(accountMeta: AccountMeta): void;
|
|
19
|
+
/**
|
|
20
|
+
* Add Light system accounts. Auto-selects V1 or V2 layout based on featureFlags.
|
|
21
|
+
*/
|
|
12
22
|
addSystemAccounts(config: SystemAccountMetaConfig): void;
|
|
23
|
+
/**
|
|
24
|
+
* @deprecated Use addSystemAccounts - it auto-selects V2 when appropriate.
|
|
25
|
+
*/
|
|
13
26
|
addSystemAccountsV2(config: SystemAccountMetaConfig): void;
|
|
14
27
|
insertOrGet(pubkey: PublicKey): number;
|
|
15
28
|
insertOrGetReadOnly(pubkey: PublicKey): number;
|
|
@@ -31,5 +44,12 @@ export declare class SystemAccountMetaConfig {
|
|
|
31
44
|
static new(selfProgram: PublicKey): SystemAccountMetaConfig;
|
|
32
45
|
static newWithCpiContext(selfProgram: PublicKey, cpiContext: PublicKey): SystemAccountMetaConfig;
|
|
33
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* @deprecated V1 system account layout. Use getLightSystemAccountMetas which auto-selects.
|
|
49
|
+
*/
|
|
50
|
+
export declare function getLightSystemAccountMetasLegacy(config: SystemAccountMetaConfig): AccountMeta[];
|
|
51
|
+
/**
|
|
52
|
+
* Get Light system account metas. Auto-selects V1 or V2 layout based on featureFlags.
|
|
53
|
+
*/
|
|
34
54
|
export declare function getLightSystemAccountMetas(config: SystemAccountMetaConfig): AccountMeta[];
|
|
35
55
|
export declare function getLightSystemAccountMetasV2(config: SystemAccountMetaConfig): AccountMeta[];
|
package/dist/types/index.d.ts
CHANGED
|
@@ -20,18 +20,49 @@ declare function encodeBN254toBase58(bigintNumber: BN): string;
|
|
|
20
20
|
|
|
21
21
|
declare const bn: (number: string | number | BN | Buffer$1 | Uint8Array | number[], base?: number | "hex" | undefined, endian?: BN.Endianness | undefined) => BN;
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
/**
|
|
24
|
+
* @deprecated Use deriveAddressSeed (no programId param) for V2.
|
|
25
|
+
* V1 seed derivation includes programId in hash.
|
|
26
|
+
*/
|
|
27
|
+
declare function deriveAddressSeedLegacy(seeds: Uint8Array[], programId: PublicKey): Uint8Array;
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated Use deriveAddress with programId param for V2.
|
|
30
|
+
* V1 address derivation doesn't include programId.
|
|
31
|
+
*/
|
|
32
|
+
declare function deriveAddressLegacy(seed: Uint8Array, addressMerkleTreePubkey?: PublicKey): PublicKey;
|
|
33
|
+
/**
|
|
34
|
+
* Explicit V2 address seed derivation - always uses V2 behavior regardless of feature flag.
|
|
35
|
+
* Use this when you explicitly want V2 derivation (e.g., in tests).
|
|
36
|
+
*/
|
|
25
37
|
declare function deriveAddressSeedV2(seeds: Uint8Array[]): Uint8Array;
|
|
26
38
|
/**
|
|
27
|
-
*
|
|
39
|
+
* Derive an address seed from multiple seed components.
|
|
28
40
|
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* @
|
|
41
|
+
* V2 mode: Does NOT include programId in seed hash. Do not pass programId.
|
|
42
|
+
* V1 mode: Includes programId in seed hash. Must pass programId.
|
|
43
|
+
*
|
|
44
|
+
* @param seeds Array of seed bytes to combine
|
|
45
|
+
* @param programId (V1 only) Program ID - required in V1 mode, must be omitted in V2 mode
|
|
46
|
+
* @returns 32-byte address seed
|
|
47
|
+
*/
|
|
48
|
+
declare function deriveAddressSeed(seeds: Uint8Array[], programId?: PublicKey): Uint8Array;
|
|
49
|
+
/**
|
|
50
|
+
* Explicit V2 address derivation - always uses V2 behavior regardless of feature flag.
|
|
51
|
+
* Use this when you explicitly want V2 derivation (e.g., in tests).
|
|
33
52
|
*/
|
|
34
53
|
declare function deriveAddressV2(addressSeed: Uint8Array, addressMerkleTreePubkey: PublicKey, programId: PublicKey): PublicKey;
|
|
54
|
+
/**
|
|
55
|
+
* Derive an address for a compressed account.
|
|
56
|
+
*
|
|
57
|
+
* V2 mode: Requires programId, includes it in final hash.
|
|
58
|
+
* V1 mode: Must not pass programId, uses legacy derivation.
|
|
59
|
+
*
|
|
60
|
+
* @param addressSeed The address seed (32 bytes) from deriveAddressSeed
|
|
61
|
+
* @param addressMerkleTreePubkey Address tree public key
|
|
62
|
+
* @param programId (V2 only) Program ID - required in V2 mode, must be omitted in V1 mode
|
|
63
|
+
* @returns Derived address
|
|
64
|
+
*/
|
|
65
|
+
declare function deriveAddress(addressSeed: Uint8Array, addressMerkleTreePubkey: PublicKey, programId?: PublicKey): PublicKey;
|
|
35
66
|
interface NewAddressParams {
|
|
36
67
|
/**
|
|
37
68
|
* Seed for the compressed account. Must be seed used to derive
|
|
@@ -140,12 +171,25 @@ declare class PackedAccounts {
|
|
|
140
171
|
private systemAccounts;
|
|
141
172
|
private nextIndex;
|
|
142
173
|
private map;
|
|
174
|
+
/**
|
|
175
|
+
* Create PackedAccounts with system accounts pre-added.
|
|
176
|
+
* Auto-selects V1 or V2 account layout based on featureFlags.
|
|
177
|
+
*/
|
|
143
178
|
static newWithSystemAccounts(config: SystemAccountMetaConfig): PackedAccounts;
|
|
179
|
+
/**
|
|
180
|
+
* @deprecated Use newWithSystemAccounts - it auto-selects V2 when appropriate.
|
|
181
|
+
*/
|
|
144
182
|
static newWithSystemAccountsV2(config: SystemAccountMetaConfig): PackedAccounts;
|
|
145
183
|
addPreAccountsSigner(pubkey: PublicKey): void;
|
|
146
184
|
addPreAccountsSignerMut(pubkey: PublicKey): void;
|
|
147
185
|
addPreAccountsMeta(accountMeta: AccountMeta): void;
|
|
186
|
+
/**
|
|
187
|
+
* Add Light system accounts. Auto-selects V1 or V2 layout based on featureFlags.
|
|
188
|
+
*/
|
|
148
189
|
addSystemAccounts(config: SystemAccountMetaConfig): void;
|
|
190
|
+
/**
|
|
191
|
+
* @deprecated Use addSystemAccounts - it auto-selects V2 when appropriate.
|
|
192
|
+
*/
|
|
149
193
|
addSystemAccountsV2(config: SystemAccountMetaConfig): void;
|
|
150
194
|
insertOrGet(pubkey: PublicKey): number;
|
|
151
195
|
insertOrGetReadOnly(pubkey: PublicKey): number;
|
|
@@ -167,6 +211,13 @@ declare class SystemAccountMetaConfig {
|
|
|
167
211
|
static new(selfProgram: PublicKey): SystemAccountMetaConfig;
|
|
168
212
|
static newWithCpiContext(selfProgram: PublicKey, cpiContext: PublicKey): SystemAccountMetaConfig;
|
|
169
213
|
}
|
|
214
|
+
/**
|
|
215
|
+
* @deprecated V1 system account layout. Use getLightSystemAccountMetas which auto-selects.
|
|
216
|
+
*/
|
|
217
|
+
declare function getLightSystemAccountMetasLegacy(config: SystemAccountMetaConfig): AccountMeta[];
|
|
218
|
+
/**
|
|
219
|
+
* Get Light system account metas. Auto-selects V1 or V2 layout based on featureFlags.
|
|
220
|
+
*/
|
|
170
221
|
declare function getLightSystemAccountMetas(config: SystemAccountMetaConfig): AccountMeta[];
|
|
171
222
|
declare function getLightSystemAccountMetasV2(config: SystemAccountMetaConfig): AccountMeta[];
|
|
172
223
|
|
|
@@ -332,7 +383,23 @@ declare enum VERSION {
|
|
|
332
383
|
declare const featureFlags: {
|
|
333
384
|
version: VERSION;
|
|
334
385
|
isV2: () => boolean;
|
|
386
|
+
/**
|
|
387
|
+
* Beta flag for interface methods (not yet deployed on mainnet).
|
|
388
|
+
* Runtime only - check LIGHT_PROTOCOL_BETA env var.
|
|
389
|
+
*/
|
|
390
|
+
isBeta: () => boolean;
|
|
335
391
|
};
|
|
392
|
+
/**
|
|
393
|
+
* Error message for beta-gated interface methods.
|
|
394
|
+
*/
|
|
395
|
+
declare const BETA_REQUIRED_ERROR: string;
|
|
396
|
+
/**
|
|
397
|
+
* Assert that beta features are enabled.
|
|
398
|
+
* Throws if V2 is not enabled OR if beta is not enabled.
|
|
399
|
+
*
|
|
400
|
+
* Use this at the entry point of all interface methods.
|
|
401
|
+
*/
|
|
402
|
+
declare function assertBetaEnabled(): void;
|
|
336
403
|
/**
|
|
337
404
|
* Returns the correct endpoint name for the current API version. E.g.
|
|
338
405
|
* versionedEndpoint('getCompressedAccount') -> 'getCompressedAccount' (V1)
|
|
@@ -6426,4 +6493,4 @@ declare class UtilsError extends MetaError {
|
|
|
6426
6493
|
*/
|
|
6427
6494
|
declare function isDevnetCompat(): boolean;
|
|
6428
6495
|
|
|
6429
|
-
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, isDevnetCompat, 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, toAccountMetas, toArray, toCamelCase, toHex, toUnixTimestamp, transfer, validateNumbers, validateNumbersForInclusionProof, validateNumbersForNonInclusionProof, validateNumbersForProof, validateSameOwner, validateSufficientBalance, versionedEndpoint, wrapBigNumbersAsStrings };
|
|
6496
|
+
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, BETA_REQUIRED_ERROR, 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, assertBetaEnabled, 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, deriveAddressLegacy, deriveAddressSeed, deriveAddressSeedLegacy, deriveAddressSeedV2, deriveAddressV2, deserializeAppendNullifyCreateAddressInputsIndexer, encodeBN254toBase58, encodeInstructionDataInvoke, encodePublicTransactionEvent, extendStateTreeLookupTable, featureFlags, getAccountCompressionAuthority, getAllStateTreeInfos, getBatchAddressTreeInfo, getCompressedTokenAccountByHashTest, getCompressedTokenAccounts, getCompressedTokenAccountsByDelegateTest, getCompressedTokenAccountsByOwnerTest, getConnection, getDefaultAddressSpace, getDefaultAddressTreeInfo, getIndexOrAdd, getLightSystemAccountMetas, getLightSystemAccountMetasLegacy, getLightSystemAccountMetasV2, getOutputQueue, getOutputTreeInfo, getParsedEvents, getPublicInputHash, getRegisteredProgramPda, getStateTreeInfoByPubkey, getTestKeypair, getTestRpc, getTreeInfoByPubkey, hashToBn254FieldSizeBe, hashvToBn254FieldSizeBe, hashvToBn254FieldSizeBeU8Array, invokeAccountsLayout, type invokeAccountsLayoutParams, isDevnetCompat, 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, toAccountMetas, toArray, toCamelCase, toHex, toUnixTimestamp, transfer, validateNumbers, validateNumbersForInclusionProof, validateNumbersForNonInclusionProof, validateNumbersForProof, validateSameOwner, validateSufficientBalance, versionedEndpoint, wrapBigNumbersAsStrings };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lightprotocol/stateless.js",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.0-beta.1",
|
|
4
4
|
"description": "JavaScript API for Light & ZK Compression",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/node/index.cjs",
|
|
@@ -84,28 +84,11 @@
|
|
|
84
84
|
"typescript": "^5.6.2",
|
|
85
85
|
"vitest": "^2.1.1"
|
|
86
86
|
},
|
|
87
|
-
"nx": {
|
|
88
|
-
"targets": {
|
|
89
|
-
"build": {
|
|
90
|
-
"inputs": [
|
|
91
|
-
"{workspaceRoot}/cli",
|
|
92
|
-
"{workspaceRoot}/target/idl",
|
|
93
|
-
"{workspaceRoot}/target/types"
|
|
94
|
-
]
|
|
95
|
-
},
|
|
96
|
-
"build-ci": {
|
|
97
|
-
"dependsOn": []
|
|
98
|
-
},
|
|
99
|
-
"test-ci": {
|
|
100
|
-
"dependsOn": []
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
87
|
"scripts": {
|
|
105
88
|
"test": "pnpm test:unit:all && pnpm test:e2e:all",
|
|
106
89
|
"test-ci": "vitest run tests/unit && pnpm test:e2e:all",
|
|
107
90
|
"test:v1": "pnpm build:v1 && LIGHT_PROTOCOL_VERSION=V1 vitest run tests/unit && LIGHT_PROTOCOL_VERSION=V1 pnpm test:e2e:all",
|
|
108
|
-
"test:v2": "pnpm build:v2 && LIGHT_PROTOCOL_VERSION=V2 vitest run tests/unit && LIGHT_PROTOCOL_VERSION=V2 pnpm test:e2e:all",
|
|
91
|
+
"test:v2": "pnpm build:v2 && LIGHT_PROTOCOL_VERSION=V2 vitest run tests/unit && LIGHT_PROTOCOL_VERSION=V2 LIGHT_PROTOCOL_BETA=true pnpm test:e2e:all",
|
|
109
92
|
"test-all": "vitest run",
|
|
110
93
|
"test:unit:all": "vitest run tests/unit --reporter=verbose",
|
|
111
94
|
"test:unit:all:v1": "LIGHT_PROTOCOL_VERSION=V1 vitest run tests/unit --reporter=verbose",
|
|
@@ -120,7 +103,7 @@
|
|
|
120
103
|
"test:e2e:rpc-interop": "pnpm test-validator && vitest run tests/e2e/rpc-interop.test.ts --reporter=verbose --bail=1",
|
|
121
104
|
"test:e2e:rpc-multi-trees": "pnpm test-validator && vitest run tests/e2e/rpc-multi-trees.test.ts --reporter=verbose --bail=1",
|
|
122
105
|
"test:e2e:browser": "pnpm playwright test",
|
|
123
|
-
"test:e2e:all": "pnpm test-validator && vitest run tests/e2e/test-rpc.test.ts && vitest run tests/e2e/compress.test.ts && vitest run tests/e2e/transfer.test.ts && vitest run tests/e2e/rpc-interop.test.ts && vitest run tests/e2e/interface-methods.test.ts && pnpm test-validator-skip-prover && vitest run tests/e2e/rpc-multi-trees.test.ts && vitest run tests/e2e/layout.test.ts && vitest run tests/e2e/safe-conversion.test.ts",
|
|
106
|
+
"test:e2e:all": "pnpm test-validator && vitest run tests/e2e/test-rpc.test.ts && vitest run tests/e2e/compress.test.ts && vitest run tests/e2e/transfer.test.ts && vitest run tests/e2e/rpc-interop.test.ts && if [ \"$LIGHT_PROTOCOL_VERSION\" != \"V1\" ]; then LIGHT_PROTOCOL_VERSION=V2 LIGHT_PROTOCOL_BETA=true vitest run tests/e2e/interface-methods.test.ts; fi && pnpm test-validator-skip-prover && vitest run tests/e2e/rpc-multi-trees.test.ts && vitest run tests/e2e/layout.test.ts && vitest run tests/e2e/safe-conversion.test.ts",
|
|
124
107
|
"test:index": "vitest run tests/e2e/program.test.ts",
|
|
125
108
|
"test:e2e:layout": "vitest run tests/e2e/layout.test.ts --reporter=verbose",
|
|
126
109
|
"test:e2e:safe-conversion": "vitest run tests/e2e/safe-conversion.test.ts --reporter=verbose",
|