@lightprotocol/stateless.js 0.23.0-beta.3 → 0.23.0-beta.4

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.
Files changed (122) hide show
  1. package/dist/cjs/browser/actions/compress.d.ts +14 -2
  2. package/dist/cjs/browser/actions/create-account.d.ts +25 -3
  3. package/dist/cjs/browser/actions/decompress.d.ts +13 -2
  4. package/dist/cjs/browser/actions/transfer.d.ts +14 -2
  5. package/dist/cjs/browser/constants.d.ts +67 -35
  6. package/dist/cjs/browser/errors.d.ts +40 -49
  7. package/dist/cjs/browser/index.cjs +11151 -1
  8. package/dist/cjs/browser/index.cjs.map +1 -1
  9. package/dist/cjs/browser/index.d.ts +0 -1
  10. package/dist/cjs/browser/programs/system/idl.d.ts +44 -44
  11. package/dist/cjs/browser/programs/system/layout.d.ts +50 -26
  12. package/dist/cjs/browser/programs/system/pack.d.ts +36 -7
  13. package/dist/cjs/browser/programs/system/program.d.ts +56 -9
  14. package/dist/cjs/browser/programs/system/select-compressed-accounts.d.ts +4 -1
  15. package/dist/cjs/browser/rpc-interface.d.ts +2918 -2226
  16. package/dist/cjs/browser/rpc.d.ts +198 -39
  17. package/dist/cjs/browser/state/BN254.d.ts +4 -1
  18. package/dist/cjs/browser/state/bn.d.ts +5 -1
  19. package/dist/cjs/browser/state/compressed-account.d.ts +42 -14
  20. package/dist/cjs/browser/state/types.d.ts +5 -2
  21. package/dist/cjs/browser/test-helpers/merkle-tree/indexed-array.d.ts +18 -4
  22. package/dist/cjs/browser/test-helpers/merkle-tree/merkle-tree.d.ts +19 -6
  23. package/dist/cjs/browser/test-helpers/test-rpc/get-compressed-accounts.d.ts +12 -3
  24. package/dist/cjs/browser/test-helpers/test-rpc/get-compressed-token-accounts.d.ts +22 -5
  25. package/dist/cjs/browser/test-helpers/test-rpc/get-parsed-events.d.ts +14 -4
  26. package/dist/cjs/browser/test-helpers/test-rpc/test-rpc.d.ts +155 -35
  27. package/dist/cjs/browser/test-helpers/test-utils.d.ts +5 -1
  28. package/dist/cjs/browser/utils/address.d.ts +26 -6
  29. package/dist/cjs/browser/utils/airdrop.d.ts +14 -2
  30. package/dist/cjs/browser/utils/calculate-compute-unit-price.d.ts +4 -1
  31. package/dist/cjs/browser/utils/conversion.d.ts +12 -4
  32. package/dist/cjs/browser/utils/dedupe-signer.d.ts +4 -1
  33. package/dist/cjs/browser/utils/get-state-tree-infos.d.ts +20 -5
  34. package/dist/cjs/browser/utils/instruction.d.ts +24 -7
  35. package/dist/cjs/browser/utils/pack-decompress.d.ts +9 -4
  36. package/dist/cjs/browser/utils/pipe.d.ts +4 -1
  37. package/dist/cjs/browser/utils/send-and-confirm.d.ts +42 -11
  38. package/dist/cjs/browser/utils/state-tree-lookup-table.d.ts +23 -3
  39. package/dist/cjs/browser/utils/validation.d.ts +24 -6
  40. package/dist/cjs/node/actions/compress.d.ts +14 -2
  41. package/dist/cjs/node/actions/create-account.d.ts +25 -3
  42. package/dist/cjs/node/actions/decompress.d.ts +13 -2
  43. package/dist/cjs/node/actions/transfer.d.ts +14 -2
  44. package/dist/cjs/node/constants.d.ts +67 -35
  45. package/dist/cjs/node/errors.d.ts +40 -49
  46. package/dist/cjs/node/index.cjs +9853 -1
  47. package/dist/cjs/node/index.cjs.map +1 -1
  48. package/dist/cjs/node/index.d.ts +0 -1
  49. package/dist/cjs/node/programs/system/idl.d.ts +44 -44
  50. package/dist/cjs/node/programs/system/layout.d.ts +50 -26
  51. package/dist/cjs/node/programs/system/pack.d.ts +36 -7
  52. package/dist/cjs/node/programs/system/program.d.ts +56 -9
  53. package/dist/cjs/node/programs/system/select-compressed-accounts.d.ts +4 -1
  54. package/dist/cjs/node/rpc-interface.d.ts +2918 -2226
  55. package/dist/cjs/node/rpc.d.ts +198 -39
  56. package/dist/cjs/node/state/BN254.d.ts +4 -1
  57. package/dist/cjs/node/state/bn.d.ts +5 -1
  58. package/dist/cjs/node/state/compressed-account.d.ts +42 -14
  59. package/dist/cjs/node/state/types.d.ts +5 -2
  60. package/dist/cjs/node/test-helpers/merkle-tree/indexed-array.d.ts +18 -4
  61. package/dist/cjs/node/test-helpers/merkle-tree/merkle-tree.d.ts +19 -6
  62. package/dist/cjs/node/test-helpers/test-rpc/get-compressed-accounts.d.ts +12 -3
  63. package/dist/cjs/node/test-helpers/test-rpc/get-compressed-token-accounts.d.ts +22 -5
  64. package/dist/cjs/node/test-helpers/test-rpc/get-parsed-events.d.ts +14 -4
  65. package/dist/cjs/node/test-helpers/test-rpc/test-rpc.d.ts +155 -35
  66. package/dist/cjs/node/test-helpers/test-utils.d.ts +5 -1
  67. package/dist/cjs/node/utils/address.d.ts +26 -6
  68. package/dist/cjs/node/utils/airdrop.d.ts +14 -2
  69. package/dist/cjs/node/utils/calculate-compute-unit-price.d.ts +4 -1
  70. package/dist/cjs/node/utils/conversion.d.ts +12 -4
  71. package/dist/cjs/node/utils/dedupe-signer.d.ts +4 -1
  72. package/dist/cjs/node/utils/get-state-tree-infos.d.ts +20 -5
  73. package/dist/cjs/node/utils/instruction.d.ts +24 -7
  74. package/dist/cjs/node/utils/pack-decompress.d.ts +9 -4
  75. package/dist/cjs/node/utils/pipe.d.ts +4 -1
  76. package/dist/cjs/node/utils/send-and-confirm.d.ts +42 -11
  77. package/dist/cjs/node/utils/state-tree-lookup-table.d.ts +23 -3
  78. package/dist/cjs/node/utils/validation.d.ts +24 -6
  79. package/dist/es/browser/actions/compress.d.ts +14 -2
  80. package/dist/es/browser/actions/create-account.d.ts +25 -3
  81. package/dist/es/browser/actions/decompress.d.ts +13 -2
  82. package/dist/es/browser/actions/transfer.d.ts +14 -2
  83. package/dist/es/browser/constants.d.ts +67 -35
  84. package/dist/es/browser/errors.d.ts +40 -49
  85. package/dist/es/browser/index.d.ts +0 -1
  86. package/dist/es/browser/index.js +11159 -1
  87. package/dist/es/browser/index.js.map +1 -1
  88. package/dist/es/browser/programs/system/idl.d.ts +44 -44
  89. package/dist/es/browser/programs/system/layout.d.ts +50 -26
  90. package/dist/es/browser/programs/system/pack.d.ts +36 -7
  91. package/dist/es/browser/programs/system/program.d.ts +56 -9
  92. package/dist/es/browser/programs/system/select-compressed-accounts.d.ts +4 -1
  93. package/dist/es/browser/rpc-interface.d.ts +2918 -2226
  94. package/dist/es/browser/rpc.d.ts +198 -39
  95. package/dist/es/browser/state/BN254.d.ts +4 -1
  96. package/dist/es/browser/state/bn.d.ts +5 -1
  97. package/dist/es/browser/state/compressed-account.d.ts +42 -14
  98. package/dist/es/browser/state/types.d.ts +5 -2
  99. package/dist/es/browser/test-helpers/merkle-tree/indexed-array.d.ts +18 -4
  100. package/dist/es/browser/test-helpers/merkle-tree/merkle-tree.d.ts +19 -6
  101. package/dist/es/browser/test-helpers/test-rpc/get-compressed-accounts.d.ts +12 -3
  102. package/dist/es/browser/test-helpers/test-rpc/get-compressed-token-accounts.d.ts +22 -5
  103. package/dist/es/browser/test-helpers/test-rpc/get-parsed-events.d.ts +14 -4
  104. package/dist/es/browser/test-helpers/test-rpc/test-rpc.d.ts +155 -35
  105. package/dist/es/browser/test-helpers/test-utils.d.ts +5 -1
  106. package/dist/es/browser/utils/address.d.ts +26 -6
  107. package/dist/es/browser/utils/airdrop.d.ts +14 -2
  108. package/dist/es/browser/utils/calculate-compute-unit-price.d.ts +4 -1
  109. package/dist/es/browser/utils/conversion.d.ts +12 -4
  110. package/dist/es/browser/utils/dedupe-signer.d.ts +4 -1
  111. package/dist/es/browser/utils/get-state-tree-infos.d.ts +20 -5
  112. package/dist/es/browser/utils/instruction.d.ts +24 -7
  113. package/dist/es/browser/utils/pack-decompress.d.ts +9 -4
  114. package/dist/es/browser/utils/pipe.d.ts +4 -1
  115. package/dist/es/browser/utils/send-and-confirm.d.ts +42 -11
  116. package/dist/es/browser/utils/state-tree-lookup-table.d.ts +23 -3
  117. package/dist/es/browser/utils/validation.d.ts +24 -6
  118. package/dist/types/index.d.ts +4134 -2547
  119. package/package.json +1 -1
  120. package/dist/cjs/browser/devnet-compat.d.ts +0 -15
  121. package/dist/cjs/node/devnet-compat.d.ts +0 -15
  122. package/dist/es/browser/devnet-compat.d.ts +0 -15
@@ -25,7 +25,12 @@ export interface PackedDecompressResult {
25
25
  * @param addresses - Array of account addresses
26
26
  * @returns Packed instruction parameters
27
27
  */
28
- export declare function packDecompressAccountsIdempotent(programId: PublicKey, proof: {
29
- compressedProof: ValidityProof | null;
30
- treeInfos: TreeInfo[];
31
- }, accountsData: AccountDataWithTreeInfo[], addresses: PublicKey[]): Promise<PackedDecompressResult>;
28
+ export declare function packDecompressAccountsIdempotent(
29
+ programId: PublicKey,
30
+ proof: {
31
+ compressedProof: ValidityProof | null;
32
+ treeInfos: TreeInfo[];
33
+ },
34
+ accountsData: AccountDataWithTreeInfo[],
35
+ addresses: PublicKey[],
36
+ ): Promise<PackedDecompressResult>;
@@ -1,2 +1,5 @@
1
1
  /** pipe function */
2
- export declare function pipe<T, R>(initialFunction: (arg: T) => R, ...functions: ((arg: R) => R)[]): (initialValue: T) => R;
2
+ export declare function pipe<T, R>(
3
+ initialFunction: (arg: T) => R,
4
+ ...functions: ((arg: R) => R)[]
5
+ ): (initialValue: T) => R;
@@ -1,4 +1,14 @@
1
- import { VersionedTransaction, SignatureResult, RpcResponseAndContext, Signer, TransactionInstruction, ConfirmOptions, TransactionSignature, PublicKey, AddressLookupTableAccount } from '@solana/web3.js';
1
+ import {
2
+ VersionedTransaction,
3
+ SignatureResult,
4
+ RpcResponseAndContext,
5
+ Signer,
6
+ TransactionInstruction,
7
+ ConfirmOptions,
8
+ TransactionSignature,
9
+ PublicKey,
10
+ AddressLookupTableAccount,
11
+ } from '@solana/web3.js';
2
12
  import { Rpc } from '../rpc';
3
13
  /**
4
14
  * Builds a versioned Transaction from instructions.
@@ -10,7 +20,12 @@ import { Rpc } from '../rpc';
10
20
  *
11
21
  * @return VersionedTransaction
12
22
  */
13
- export declare function buildTx(instructions: TransactionInstruction[], payerPublicKey: PublicKey, blockhash: string, lookupTableAccounts?: AddressLookupTableAccount[]): VersionedTransaction;
23
+ export declare function buildTx(
24
+ instructions: TransactionInstruction[],
25
+ payerPublicKey: PublicKey,
26
+ blockhash: string,
27
+ lookupTableAccounts?: AddressLookupTableAccount[],
28
+ ): VersionedTransaction;
14
29
  /**
15
30
  * Sends a versioned transaction and confirms it.
16
31
  *
@@ -21,10 +36,15 @@ export declare function buildTx(instructions: TransactionInstruction[], payerPub
21
36
  *
22
37
  * @return TransactionSignature
23
38
  */
24
- export declare function sendAndConfirmTx(rpc: Rpc, tx: VersionedTransaction, confirmOptions?: ConfirmOptions, blockHashCtx?: {
25
- blockhash: string;
26
- lastValidBlockHeight: number;
27
- }): Promise<TransactionSignature>;
39
+ export declare function sendAndConfirmTx(
40
+ rpc: Rpc,
41
+ tx: VersionedTransaction,
42
+ confirmOptions?: ConfirmOptions,
43
+ blockHashCtx?: {
44
+ blockhash: string;
45
+ lastValidBlockHeight: number;
46
+ },
47
+ ): Promise<TransactionSignature>;
28
48
  /**
29
49
  * Confirms a transaction with a given txId.
30
50
  *
@@ -34,10 +54,15 @@ export declare function sendAndConfirmTx(rpc: Rpc, tx: VersionedTransaction, con
34
54
  * @param blockHashCtx blockhash context for confirmation
35
55
  * @return SignatureResult
36
56
  */
37
- export declare function confirmTx(rpc: Rpc, txId: string, confirmOptions?: ConfirmOptions, _blockHashCtx?: {
38
- blockhash: string;
39
- lastValidBlockHeight: number;
40
- }): Promise<RpcResponseAndContext<SignatureResult>>;
57
+ export declare function confirmTx(
58
+ rpc: Rpc,
59
+ txId: string,
60
+ confirmOptions?: ConfirmOptions,
61
+ _blockHashCtx?: {
62
+ blockhash: string;
63
+ lastValidBlockHeight: number;
64
+ },
65
+ ): Promise<RpcResponseAndContext<SignatureResult>>;
41
66
  /**
42
67
  * Builds a versioned Transaction from instructions and signs it.
43
68
  *
@@ -49,4 +74,10 @@ export declare function confirmTx(rpc: Rpc, txId: string, confirmOptions?: Confi
49
74
  * @param lookupTableAccounts lookup table accounts to include in the
50
75
  * transaction
51
76
  */
52
- export declare function buildAndSignTx(instructions: TransactionInstruction[], payer: Signer, blockhash: string, additionalSigners?: Signer[], lookupTableAccounts?: AddressLookupTableAccount[]): VersionedTransaction;
77
+ export declare function buildAndSignTx(
78
+ instructions: TransactionInstruction[],
79
+ payer: Signer,
80
+ blockhash: string,
81
+ additionalSigners?: Signer[],
82
+ lookupTableAccounts?: AddressLookupTableAccount[],
83
+ ): VersionedTransaction;
@@ -9,7 +9,12 @@ import { PublicKey, Keypair, Connection } from '@solana/web3.js';
9
9
  * @param authority Keypair of the authority
10
10
  * @param recentSlot Slot of the recent block
11
11
  */
12
- export declare function createStateTreeLookupTable({ connection, payer, authority, recentSlot, }: {
12
+ export declare function createStateTreeLookupTable({
13
+ connection,
14
+ payer,
15
+ authority,
16
+ recentSlot,
17
+ }: {
13
18
  connection: Connection;
14
19
  payer: Keypair;
15
20
  authority: Keypair;
@@ -30,7 +35,15 @@ export declare function createStateTreeLookupTable({ connection, payer, authorit
30
35
  * @param payer Keypair of the payer
31
36
  * @param authority Keypair of the authority
32
37
  */
33
- export declare function extendStateTreeLookupTable({ connection, tableAddress, newStateTreeAddresses, newQueueAddresses, newCpiContextAddresses, payer, authority, }: {
38
+ export declare function extendStateTreeLookupTable({
39
+ connection,
40
+ tableAddress,
41
+ newStateTreeAddresses,
42
+ newQueueAddresses,
43
+ newCpiContextAddresses,
44
+ payer,
45
+ authority,
46
+ }: {
34
47
  connection: Connection;
35
48
  tableAddress: PublicKey;
36
49
  newStateTreeAddresses: PublicKey[];
@@ -56,7 +69,14 @@ export declare function extendStateTreeLookupTable({ connection, tableAddress, n
56
69
  * @param payer Keypair of the payer
57
70
  * @param authority Keypair of the authority
58
71
  */
59
- export declare function nullifyLookupTable({ connection, fullStateTreeAddress, nullifyLookupTableAddress, stateTreeLookupTableAddress, payer, authority, }: {
72
+ export declare function nullifyLookupTable({
73
+ connection,
74
+ fullStateTreeAddress,
75
+ nullifyLookupTableAddress,
76
+ stateTreeLookupTableAddress,
77
+ payer,
78
+ authority,
79
+ }: {
60
80
  connection: Connection;
61
81
  fullStateTreeAddress: PublicKey;
62
82
  nullifyLookupTableAddress: PublicKey;
@@ -1,8 +1,26 @@
1
1
  import BN from 'bn.js';
2
- import { CompressedAccountLegacy, CompressedAccountWithMerkleContext } from '../state';
2
+ import {
3
+ CompressedAccountLegacy,
4
+ CompressedAccountWithMerkleContext,
5
+ } from '../state';
3
6
  export declare const validateSufficientBalance: (balance: BN) => void;
4
- export declare const validateSameOwner: (compressedAccounts: CompressedAccountLegacy[] | CompressedAccountWithMerkleContext[]) => void;
5
- export declare const validateNumbersForProof: (hashesLength: number, newAddressesLength: number) => void;
6
- export declare const validateNumbersForInclusionProof: (hashesLength: number) => void;
7
- export declare const validateNumbersForNonInclusionProof: (newAddressesLength: number) => void;
8
- export declare const validateNumbers: (length: number, allowedNumbers: number[], type: string) => void;
7
+ export declare const validateSameOwner: (
8
+ compressedAccounts:
9
+ | CompressedAccountLegacy[]
10
+ | CompressedAccountWithMerkleContext[],
11
+ ) => void;
12
+ export declare const validateNumbersForProof: (
13
+ hashesLength: number,
14
+ newAddressesLength: number,
15
+ ) => void;
16
+ export declare const validateNumbersForInclusionProof: (
17
+ hashesLength: number,
18
+ ) => void;
19
+ export declare const validateNumbersForNonInclusionProof: (
20
+ newAddressesLength: number,
21
+ ) => void;
22
+ export declare const validateNumbers: (
23
+ length: number,
24
+ allowedNumbers: number[],
25
+ type: string,
26
+ ) => void;