@lightprotocol/stateless.js 0.22.0 → 0.22.1-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -10
- package/dist/cjs/browser/constants.d.ts +24 -7
- 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 +275 -275
- package/dist/cjs/browser/rpc.d.ts +5 -1
- package/dist/cjs/browser/test-helpers/test-rpc/test-rpc.d.ts +4 -0
- package/dist/cjs/browser/utils/address.d.ts +7 -6
- package/dist/cjs/browser/utils/conversion.d.ts +1 -0
- package/dist/cjs/browser/utils/index.d.ts +1 -0
- package/dist/cjs/browser/utils/instruction.d.ts +35 -0
- package/dist/cjs/node/constants.d.ts +24 -7
- 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 +275 -275
- package/dist/cjs/node/rpc.d.ts +5 -1
- package/dist/cjs/node/test-helpers/test-rpc/test-rpc.d.ts +4 -0
- package/dist/cjs/node/utils/address.d.ts +7 -6
- package/dist/cjs/node/utils/conversion.d.ts +1 -0
- package/dist/cjs/node/utils/index.d.ts +1 -0
- package/dist/cjs/node/utils/instruction.d.ts +35 -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 +157 -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 +2779 -0
- package/dist/es/browser/rpc.d.ts +284 -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 +40 -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 +239 -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 +48 -0
- package/dist/es/browser/utils/index.d.ts +13 -0
- package/dist/es/browser/utils/instruction.d.ts +35 -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 +78 -16
- package/package.json +16 -8
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _solana_web3_js from '@solana/web3.js';
|
|
2
|
-
import { PublicKey, Connection, Commitment, Keypair, Signer, TransactionInstruction, AddressLookupTableAccount, VersionedTransaction, ConfirmOptions, TransactionSignature, RpcResponseAndContext, SignatureResult, DataSlice, MemcmpFilter, ConnectionConfig, ParsedTransactionWithMeta
|
|
2
|
+
import { PublicKey, Connection, Commitment, Keypair, Signer, AccountMeta, TransactionInstruction, AddressLookupTableAccount, VersionedTransaction, ConfirmOptions, TransactionSignature, RpcResponseAndContext, SignatureResult, DataSlice, MemcmpFilter, 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';
|
|
@@ -21,16 +21,17 @@ declare function encodeBN254toBase58(bigintNumber: BN): string;
|
|
|
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
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;
|
|
24
26
|
/**
|
|
25
|
-
*
|
|
26
|
-
* tree public key.
|
|
27
|
+
* Derives an address from a seed using the v2 method (matching Rust's derive_address_from_seed)
|
|
27
28
|
*
|
|
28
|
-
* @param
|
|
29
|
-
* @param addressMerkleTreePubkey Merkle tree public key
|
|
30
|
-
*
|
|
29
|
+
* @param addressSeed The address seed (32 bytes)
|
|
30
|
+
* @param addressMerkleTreePubkey Merkle tree public key
|
|
31
|
+
* @param programId Program ID
|
|
31
32
|
* @returns Derived address
|
|
32
33
|
*/
|
|
33
|
-
declare function
|
|
34
|
+
declare function deriveAddressV2(addressSeed: Uint8Array, addressMerkleTreePubkey: PublicKey, programId: PublicKey): PublicKey;
|
|
34
35
|
interface NewAddressParams {
|
|
35
36
|
/**
|
|
36
37
|
* Seed for the compressed account. Must be seed used to derive
|
|
@@ -117,6 +118,7 @@ declare const toCamelCase: (object: any) => any;
|
|
|
117
118
|
* @deprecated Use `hashvToBn254FieldSizeBe` instead.
|
|
118
119
|
*/
|
|
119
120
|
declare function hashToBn254FieldSizeBe(bytes: Buffer$1): [Buffer$1, number] | null;
|
|
121
|
+
declare function hashvToBn254FieldSizeBeU8Array(bytes: Uint8Array[]): Uint8Array;
|
|
120
122
|
/**
|
|
121
123
|
* Hash the provided `bytes` with Keccak256 and ensure that the result fits in
|
|
122
124
|
* the BN254 prime field by truncating the resulting hash to 31 bytes.
|
|
@@ -133,6 +135,41 @@ declare function convertInvokeCpiWithReadOnlyToInvoke(data: any): InstructionDat
|
|
|
133
135
|
/** @internal remove signer from signers if part of signers */
|
|
134
136
|
declare function dedupeSigner(signer: Signer, signers: Signer[]): Signer[];
|
|
135
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
|
+
|
|
136
173
|
interface GnarkProofJson {
|
|
137
174
|
ar: string[];
|
|
138
175
|
bs: string[][];
|
|
@@ -305,11 +342,11 @@ declare const versionedEndpoint: (base: string) => string;
|
|
|
305
342
|
declare const FIELD_SIZE: BN;
|
|
306
343
|
declare const HIGHEST_ADDRESS_PLUS_ONE: BN;
|
|
307
344
|
declare const COMPUTE_BUDGET_PATTERN: number[];
|
|
308
|
-
declare const INVOKE_DISCRIMINATOR: Buffer$1
|
|
309
|
-
declare const INVOKE_CPI_DISCRIMINATOR: Buffer$1
|
|
310
|
-
declare const INVOKE_CPI_WITH_READ_ONLY_DISCRIMINATOR: Buffer$1
|
|
311
|
-
declare const INVOKE_CPI_WITH_ACCOUNT_INFO_DISCRIMINATOR: Buffer$1
|
|
312
|
-
declare const INSERT_INTO_QUEUES_DISCRIMINATOR: Buffer$1
|
|
345
|
+
declare const INVOKE_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
|
|
346
|
+
declare const INVOKE_CPI_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
|
|
347
|
+
declare const INVOKE_CPI_WITH_READ_ONLY_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
|
|
348
|
+
declare const INVOKE_CPI_WITH_ACCOUNT_INFO_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
|
|
349
|
+
declare const INSERT_INTO_QUEUES_DISCRIMINATOR: Buffer$1<ArrayBuffer>;
|
|
313
350
|
declare const noopProgram = "noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV";
|
|
314
351
|
declare const lightSystemProgram = "SySTEM1eSU2p4BGQfQpimFEWWSC1XDFeun3Nqzz3rT7";
|
|
315
352
|
declare const accountCompressionProgram = "compr6CUsB5m2jS4Y3831ztGSTnDpnKJTKS95d64XVq";
|
|
@@ -382,8 +419,25 @@ declare const addressQueue = "aq1S9z4reTSQAdgWHGD2zDaS39sjGrAxbR31vxJ2F4F";
|
|
|
382
419
|
declare const merkleTree2Pubkey = "smt2rJAFdyJJupwMKAqTNAJwvjhmiZ4JYGZmbVRw1Ho";
|
|
383
420
|
declare const nullifierQueue2Pubkey = "nfq2hgS7NYemXsFaFUCe3EMXSDSfnZnAe27jC6aPP1X";
|
|
384
421
|
declare const cpiContext2Pubkey = "cpi2cdhkH5roePvcudTgUL8ppEBfTay1desGh8G8QxK";
|
|
385
|
-
declare const
|
|
386
|
-
declare const
|
|
422
|
+
declare const batchMerkleTree1 = "bmt1LryLZUMmF7ZtqESaw7wifBXLfXHQYoE4GAmrahU";
|
|
423
|
+
declare const batchQueue1 = "oq1na8gojfdUhsfCpyjNt6h4JaDWtHf1yQj4koBWfto";
|
|
424
|
+
declare const batchCpiContext1 = "cpi15BoVPKgEPw5o8wc2T816GE7b378nMXnhH3Xbq4y";
|
|
425
|
+
declare const batchMerkleTree2 = "bmt2UxoBxB9xWev4BkLvkGdapsz6sZGkzViPNph7VFi";
|
|
426
|
+
declare const batchQueue2 = "oq2UkeMsJLfXt2QHzim242SUi3nvjJs8Pn7Eac9H9vg";
|
|
427
|
+
declare const batchCpiContext2 = "cpi2yGapXUR3As5SjnHBAVvmApNiLsbeZpF3euWnW6B";
|
|
428
|
+
declare const batchMerkleTree3 = "bmt3ccLd4bqSVZVeCJnH1F6C8jNygAhaDfxDwePyyGb";
|
|
429
|
+
declare const batchQueue3 = "oq3AxjekBWgo64gpauB6QtuZNesuv19xrhaC1ZM1THQ";
|
|
430
|
+
declare const batchCpiContext3 = "cpi3mbwMpSX8FAGMZVP85AwxqCaQMfEk9Em1v8QK9Rf";
|
|
431
|
+
declare const batchMerkleTree4 = "bmt4d3p1a4YQgk9PeZv5s4DBUmbF5NxqYpk9HGjQsd8";
|
|
432
|
+
declare const batchQueue4 = "oq4ypwvVGzCUMoiKKHWh4S1SgZJ9vCvKpcz6RT6A8dq";
|
|
433
|
+
declare const batchCpiContext4 = "cpi4yyPDc4bCgHAnsenunGA8Y77j3XEDyjgfyCKgcoc";
|
|
434
|
+
declare const batchMerkleTree5 = "bmt5yU97jC88YXTuSukYHa8Z5Bi2ZDUtmzfkDTA2mG2";
|
|
435
|
+
declare const batchQueue5 = "oq5oh5ZR3yGomuQgFduNDzjtGvVWfDRGLuDVjv9a96P";
|
|
436
|
+
declare const batchCpiContext5 = "cpi5ZTjdgYpZ1Xr7B1cMLLUE81oTtJbNNAyKary2nV6";
|
|
437
|
+
declare const batchAddressTree = "amt2kaJA14v3urZbZvnc5v2np8jqvc4Z8zDep5wbtzx";
|
|
438
|
+
declare const testBatchAddressTree = "EzKE84aVTkCUhDHLELqyJaq1Y7UVVmqxXqZjVHwHY3rK";
|
|
439
|
+
declare const batchMerkleTree = "bmt1LryLZUMmF7ZtqESaw7wifBXLfXHQYoE4GAmrahU";
|
|
440
|
+
declare const batchQueue = "oq1na8gojfdUhsfCpyjNt6h4JaDWtHf1yQj4koBWfto";
|
|
387
441
|
declare const confirmConfig: ConfirmOptions;
|
|
388
442
|
declare const DEFAULT_MERKLE_TREE_HEIGHT = 26;
|
|
389
443
|
declare const DEFAULT_MERKLE_TREE_ROOTS = 2800;
|
|
@@ -3967,6 +4021,10 @@ declare class TestRpc extends Connection implements CompressionApiInterface {
|
|
|
3967
4021
|
*/
|
|
3968
4022
|
getStateTreeInfos(): Promise<TreeInfo[]>;
|
|
3969
4023
|
doFetch(): Promise<TreeInfo[]>;
|
|
4024
|
+
/**
|
|
4025
|
+
* Get a V2 address tree info.
|
|
4026
|
+
*/
|
|
4027
|
+
getAddressTreeInfoV2(): Promise<TreeInfo>;
|
|
3970
4028
|
/**
|
|
3971
4029
|
* Fetch the compressed account for the specified account hash
|
|
3972
4030
|
*/
|
|
@@ -4376,7 +4434,7 @@ declare function parseAccountData({ discriminator, data, dataHash, }: {
|
|
|
4376
4434
|
dataHash: BN;
|
|
4377
4435
|
}): {
|
|
4378
4436
|
discriminator: number[];
|
|
4379
|
-
data: Buffer$1
|
|
4437
|
+
data: Buffer$1<ArrayBuffer>;
|
|
4380
4438
|
dataHash: number[];
|
|
4381
4439
|
};
|
|
4382
4440
|
/**
|
|
@@ -4464,6 +4522,10 @@ declare class Rpc extends Connection implements CompressionApiInterface {
|
|
|
4464
4522
|
* @internal
|
|
4465
4523
|
*/
|
|
4466
4524
|
doFetch(): Promise<TreeInfo[]>;
|
|
4525
|
+
/**
|
|
4526
|
+
* Get a V2 address tree info.
|
|
4527
|
+
*/
|
|
4528
|
+
getAddressTreeInfoV2(): Promise<TreeInfo>;
|
|
4467
4529
|
/**
|
|
4468
4530
|
* Fetch the compressed account for the specified account address or hash
|
|
4469
4531
|
*/
|
|
@@ -6118,4 +6180,4 @@ declare class MerkleTreeError extends MetaError {
|
|
|
6118
6180
|
declare class UtilsError extends MetaError {
|
|
6119
6181
|
}
|
|
6120
6182
|
|
|
6121
|
-
export { ADDRESS_QUEUE_ROLLOVER_FEE, ADDRESS_TREE_NETWORK_FEE, ALICE, type AccountProofInput, AccountProofResult, type ActiveTreeBundle, type AddressTreeInfo, type AddressWithTree, type AddressWithTreeInfo, AppendLeavesInputLayout, AppendNullifyCreateAddressInputsMetaLayout, type BN254, BOB, BalanceResult, CHARLIE, COMPRESSED_TOKEN_PROGRAM_ID, COMPUTE_BUDGET_PATTERN, type ClientSubscriptionId, type CompressedAccount, type CompressedAccountData, CompressedAccountLayout, 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, 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, type PackedAddressTreeInfo, type PackedCompressedAccountWithMerkleContext, 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, type SignatureWithMetadata, SlotResult, type StateTreeInfo, type StateTreeLUTPair, TRANSACTION_MERKLE_TREE_ROLLOVER_THRESHOLD, TestRpc, type TestRpcConfig, type TokenBalance, TokenBalanceListResult, TokenBalanceListResultV2, TokenBalanceResult, type TokenData$1 as TokenData, TokenDataLayout, TokenDataResult, type TreeInfo, TreeType, UTXO_MERGE_MAXIMUM, UTXO_MERGE_THRESHOLD, UtilsError, UtilsErrorCode, UtxoError, UtxoErrorCode, VERSION, type ValidityProof, ValidityProofResult, ValidityProofResultV2, type ValidityProofWithContext, type WithContext, type WithCursor, type WithRpcContext, accountCompressionProgram, addressQueue, addressTree, airdropSol, batchMerkleTree, batchQueue, 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, deserializeAppendNullifyCreateAddressInputsIndexer, encodeBN254toBase58, encodeInstructionDataInvoke, encodePublicTransactionEvent, extendStateTreeLookupTable, featureFlags, getAccountCompressionAuthority, getAllStateTreeInfos, getCompressedTokenAccountByHashTest, getCompressedTokenAccounts, getCompressedTokenAccountsByDelegateTest, getCompressedTokenAccountsByOwnerTest, getConnection, getDefaultAddressTreeInfo, getIndexOrAdd, getParsedEvents, getPublicInputHash, getRegisteredProgramPda, getStateTreeInfoByPubkey, getTestKeypair, getTestRpc, getTreeInfoByPubkey, hashToBn254FieldSizeBe, hashvToBn254FieldSizeBe, invokeAccountsLayout, type invokeAccountsLayoutParams, isLocalTest, isSmallerThanBn254FieldSizeBe, jsonRpcResult, jsonRpcResultAndContext, lightSystemProgram, localTestActiveStateTreeInfos, merkleTree2Pubkey, merkletreePubkey, negateAndCompressProof, newAccountWithLamports, noopProgram, nullifiedStateTreeLookupTableDevnet, nullifiedStateTreeLookupTableMainnet, nullifierQueue2Pubkey, nullifierQueuePubkey, nullifyLookupTable, packCompressedAccounts, 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 };
|
|
6183
|
+
export { ADDRESS_QUEUE_ROLLOVER_FEE, ADDRESS_TREE_NETWORK_FEE, ALICE, type AccountProofInput, AccountProofResult, type ActiveTreeBundle, type AddressTreeInfo, type AddressWithTree, type AddressWithTreeInfo, AppendLeavesInputLayout, AppendNullifyCreateAddressInputsMetaLayout, type BN254, BOB, BalanceResult, CHARLIE, COMPRESSED_TOKEN_PROGRAM_ID, COMPUTE_BUDGET_PATTERN, type ClientSubscriptionId, type CompressedAccount, type CompressedAccountData, CompressedAccountLayout, 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, 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, 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, type SignatureWithMetadata, SlotResult, type StateTreeInfo, type StateTreeLUTPair, SystemAccountMetaConfig, 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, 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, getCompressedTokenAccountByHashTest, getCompressedTokenAccounts, getCompressedTokenAccountsByDelegateTest, getCompressedTokenAccountsByOwnerTest, getConnection, getDefaultAddressTreeInfo, getIndexOrAdd, getLightSystemAccountMetas, getLightSystemAccountMetasV2, getParsedEvents, getPublicInputHash, getRegisteredProgramPda, getStateTreeInfoByPubkey, getTestKeypair, getTestRpc, getTreeInfoByPubkey, hashToBn254FieldSizeBe, hashvToBn254FieldSizeBe, hashvToBn254FieldSizeBeU8Array, invokeAccountsLayout, type invokeAccountsLayoutParams, isLocalTest, isSmallerThanBn254FieldSizeBe, jsonRpcResult, jsonRpcResultAndContext, lightSystemProgram, localTestActiveStateTreeInfos, merkleTree2Pubkey, merkletreePubkey, negateAndCompressProof, newAccountWithLamports, noopProgram, nullifiedStateTreeLookupTableDevnet, nullifiedStateTreeLookupTableMainnet, nullifierQueue2Pubkey, nullifierQueuePubkey, nullifyLookupTable, packCompressedAccounts, 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 };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lightprotocol/stateless.js",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.1-alpha.1",
|
|
4
4
|
"description": "JavaScript API for Light & ZK Compression",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/node/index.cjs",
|
|
@@ -49,9 +49,10 @@
|
|
|
49
49
|
"superstruct": "2.0.2"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@coral-xyz/anchor": "0.29.0",
|
|
52
|
+
"@coral-xyz/anchor": "^0.29.0",
|
|
53
53
|
"@coral-xyz/borsh": "^0.29.0",
|
|
54
54
|
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
|
|
55
|
+
"@eslint/js": "9.36.0",
|
|
55
56
|
"@lightprotocol/hasher.rs": "0.2.1",
|
|
56
57
|
"@playwright/test": "^1.47.1",
|
|
57
58
|
"@rollup/plugin-babel": "^6.0.4",
|
|
@@ -61,12 +62,12 @@
|
|
|
61
62
|
"@rollup/plugin-replace": "^5.0.7",
|
|
62
63
|
"@rollup/plugin-terser": "^0.4.4",
|
|
63
64
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
64
|
-
"@solana/web3.js": "1.98.
|
|
65
|
+
"@solana/web3.js": "1.98.4",
|
|
65
66
|
"@types/bn.js": "^5.1.5",
|
|
66
67
|
"@types/node": "^22.5.5",
|
|
67
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
68
|
-
"@typescript-eslint/parser": "^
|
|
69
|
-
"eslint": "^
|
|
68
|
+
"@typescript-eslint/eslint-plugin": "^8.44.0",
|
|
69
|
+
"@typescript-eslint/parser": "^8.44.0",
|
|
70
|
+
"eslint": "^9.36.0",
|
|
70
71
|
"eslint-plugin-n": "^17.10.2",
|
|
71
72
|
"eslint-plugin-promise": "^7.1.0",
|
|
72
73
|
"eslint-plugin-vitest": "^0.5.4",
|
|
@@ -81,8 +82,7 @@
|
|
|
81
82
|
"tslib": "^2.7.0",
|
|
82
83
|
"tweetnacl": "1.0.3",
|
|
83
84
|
"typescript": "^5.6.2",
|
|
84
|
-
"vitest": "^2.1.1"
|
|
85
|
-
"@lightprotocol/programs": "0.3.0"
|
|
85
|
+
"vitest": "^2.1.1"
|
|
86
86
|
},
|
|
87
87
|
"nx": {
|
|
88
88
|
"targets": {
|
|
@@ -92,6 +92,12 @@
|
|
|
92
92
|
"{workspaceRoot}/target/idl",
|
|
93
93
|
"{workspaceRoot}/target/types"
|
|
94
94
|
]
|
|
95
|
+
},
|
|
96
|
+
"build-ci": {
|
|
97
|
+
"dependsOn": []
|
|
98
|
+
},
|
|
99
|
+
"test-ci": {
|
|
100
|
+
"dependsOn": []
|
|
95
101
|
}
|
|
96
102
|
}
|
|
97
103
|
},
|
|
@@ -124,6 +130,8 @@
|
|
|
124
130
|
"build:bundle": "rimraf dist && rollup -c",
|
|
125
131
|
"build:v1": "LIGHT_PROTOCOL_VERSION=V1 pnpm build:bundle",
|
|
126
132
|
"build:v2": "LIGHT_PROTOCOL_VERSION=V2 pnpm build:bundle",
|
|
133
|
+
"build-ci": "if [ \"$LIGHT_PROTOCOL_VERSION\" = \"V2\" ]; then LIGHT_PROTOCOL_VERSION=V2 pnpm build:bundle; else LIGHT_PROTOCOL_VERSION=V1 pnpm build:bundle; fi",
|
|
134
|
+
"test-ci": "pnpm test",
|
|
127
135
|
"format": "prettier --write .",
|
|
128
136
|
"lint": "eslint ."
|
|
129
137
|
}
|