@lightprotocol/stateless.js 0.5.1 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/browser/index.cjs +43 -5
- package/dist/cjs/browser/index.cjs.map +1 -1
- package/dist/cjs/node/index.cjs +43 -5
- package/dist/cjs/node/index.cjs.map +1 -1
- package/dist/es/browser/index.js +42 -5
- package/dist/es/browser/index.js.map +1 -1
- package/dist/types/index.d.ts +34 -7
- package/package.json +3 -3
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _solana_web3_js from '@solana/web3.js';
|
|
2
|
-
import { PublicKey, Connection, Commitment, Keypair, TransactionInstruction, VersionedTransaction, ConfirmOptions, TransactionSignature, RpcResponseAndContext, SignatureResult, Signer,
|
|
2
|
+
import { PublicKey, Connection, Commitment, Keypair, TransactionInstruction, VersionedTransaction, ConfirmOptions, TransactionSignature, RpcResponseAndContext, SignatureResult, Signer, DataSlice, MemcmpFilter, ConnectionConfig, AccountMeta, ParsedTransactionWithMeta } from '@solana/web3.js';
|
|
3
3
|
import { Buffer as Buffer$1 } from 'buffer';
|
|
4
4
|
import * as superstruct_dist_utils from 'superstruct/dist/utils';
|
|
5
5
|
import { Struct } from 'superstruct';
|
|
@@ -346,6 +346,12 @@ interface LatestNonVotingSignatures {
|
|
|
346
346
|
}[];
|
|
347
347
|
};
|
|
348
348
|
}
|
|
349
|
+
interface GetCompressedAccountsByOwnerConfig {
|
|
350
|
+
filters?: GetCompressedAccountsFilter[];
|
|
351
|
+
dataSlice?: DataSlice;
|
|
352
|
+
cursor?: string;
|
|
353
|
+
limit?: BN;
|
|
354
|
+
}
|
|
349
355
|
interface LatestNonVotingSignaturesPaginated {
|
|
350
356
|
context: {
|
|
351
357
|
slot: number;
|
|
@@ -400,12 +406,15 @@ interface GetCompressedTokenAccountsByOwnerOrDelegateOptions {
|
|
|
400
406
|
cursor?: string;
|
|
401
407
|
limit?: BN;
|
|
402
408
|
}
|
|
403
|
-
|
|
409
|
+
/**
|
|
410
|
+
* Note, DataSizeFilter is currently not available.
|
|
411
|
+
*/
|
|
412
|
+
type GetCompressedAccountsFilter = MemcmpFilter;
|
|
404
413
|
type GetCompressedAccountConfig = {
|
|
405
414
|
encoding?: string;
|
|
406
415
|
};
|
|
407
416
|
type GetCompressedAccountsConfig = {
|
|
408
|
-
|
|
417
|
+
dataSlice: DataSlice;
|
|
409
418
|
filters?: GetCompressedAccountsFilter[];
|
|
410
419
|
};
|
|
411
420
|
interface ParsedTokenAccount {
|
|
@@ -420,6 +429,10 @@ type WithContext<T> = {
|
|
|
420
429
|
/** response value */
|
|
421
430
|
value: T;
|
|
422
431
|
};
|
|
432
|
+
type WithCursor<T> = {
|
|
433
|
+
cursor: PublicKey | null;
|
|
434
|
+
value: T;
|
|
435
|
+
};
|
|
423
436
|
/**
|
|
424
437
|
* @internal
|
|
425
438
|
*/
|
|
@@ -1411,7 +1424,8 @@ interface CompressionApiInterface {
|
|
|
1411
1424
|
getMultipleCompressedAccountProofs(hashes: BN254[]): Promise<MerkleContextWithMerkleProof[]>;
|
|
1412
1425
|
getValidityProof(hashes: BN254[], newAddresses: BN254[]): Promise<CompressedProofWithContext>;
|
|
1413
1426
|
getValidityProofAndRpcContext(hashes: BN254[], newAddresses: BN254[]): Promise<WithContext<CompressedProofWithContext>>;
|
|
1414
|
-
getCompressedAccountsByOwner(owner: PublicKey): Promise<CompressedAccountWithMerkleContext[]>;
|
|
1427
|
+
getCompressedAccountsByOwner(owner: PublicKey, config?: GetCompressedAccountsByOwnerConfig): Promise<CompressedAccountWithMerkleContext[]>;
|
|
1428
|
+
getCompressedAccountsByOwnerWithCursor(owner: PublicKey, config?: GetCompressedAccountsByOwnerConfig): Promise<WithCursor<CompressedAccountWithMerkleContext[]>>;
|
|
1415
1429
|
getCompressedTokenAccountsByOwner(publicKey: PublicKey, options: GetCompressedTokenAccountsByOwnerOrDelegateOptions): Promise<ParsedTokenAccount[]>;
|
|
1416
1430
|
getCompressedTokenAccountsByDelegate(delegate: PublicKey, options: GetCompressedTokenAccountsByOwnerOrDelegateOptions): Promise<ParsedTokenAccount[]>;
|
|
1417
1431
|
getCompressedTokenAccountBalance(hash: BN254): Promise<{
|
|
@@ -1534,7 +1548,14 @@ declare class Rpc extends Connection implements CompressionApiInterface {
|
|
|
1534
1548
|
* Fetch all the compressed accounts owned by the specified public key.
|
|
1535
1549
|
* Owner can be a program or user account
|
|
1536
1550
|
*/
|
|
1537
|
-
|
|
1551
|
+
getCompressedAccountsByOwnerWithCursor(owner: PublicKey, config?: GetCompressedAccountsByOwnerConfig): Promise<WithCursor<CompressedAccountWithMerkleContext[]>>;
|
|
1552
|
+
/**
|
|
1553
|
+
* Fetch all the compressed accounts owned by the specified public key.
|
|
1554
|
+
* Owner can be a program or user account
|
|
1555
|
+
*
|
|
1556
|
+
* To use `config.limit` or `config.cursor`, please use {@link getCompressedAccountsByOwnerWithCursor} instead.
|
|
1557
|
+
*/
|
|
1558
|
+
getCompressedAccountsByOwner(owner: PublicKey, config?: GetCompressedAccountsByOwnerConfig): Promise<CompressedAccountWithMerkleContext[]>;
|
|
1538
1559
|
/**
|
|
1539
1560
|
* Fetch all the compressed token accounts owned by the specified public
|
|
1540
1561
|
* key. Owner can be a program or user account
|
|
@@ -6757,7 +6778,13 @@ declare class TestRpc extends Connection implements CompressionApiInterface {
|
|
|
6757
6778
|
* Fetch all the compressed accounts owned by the specified public key.
|
|
6758
6779
|
* Owner can be a program or user account
|
|
6759
6780
|
*/
|
|
6760
|
-
getCompressedAccountsByOwner(owner: PublicKey): Promise<CompressedAccountWithMerkleContext[]>;
|
|
6781
|
+
getCompressedAccountsByOwner(owner: PublicKey, _config?: GetCompressedAccountsByOwnerConfig): Promise<CompressedAccountWithMerkleContext[]>;
|
|
6782
|
+
/**
|
|
6783
|
+
* Fetch all the compressed accounts owned by the specified public key.
|
|
6784
|
+
* Owner can be a program or user account
|
|
6785
|
+
* Returns with cursor
|
|
6786
|
+
*/
|
|
6787
|
+
getCompressedAccountsByOwnerWithCursor(owner: PublicKey, _config?: GetCompressedAccountsByOwnerConfig): Promise<WithCursor<CompressedAccountWithMerkleContext[]>>;
|
|
6761
6788
|
/**
|
|
6762
6789
|
* Fetch the latest compression signatures on the cluster. Results are
|
|
6763
6790
|
* paginated.
|
|
@@ -7056,4 +7083,4 @@ declare function getParsedEvents(rpc: Rpc): Promise<PublicTransactionEvent[]>;
|
|
|
7056
7083
|
declare const parseEvents: <T>(indexerEventsTransactions: (ParsedTransactionWithMeta | null)[], deserializeFn: Deserializer<T>) => NonNullable<T>[];
|
|
7057
7084
|
declare const parsePublicTransactionEventWithIdl: (data: Buffer) => PublicTransactionEvent | null;
|
|
7058
7085
|
|
|
7059
|
-
export { ADDRESS_QUEUE_ROLLOVER_FEE, ADDRESS_TREE_NETWORK_FEE, ALICE, type AccountCompression, IDL$3 as AccountCompressionIDL, AccountProofResult, type BN254, BOB, BalanceResult, CHARLIE, type CompressedAccount, type CompressedAccountData, CompressedAccountResult, type CompressedAccountWithMerkleContext, CompressedAccountsByOwnerResult, type CompressedProof, type CompressedProofWithContext, CompressedTokenAccountResult, CompressedTokenAccountsByOwnerOrDelegateResult, type CompressedTokenInstructionDataTransfer, type CompressedTransaction, CompressedTransactionResult, type CompressionApiInterface, CreateUtxoError, CreateUtxoErrorCode, DAVE, DEFAULT_MERKLE_TREE_HEIGHT, DEFAULT_MERKLE_TREE_ROOTS, DEFAULT_ZERO, FIELD_SIZE, type GetCompressedAccountConfig, type GetCompressedAccountsConfig, type GetCompressedAccountsFilter, type GetCompressedTokenAccountsByOwnerOrDelegateOptions, HIGHEST_ADDRESS_PLUS_ONE, HashError, HashErrorCode, HealthResult, type HexBatchInputsForProver, type HexInputsForProver, IndexedArray, IndexedElement, IndexedElementBundle, type InputTokenDataWithContext, type InstructionDataInvoke, type LatestNonVotingSignatures, type LatestNonVotingSignaturesPaginated, LatestNonVotingSignaturesResult, LatestNonVotingSignaturesResultPaginated, type LightCompressedToken, IDL as LightCompressedTokenIDL, type LightRegistry, IDL$2 as LightRegistryIDL, type LightSystemProgram$1 as LightSystem, IDL$1 as LightSystemIDL, LightSystemProgram, type LightWasm, LookupTableError, LookupTableErrorCode, MerkeProofResult, type MerkleContext, type MerkleContextWithMerkleProof, type MerkleContextWithNewAddressProof, MerkleTree, MerkleTreeError, MerkleTreeErrorCode, MultipleCompressedAccountsResult, MultipleMerkleProofsResult, NativeBalanceResult, type NewAddressParams, type NewAddressParamsPacked, NewAddressProofResult, type NonInclusionJsonStruct, type NonInclusionMerkleProofInputs, type OutputCompressedAccountWithPackedContext, type PackedCompressedAccountWithMerkleContext, type PackedMerkleContext, type ParsedTokenAccount, ProofError, ProofErrorCode, type PublicTransactionEvent, type QueueIndex, Rpc, RpcError, RpcErrorCode, STATE_MERKLE_TREE_NETWORK_FEE, STATE_MERKLE_TREE_ROLLOVER_FEE, SelectInUtxosError, SelectInUtxosErrorCode, SignatureListResult, SignatureListWithCursorResult, type SignatureWithMetadata, SlotResult, TRANSACTION_MERKLE_TREE_ROLLOVER_THRESHOLD, TestRpc, type TestRpcConfig, TokenBalanceListResult, TokenBalanceResult, type TokenData, TokenDataResult, type TokenTransferOutputData, UTXO_MERGE_MAXIMUM, UTXO_MERGE_THRESHOLD, UtilsError, UtilsErrorCode, UtxoError, UtxoErrorCode, ValidityProofResult, type WithContext, accountCompressionProgram, addressQueue, addressTree, airdropSol, bn, bufToDecStr, buildAndSignTx, buildTx, byteArrayToKeypair, checkValidityProofShape, compress, confirmConfig, confirmTransaction, confirmTx, convertMerkleProofsWithContextToHex, convertNonInclusionMerkleProofInputsToHex, createAccount, createAccountWithLamports, createBN254, createCompressedAccount, createCompressedAccountWithMerkleContext, createMerkleContext, createRpc, createRpcResult, decompress, dedupeSigner, defaultStaticAccounts, defaultStaticAccountsStruct, defaultTestStateTreeAccounts, deriveAddress, encodeBN254toBase58, getAccountCompressionAuthority, getConnection, getIndexOrAdd, getParsedEvents, getRegisteredProgramPda, getTestKeypair, getTestRpc, hashToBn254FieldSizeBe, jsonRpcResult, jsonRpcResultAndContext, lightProgram, merkletreePubkey, negateAndCompressProof, newAccountWithLamports, noopProgram, nullifierQueuePubkey, packCompressedAccounts, packNewAddressParams, padOutputStateMerkleTrees, parseAccountData, parseEvents, parsePublicTransactionEventWithIdl, pipe, placeholderValidityProof, proofFromJsonStruct, proverRequest, pushUniqueItems, rpcRequest, selectMinCompressedSolAccountsForTransfer, sendAndConfirmTx, sleep, sumUpLamports, toAccountMetas, toArray, toCamelCase, toHex, toUnixTimestamp, transfer, useWallet, validateSameOwner, validateSufficientBalance };
|
|
7086
|
+
export { ADDRESS_QUEUE_ROLLOVER_FEE, ADDRESS_TREE_NETWORK_FEE, ALICE, type AccountCompression, IDL$3 as AccountCompressionIDL, AccountProofResult, type BN254, BOB, BalanceResult, CHARLIE, type CompressedAccount, type CompressedAccountData, CompressedAccountResult, type CompressedAccountWithMerkleContext, CompressedAccountsByOwnerResult, type CompressedProof, type CompressedProofWithContext, CompressedTokenAccountResult, CompressedTokenAccountsByOwnerOrDelegateResult, type CompressedTokenInstructionDataTransfer, type CompressedTransaction, CompressedTransactionResult, type CompressionApiInterface, CreateUtxoError, CreateUtxoErrorCode, DAVE, DEFAULT_MERKLE_TREE_HEIGHT, DEFAULT_MERKLE_TREE_ROOTS, DEFAULT_ZERO, FIELD_SIZE, type GetCompressedAccountConfig, type GetCompressedAccountsByOwnerConfig, type GetCompressedAccountsConfig, type GetCompressedAccountsFilter, type GetCompressedTokenAccountsByOwnerOrDelegateOptions, HIGHEST_ADDRESS_PLUS_ONE, HashError, HashErrorCode, HealthResult, type HexBatchInputsForProver, type HexInputsForProver, IndexedArray, IndexedElement, IndexedElementBundle, type InputTokenDataWithContext, type InstructionDataInvoke, type LatestNonVotingSignatures, type LatestNonVotingSignaturesPaginated, LatestNonVotingSignaturesResult, LatestNonVotingSignaturesResultPaginated, type LightCompressedToken, IDL as LightCompressedTokenIDL, type LightRegistry, IDL$2 as LightRegistryIDL, type LightSystemProgram$1 as LightSystem, IDL$1 as LightSystemIDL, LightSystemProgram, type LightWasm, LookupTableError, LookupTableErrorCode, MerkeProofResult, type MerkleContext, type MerkleContextWithMerkleProof, type MerkleContextWithNewAddressProof, MerkleTree, MerkleTreeError, MerkleTreeErrorCode, MultipleCompressedAccountsResult, MultipleMerkleProofsResult, NativeBalanceResult, type NewAddressParams, type NewAddressParamsPacked, NewAddressProofResult, type NonInclusionJsonStruct, type NonInclusionMerkleProofInputs, type OutputCompressedAccountWithPackedContext, type PackedCompressedAccountWithMerkleContext, type PackedMerkleContext, type ParsedTokenAccount, ProofError, ProofErrorCode, type PublicTransactionEvent, type QueueIndex, Rpc, RpcError, RpcErrorCode, STATE_MERKLE_TREE_NETWORK_FEE, STATE_MERKLE_TREE_ROLLOVER_FEE, SelectInUtxosError, SelectInUtxosErrorCode, SignatureListResult, SignatureListWithCursorResult, type SignatureWithMetadata, SlotResult, TRANSACTION_MERKLE_TREE_ROLLOVER_THRESHOLD, TestRpc, type TestRpcConfig, TokenBalanceListResult, TokenBalanceResult, type TokenData, TokenDataResult, type TokenTransferOutputData, UTXO_MERGE_MAXIMUM, UTXO_MERGE_THRESHOLD, UtilsError, UtilsErrorCode, UtxoError, UtxoErrorCode, ValidityProofResult, type WithContext, type WithCursor, accountCompressionProgram, addressQueue, addressTree, airdropSol, bn, bufToDecStr, buildAndSignTx, buildTx, byteArrayToKeypair, checkValidityProofShape, compress, confirmConfig, confirmTransaction, confirmTx, convertMerkleProofsWithContextToHex, convertNonInclusionMerkleProofInputsToHex, createAccount, createAccountWithLamports, createBN254, createCompressedAccount, createCompressedAccountWithMerkleContext, createMerkleContext, createRpc, createRpcResult, decompress, dedupeSigner, defaultStaticAccounts, defaultStaticAccountsStruct, defaultTestStateTreeAccounts, deriveAddress, encodeBN254toBase58, getAccountCompressionAuthority, getConnection, getIndexOrAdd, getParsedEvents, getRegisteredProgramPda, getTestKeypair, getTestRpc, hashToBn254FieldSizeBe, jsonRpcResult, jsonRpcResultAndContext, lightProgram, merkletreePubkey, negateAndCompressProof, newAccountWithLamports, noopProgram, nullifierQueuePubkey, packCompressedAccounts, packNewAddressParams, padOutputStateMerkleTrees, parseAccountData, parseEvents, parsePublicTransactionEventWithIdl, pipe, placeholderValidityProof, proofFromJsonStruct, proverRequest, pushUniqueItems, rpcRequest, selectMinCompressedSolAccountsForTransfer, sendAndConfirmTx, sleep, sumUpLamports, toAccountMetas, toArray, toCamelCase, toHex, toUnixTimestamp, transfer, useWallet, validateSameOwner, validateSufficientBalance };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lightprotocol/stateless.js",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "JavaScript API for Light and ZK Compression",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/node/index.cjs",
|
|
@@ -72,8 +72,8 @@
|
|
|
72
72
|
"tslib": "^2.6.2",
|
|
73
73
|
"typescript": "^5.5.3",
|
|
74
74
|
"vitest": "^1.6.0",
|
|
75
|
-
"@lightprotocol/
|
|
76
|
-
"@lightprotocol/
|
|
75
|
+
"@lightprotocol/programs": "0.3.0",
|
|
76
|
+
"@lightprotocol/hasher.rs": "0.2.0"
|
|
77
77
|
},
|
|
78
78
|
"nx": {
|
|
79
79
|
"targets": {
|