@lightprotocol/stateless.js 0.17.2-alpha.1 → 0.18.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.
Files changed (60) hide show
  1. package/dist/cjs/browser/constants.d.ts +2 -0
  2. package/dist/cjs/browser/idl.d.ts +1015 -0
  3. package/dist/cjs/browser/index.cjs +1 -1
  4. package/dist/cjs/browser/index.cjs.map +1 -1
  5. package/dist/cjs/browser/index.d.ts +1 -0
  6. package/dist/cjs/browser/rpc-interface.d.ts +107 -114
  7. package/dist/cjs/browser/state/types.d.ts +5 -0
  8. package/dist/cjs/browser/utils/test-utils.d.ts +8 -0
  9. package/dist/cjs/node/constants.d.ts +2 -0
  10. package/dist/cjs/node/idl.d.ts +1015 -0
  11. package/dist/cjs/node/index.cjs +1 -1
  12. package/dist/cjs/node/index.cjs.map +1 -1
  13. package/dist/cjs/node/index.d.ts +1 -0
  14. package/dist/cjs/node/rpc-interface.d.ts +107 -114
  15. package/dist/cjs/node/state/types.d.ts +5 -0
  16. package/dist/cjs/node/utils/test-utils.d.ts +8 -0
  17. package/dist/types/index.d.ts +1032 -9
  18. package/package.json +6 -5
  19. package/dist/es/browser/actions/common.d.ts +0 -3
  20. package/dist/es/browser/actions/compress.d.ts +0 -16
  21. package/dist/es/browser/actions/create-account.d.ts +0 -41
  22. package/dist/es/browser/actions/decompress.d.ts +0 -16
  23. package/dist/es/browser/actions/index.d.ts +0 -5
  24. package/dist/es/browser/actions/transfer.d.ts +0 -20
  25. package/dist/es/browser/constants.d.ts +0 -63
  26. package/dist/es/browser/errors.d.ts +0 -74
  27. package/dist/es/browser/index.d.ts +0 -10
  28. package/dist/es/browser/index.js +0 -2
  29. package/dist/es/browser/index.js.map +0 -1
  30. package/dist/es/browser/instruction/index.d.ts +0 -1
  31. package/dist/es/browser/instruction/pack-compressed-accounts.d.ts +0 -35
  32. package/dist/es/browser/programs/index.d.ts +0 -2
  33. package/dist/es/browser/programs/layout.d.ts +0 -25
  34. package/dist/es/browser/programs/system.d.ts +0 -199
  35. package/dist/es/browser/rpc-interface.d.ts +0 -1179
  36. package/dist/es/browser/rpc.d.ts +0 -275
  37. package/dist/es/browser/state/BN254.d.ts +0 -14
  38. package/dist/es/browser/state/compressed-account.d.ts +0 -31
  39. package/dist/es/browser/state/index.d.ts +0 -3
  40. package/dist/es/browser/state/types.d.ts +0 -91
  41. package/dist/es/browser/test-helpers/index.d.ts +0 -2
  42. package/dist/es/browser/test-helpers/merkle-tree/index.d.ts +0 -2
  43. package/dist/es/browser/test-helpers/merkle-tree/indexed-array.d.ts +0 -85
  44. package/dist/es/browser/test-helpers/merkle-tree/merkle-tree.d.ts +0 -92
  45. package/dist/es/browser/test-helpers/test-rpc/get-compressed-accounts.d.ts +0 -7
  46. package/dist/es/browser/test-helpers/test-rpc/get-compressed-token-accounts.d.ts +0 -40
  47. package/dist/es/browser/test-helpers/test-rpc/get-parsed-events.d.ts +0 -13
  48. package/dist/es/browser/test-helpers/test-rpc/index.d.ts +0 -3
  49. package/dist/es/browser/test-helpers/test-rpc/test-rpc.d.ts +0 -249
  50. package/dist/es/browser/utils/address.d.ts +0 -63
  51. package/dist/es/browser/utils/airdrop.d.ts +0 -7
  52. package/dist/es/browser/utils/calculate-compute-unit-price.d.ts +0 -7
  53. package/dist/es/browser/utils/conversion.d.ts +0 -31
  54. package/dist/es/browser/utils/index.d.ts +0 -10
  55. package/dist/es/browser/utils/parse-validity-proof.d.ts +0 -20
  56. package/dist/es/browser/utils/pipe.d.ts +0 -2
  57. package/dist/es/browser/utils/send-and-confirm.d.ts +0 -52
  58. package/dist/es/browser/utils/sleep.d.ts +0 -1
  59. package/dist/es/browser/utils/test-utils.d.ts +0 -23
  60. package/dist/es/browser/utils/validation.d.ts +0 -4
@@ -197,6 +197,14 @@ declare const ALICE: Keypair;
197
197
  declare const BOB: Keypair;
198
198
  declare const CHARLIE: Keypair;
199
199
  declare const DAVE: Keypair;
200
+ /**
201
+ * Deep comparison of two objects. Handles BN comparison correctly.
202
+ *
203
+ * @param ref - The reference object to compare.
204
+ * @param val - The value object to compare.
205
+ * @returns True if the objects are deeply equal, false otherwise.
206
+ */
207
+ declare function deepEqual(ref: any, val: any): boolean;
200
208
  /**
201
209
  * Create a new account and airdrop lamports to it
202
210
  *
@@ -272,11 +280,16 @@ interface CompressedAccountData {
272
280
  data: Buffer$1;
273
281
  dataHash: number[];
274
282
  }
283
+ interface MerkleTreeSequenceNumber {
284
+ pubkey: PublicKey;
285
+ seq: BN;
286
+ }
275
287
  interface PublicTransactionEvent {
276
288
  inputCompressedAccountHashes: number[][];
277
289
  outputCompressedAccountHashes: number[][];
278
290
  outputCompressedAccounts: OutputCompressedAccountWithPackedContext[];
279
291
  outputLeafIndices: number[];
292
+ sequenceNumbers: MerkleTreeSequenceNumber[];
280
293
  relayFee: BN | null;
281
294
  isCompress: boolean;
282
295
  compressOrDecompressLamports: BN | null;
@@ -342,13 +355,6 @@ declare const createCompressedAccount: (owner: PublicKey, lamports?: BN, data?:
342
355
  declare const createCompressedAccountWithMerkleContext: (merkleContext: MerkleContext, owner: PublicKey, lamports?: BN, data?: CompressedAccountData, address?: number[]) => CompressedAccountWithMerkleContext;
343
356
  declare const createMerkleContext: (merkleTree: PublicKey, nullifierQueue: PublicKey, hash: number[], leafIndex: number) => MerkleContext;
344
357
 
345
- declare class BaseRpc {
346
- private getCancellationPromise;
347
- private getTransactionConfirmationPromise;
348
- private confirmTransactionUsingBlockHeightExceedanceStrategy;
349
- private confirmTransactionUsingDurableNonceStrategy;
350
- private confirmTransactionUsingLegacyTimeoutStrategy;
351
- }
352
358
  interface LatestNonVotingSignatures {
353
359
  context: {
354
360
  slot: number;
@@ -2516,7 +2522,7 @@ type DecompressParams = {
2516
2522
  */
2517
2523
  outputStateTree?: PublicKey;
2518
2524
  };
2519
- declare class LightSystemProgram {
2525
+ declare class LightSystemProgram$1 {
2520
2526
  /**
2521
2527
  * @internal
2522
2528
  */
@@ -2593,6 +2599,7 @@ declare function decodePublicTransactionEvent(buffer: Buffer$1): PublicTransacti
2593
2599
 
2594
2600
  declare const FIELD_SIZE: BN;
2595
2601
  declare const HIGHEST_ADDRESS_PLUS_ONE: BN;
2602
+ declare const INVOKE_DISCRIMINATOR: Buffer$1;
2596
2603
  declare const noopProgram = "noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV";
2597
2604
  declare const lightProgram = "SySTEM1eSU2p4BGQfQpimFEWWSC1XDFeun3Nqzz3rT7";
2598
2605
  declare const accountCompressionProgram = "compr6CUsB5m2jS4Y3831ztGSTnDpnKJTKS95d64XVq";
@@ -2727,4 +2734,1020 @@ declare class MerkleTreeError extends MetaError {
2727
2734
  declare class UtilsError extends MetaError {
2728
2735
  }
2729
2736
 
2730
- export { ADDRESS_QUEUE_ROLLOVER_FEE, ADDRESS_TREE_NETWORK_FEE, ALICE, AccountProofResult, type AddressWithTree, type BN254, BOB, BalanceResult, BaseRpc, CHARLIE, type ClientSubscriptionId, type CompressedAccount, type CompressedAccountData, CompressedAccountLayout, CompressedAccountResult, type CompressedAccountWithMerkleContext, CompressedAccountsByOwnerResult, type CompressedMintTokenHolders, CompressedMintTokenHoldersResult, type CompressedProof, type CompressedProofWithContext, CompressedTokenAccountResult, CompressedTokenAccountsByOwnerOrDelegateResult, type CompressedTransaction, CompressedTransactionResult, 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, HealthResult, type HexBatchInputsForProver, type HexInputsForProver, IndexedArray, IndexedElement, IndexedElementBundle, type InputTokenDataWithContext, type InstructionDataInvoke, InstructionDataInvokeLayout, type LatestNonVotingSignatures, type LatestNonVotingSignaturesPaginated, LatestNonVotingSignaturesResult, LatestNonVotingSignaturesResultPaginated, LightSystemProgram, type LightWasm, LookupTableError, LookupTableErrorCode, MerkeProofResult, type MerkleContext, MerkleContextLayout, type MerkleContextWithMerkleProof, type MerkleContextWithNewAddressProof, MerkleTree, MerkleTreeError, MerkleTreeErrorCode, MultipleCompressedAccountsResult, MultipleMerkleProofsResult, NativeBalanceResult, type NewAddressParams, NewAddressParamsLayout, type NewAddressParamsPacked, NewAddressProofResult, type NonInclusionJsonStruct, type NonInclusionMerkleProofInputs, type OutputCompressedAccountWithPackedContext, type PackedCompressedAccountWithMerkleContext, type PackedMerkleContext, type PaginatedOptions, type ParsedTokenAccount, ProofError, ProofErrorCode, type PublicTransactionEvent, PublicTransactionEventLayout, type QueueIndex, 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, TRANSACTION_MERKLE_TREE_ROLLOVER_THRESHOLD, TestRpc, type TestRpcConfig, type TokenBalance, TokenBalanceListResult, TokenBalanceListResultV2, TokenBalanceResult, type TokenData$1 as TokenData, TokenDataLayout, TokenDataResult, UTXO_MERGE_MAXIMUM, UTXO_MERGE_THRESHOLD, UtilsError, UtilsErrorCode, UtxoError, UtxoErrorCode, ValidityProofResult, type WithContext, type WithCursor, type WithRpcContext, accountCompressionProgram, addressQueue, addressTree, airdropSol, bn, bufToDecStr, buildAndSignTx, buildTx, byteArrayToKeypair, calculateComputeUnitPrice, checkValidityProofShape, compress, confirmConfig, confirmTransaction, confirmTx, convertMerkleProofsWithContextToHex, convertNonInclusionMerkleProofInputsToHex, createAccount, createAccountWithLamports, createBN254, createCompressedAccount, createCompressedAccountWithMerkleContext, createMerkleContext, createRpc, createRpcResult, decodeInstructionDataInvoke, decodePublicTransactionEvent, decompress, dedupeSigner, defaultStaticAccounts, defaultStaticAccountsStruct, defaultTestStateTreeAccounts, deriveAddress, deriveAddressSeed, encodeBN254toBase58, encodeInstructionDataInvoke, encodePublicTransactionEvent, getAccountCompressionAuthority, getCompressedTokenAccountByHashTest, getCompressedTokenAccounts, getCompressedTokenAccountsByDelegateTest, getCompressedTokenAccountsByOwnerTest, getConnection, getIndexOrAdd, getParsedEvents, getPublicInputHash, getRegisteredProgramPda, getTestKeypair, getTestRpc, hashToBn254FieldSizeBe, hashvToBn254FieldSizeBe, invokeAccountsLayout, type invokeAccountsLayoutParams, jsonRpcResult, jsonRpcResultAndContext, lightProgram, merkletreePubkey, negateAndCompressProof, newAccountWithLamports, noopProgram, nullifierQueuePubkey, packCompressedAccounts, packNewAddressParams, padOutputStateMerkleTrees, parseAccountData, parseEvents, parsePublicTransactionEventWithIdl, parseTokenLayoutWithIdl, pipe, placeholderValidityProof, proofFromJsonStruct, proverRequest, pushUniqueItems, rpcRequest, selectMinCompressedSolAccountsForTransfer, sendAndConfirmTx, sleep, sumUpLamports, toAccountMetas, toArray, toCamelCase, toHex, toUnixTimestamp, transfer, validateSameOwner, validateSufficientBalance };
2737
+ type LightSystemProgram = {
2738
+ version: '1.2.0';
2739
+ name: 'light_system_program';
2740
+ constants: [
2741
+ {
2742
+ name: 'SOL_POOL_PDA_SEED';
2743
+ type: 'bytes';
2744
+ value: '[115, 111, 108, 95, 112, 111, 111, 108, 95, 112, 100, 97]';
2745
+ }
2746
+ ];
2747
+ instructions: [
2748
+ {
2749
+ name: 'initCpiContextAccount';
2750
+ accounts: [
2751
+ {
2752
+ name: 'feePayer';
2753
+ isMut: true;
2754
+ isSigner: true;
2755
+ },
2756
+ {
2757
+ name: 'cpiContextAccount';
2758
+ isMut: true;
2759
+ isSigner: false;
2760
+ },
2761
+ {
2762
+ name: 'associatedMerkleTree';
2763
+ isMut: false;
2764
+ isSigner: false;
2765
+ }
2766
+ ];
2767
+ args: [];
2768
+ },
2769
+ {
2770
+ name: 'invoke';
2771
+ accounts: [
2772
+ {
2773
+ name: 'feePayer';
2774
+ isMut: true;
2775
+ isSigner: true;
2776
+ docs: [
2777
+ 'Fee payer needs to be mutable to pay rollover and protocol fees.'
2778
+ ];
2779
+ },
2780
+ {
2781
+ name: 'authority';
2782
+ isMut: false;
2783
+ isSigner: true;
2784
+ },
2785
+ {
2786
+ name: 'registeredProgramPda';
2787
+ isMut: false;
2788
+ isSigner: false;
2789
+ },
2790
+ {
2791
+ name: 'noopProgram';
2792
+ isMut: false;
2793
+ isSigner: false;
2794
+ },
2795
+ {
2796
+ name: 'accountCompressionAuthority';
2797
+ isMut: false;
2798
+ isSigner: false;
2799
+ docs: [
2800
+ 'This pda is used to invoke the account compression program.'
2801
+ ];
2802
+ },
2803
+ {
2804
+ name: 'accountCompressionProgram';
2805
+ isMut: false;
2806
+ isSigner: false;
2807
+ docs: ['Merkle trees.'];
2808
+ },
2809
+ {
2810
+ name: 'solPoolPda';
2811
+ isMut: true;
2812
+ isSigner: false;
2813
+ isOptional: true;
2814
+ docs: [
2815
+ 'Sol pool pda is used to store the native sol that has been compressed.',
2816
+ "It's only required when compressing or decompressing sol."
2817
+ ];
2818
+ },
2819
+ {
2820
+ name: 'decompressionRecipient';
2821
+ isMut: true;
2822
+ isSigner: false;
2823
+ isOptional: true;
2824
+ docs: [
2825
+ 'Only needs to be provided for decompression as a recipient for the',
2826
+ 'decompressed sol.',
2827
+ 'Compressed sol originate from authority.'
2828
+ ];
2829
+ },
2830
+ {
2831
+ name: 'systemProgram';
2832
+ isMut: false;
2833
+ isSigner: false;
2834
+ }
2835
+ ];
2836
+ args: [
2837
+ {
2838
+ name: 'inputs';
2839
+ type: 'bytes';
2840
+ }
2841
+ ];
2842
+ },
2843
+ {
2844
+ name: 'invokeCpi';
2845
+ accounts: [
2846
+ {
2847
+ name: 'feePayer';
2848
+ isMut: true;
2849
+ isSigner: true;
2850
+ docs: [
2851
+ 'Fee payer needs to be mutable to pay rollover and protocol fees.'
2852
+ ];
2853
+ },
2854
+ {
2855
+ name: 'authority';
2856
+ isMut: false;
2857
+ isSigner: true;
2858
+ },
2859
+ {
2860
+ name: 'registeredProgramPda';
2861
+ isMut: false;
2862
+ isSigner: false;
2863
+ },
2864
+ {
2865
+ name: 'noopProgram';
2866
+ isMut: false;
2867
+ isSigner: false;
2868
+ },
2869
+ {
2870
+ name: 'accountCompressionAuthority';
2871
+ isMut: false;
2872
+ isSigner: false;
2873
+ },
2874
+ {
2875
+ name: 'accountCompressionProgram';
2876
+ isMut: false;
2877
+ isSigner: false;
2878
+ },
2879
+ {
2880
+ name: 'invokingProgram';
2881
+ isMut: false;
2882
+ isSigner: false;
2883
+ },
2884
+ {
2885
+ name: 'solPoolPda';
2886
+ isMut: true;
2887
+ isSigner: false;
2888
+ isOptional: true;
2889
+ },
2890
+ {
2891
+ name: 'decompressionRecipient';
2892
+ isMut: true;
2893
+ isSigner: false;
2894
+ isOptional: true;
2895
+ },
2896
+ {
2897
+ name: 'systemProgram';
2898
+ isMut: false;
2899
+ isSigner: false;
2900
+ },
2901
+ {
2902
+ name: 'cpiContextAccount';
2903
+ isMut: true;
2904
+ isSigner: false;
2905
+ isOptional: true;
2906
+ }
2907
+ ];
2908
+ args: [
2909
+ {
2910
+ name: 'inputs';
2911
+ type: 'bytes';
2912
+ }
2913
+ ];
2914
+ },
2915
+ {
2916
+ name: 'invokeCpiWithReadOnly';
2917
+ accounts: [
2918
+ {
2919
+ name: 'feePayer';
2920
+ isMut: true;
2921
+ isSigner: true;
2922
+ docs: [
2923
+ 'Fee payer needs to be mutable to pay rollover and protocol fees.'
2924
+ ];
2925
+ },
2926
+ {
2927
+ name: 'authority';
2928
+ isMut: false;
2929
+ isSigner: true;
2930
+ },
2931
+ {
2932
+ name: 'registeredProgramPda';
2933
+ isMut: false;
2934
+ isSigner: false;
2935
+ },
2936
+ {
2937
+ name: 'noopProgram';
2938
+ isMut: false;
2939
+ isSigner: false;
2940
+ },
2941
+ {
2942
+ name: 'accountCompressionAuthority';
2943
+ isMut: false;
2944
+ isSigner: false;
2945
+ },
2946
+ {
2947
+ name: 'accountCompressionProgram';
2948
+ isMut: false;
2949
+ isSigner: false;
2950
+ },
2951
+ {
2952
+ name: 'invokingProgram';
2953
+ isMut: false;
2954
+ isSigner: false;
2955
+ },
2956
+ {
2957
+ name: 'solPoolPda';
2958
+ isMut: true;
2959
+ isSigner: false;
2960
+ isOptional: true;
2961
+ },
2962
+ {
2963
+ name: 'decompressionRecipient';
2964
+ isMut: true;
2965
+ isSigner: false;
2966
+ isOptional: true;
2967
+ },
2968
+ {
2969
+ name: 'systemProgram';
2970
+ isMut: false;
2971
+ isSigner: false;
2972
+ },
2973
+ {
2974
+ name: 'cpiContextAccount';
2975
+ isMut: true;
2976
+ isSigner: false;
2977
+ isOptional: true;
2978
+ }
2979
+ ];
2980
+ args: [
2981
+ {
2982
+ name: 'inputs';
2983
+ type: 'bytes';
2984
+ }
2985
+ ];
2986
+ },
2987
+ {
2988
+ name: 'stubIdlBuild';
2989
+ docs: [
2990
+ 'This function is a stub to allow Anchor to include the input types in',
2991
+ 'the IDL. It should not be included in production builds nor be called in',
2992
+ 'practice.'
2993
+ ];
2994
+ accounts: [
2995
+ {
2996
+ name: 'feePayer';
2997
+ isMut: true;
2998
+ isSigner: true;
2999
+ docs: [
3000
+ 'Fee payer needs to be mutable to pay rollover and protocol fees.'
3001
+ ];
3002
+ },
3003
+ {
3004
+ name: 'authority';
3005
+ isMut: false;
3006
+ isSigner: true;
3007
+ },
3008
+ {
3009
+ name: 'registeredProgramPda';
3010
+ isMut: false;
3011
+ isSigner: false;
3012
+ },
3013
+ {
3014
+ name: 'noopProgram';
3015
+ isMut: false;
3016
+ isSigner: false;
3017
+ },
3018
+ {
3019
+ name: 'accountCompressionAuthority';
3020
+ isMut: false;
3021
+ isSigner: false;
3022
+ docs: [
3023
+ 'This pda is used to invoke the account compression program.'
3024
+ ];
3025
+ },
3026
+ {
3027
+ name: 'accountCompressionProgram';
3028
+ isMut: false;
3029
+ isSigner: false;
3030
+ docs: ['Merkle trees.'];
3031
+ },
3032
+ {
3033
+ name: 'solPoolPda';
3034
+ isMut: true;
3035
+ isSigner: false;
3036
+ isOptional: true;
3037
+ docs: [
3038
+ 'Sol pool pda is used to store the native sol that has been compressed.',
3039
+ "It's only required when compressing or decompressing sol."
3040
+ ];
3041
+ },
3042
+ {
3043
+ name: 'decompressionRecipient';
3044
+ isMut: true;
3045
+ isSigner: false;
3046
+ isOptional: true;
3047
+ docs: [
3048
+ 'Only needs to be provided for decompression as a recipient for the',
3049
+ 'decompressed sol.',
3050
+ 'Compressed sol originate from authority.'
3051
+ ];
3052
+ },
3053
+ {
3054
+ name: 'systemProgram';
3055
+ isMut: false;
3056
+ isSigner: false;
3057
+ }
3058
+ ];
3059
+ args: [
3060
+ {
3061
+ name: 'inputs1';
3062
+ type: {
3063
+ defined: 'InstructionDataInvoke';
3064
+ };
3065
+ },
3066
+ {
3067
+ name: 'inputs2';
3068
+ type: {
3069
+ defined: 'InstructionDataInvokeCpi';
3070
+ };
3071
+ },
3072
+ {
3073
+ name: 'inputs3';
3074
+ type: {
3075
+ defined: 'PublicTransactionEvent';
3076
+ };
3077
+ }
3078
+ ];
3079
+ }
3080
+ ];
3081
+ accounts: [
3082
+ {
3083
+ name: 'cpiContextAccount';
3084
+ docs: [
3085
+ 'Collects instruction data without executing a compressed transaction.',
3086
+ 'Signer checks are performed on instruction data.',
3087
+ 'Collected instruction data is combined with the instruction data of the executing cpi,',
3088
+ 'and executed as a single transaction.',
3089
+ 'This enables to use input compressed accounts that are owned by multiple programs,',
3090
+ 'with one zero-knowledge proof.'
3091
+ ];
3092
+ type: {
3093
+ kind: 'struct';
3094
+ fields: [
3095
+ {
3096
+ name: 'feePayer';
3097
+ type: 'publicKey';
3098
+ },
3099
+ {
3100
+ name: 'associatedMerkleTree';
3101
+ type: 'publicKey';
3102
+ },
3103
+ {
3104
+ name: 'context';
3105
+ type: {
3106
+ vec: {
3107
+ defined: 'InstructionDataInvokeCpi';
3108
+ };
3109
+ };
3110
+ }
3111
+ ];
3112
+ };
3113
+ }
3114
+ ];
3115
+ types: [
3116
+ {
3117
+ name: 'InstructionDataInvoke';
3118
+ type: {
3119
+ kind: 'struct';
3120
+ fields: [
3121
+ {
3122
+ name: 'proof';
3123
+ type: {
3124
+ option: {
3125
+ defined: 'CompressedProof';
3126
+ };
3127
+ };
3128
+ },
3129
+ {
3130
+ name: 'inputCompressedAccountsWithMerkleContext';
3131
+ type: {
3132
+ vec: {
3133
+ defined: 'PackedCompressedAccountWithMerkleContext';
3134
+ };
3135
+ };
3136
+ },
3137
+ {
3138
+ name: 'outputCompressedAccounts';
3139
+ type: {
3140
+ vec: {
3141
+ defined: 'OutputCompressedAccountWithPackedContext';
3142
+ };
3143
+ };
3144
+ },
3145
+ {
3146
+ name: 'relayFee';
3147
+ type: {
3148
+ option: 'u64';
3149
+ };
3150
+ },
3151
+ {
3152
+ name: 'newAddressParams';
3153
+ type: {
3154
+ vec: {
3155
+ defined: 'NewAddressParamsPacked';
3156
+ };
3157
+ };
3158
+ },
3159
+ {
3160
+ name: 'compressOrDecompressLamports';
3161
+ type: {
3162
+ option: 'u64';
3163
+ };
3164
+ },
3165
+ {
3166
+ name: 'isCompress';
3167
+ type: 'bool';
3168
+ }
3169
+ ];
3170
+ };
3171
+ },
3172
+ {
3173
+ name: 'NewAddressParamsPacked';
3174
+ type: {
3175
+ kind: 'struct';
3176
+ fields: [
3177
+ {
3178
+ name: 'seed';
3179
+ type: {
3180
+ array: ['u8', 32];
3181
+ };
3182
+ },
3183
+ {
3184
+ name: 'addressQueueAccountIndex';
3185
+ type: 'u8';
3186
+ },
3187
+ {
3188
+ name: 'addressMerkleTreeAccountIndex';
3189
+ type: 'u8';
3190
+ },
3191
+ {
3192
+ name: 'addressMerkleTreeRootIndex';
3193
+ type: 'u16';
3194
+ }
3195
+ ];
3196
+ };
3197
+ },
3198
+ {
3199
+ name: 'OutputCompressedAccountWithPackedContext';
3200
+ type: {
3201
+ kind: 'struct';
3202
+ fields: [
3203
+ {
3204
+ name: 'compressedAccount';
3205
+ type: {
3206
+ defined: 'CompressedAccount';
3207
+ };
3208
+ },
3209
+ {
3210
+ name: 'merkleTreeIndex';
3211
+ type: 'u8';
3212
+ }
3213
+ ];
3214
+ };
3215
+ },
3216
+ {
3217
+ name: 'CompressedProof';
3218
+ type: {
3219
+ kind: 'struct';
3220
+ fields: [
3221
+ {
3222
+ name: 'a';
3223
+ type: {
3224
+ array: ['u8', 32];
3225
+ };
3226
+ },
3227
+ {
3228
+ name: 'b';
3229
+ type: {
3230
+ array: ['u8', 64];
3231
+ };
3232
+ },
3233
+ {
3234
+ name: 'c';
3235
+ type: {
3236
+ array: ['u8', 32];
3237
+ };
3238
+ }
3239
+ ];
3240
+ };
3241
+ },
3242
+ {
3243
+ name: 'InstructionDataInvokeCpi';
3244
+ type: {
3245
+ kind: 'struct';
3246
+ fields: [
3247
+ {
3248
+ name: 'proof';
3249
+ type: {
3250
+ option: {
3251
+ defined: 'CompressedProof';
3252
+ };
3253
+ };
3254
+ },
3255
+ {
3256
+ name: 'newAddressParams';
3257
+ type: {
3258
+ vec: {
3259
+ defined: 'NewAddressParamsPacked';
3260
+ };
3261
+ };
3262
+ },
3263
+ {
3264
+ name: 'inputCompressedAccountsWithMerkleContext';
3265
+ type: {
3266
+ vec: {
3267
+ defined: 'PackedCompressedAccountWithMerkleContext';
3268
+ };
3269
+ };
3270
+ },
3271
+ {
3272
+ name: 'outputCompressedAccounts';
3273
+ type: {
3274
+ vec: {
3275
+ defined: 'OutputCompressedAccountWithPackedContext';
3276
+ };
3277
+ };
3278
+ },
3279
+ {
3280
+ name: 'relayFee';
3281
+ type: {
3282
+ option: 'u64';
3283
+ };
3284
+ },
3285
+ {
3286
+ name: 'compressOrDecompressLamports';
3287
+ type: {
3288
+ option: 'u64';
3289
+ };
3290
+ },
3291
+ {
3292
+ name: 'isCompress';
3293
+ type: 'bool';
3294
+ },
3295
+ {
3296
+ name: 'cpiContext';
3297
+ type: {
3298
+ option: {
3299
+ defined: 'CompressedCpiContext';
3300
+ };
3301
+ };
3302
+ }
3303
+ ];
3304
+ };
3305
+ },
3306
+ {
3307
+ name: 'CompressedCpiContext';
3308
+ type: {
3309
+ kind: 'struct';
3310
+ fields: [
3311
+ {
3312
+ name: 'setContext';
3313
+ docs: [
3314
+ 'Is set by the program that is invoking the CPI to signal that is should',
3315
+ 'set the cpi context.'
3316
+ ];
3317
+ type: 'bool';
3318
+ },
3319
+ {
3320
+ name: 'firstSetContext';
3321
+ docs: [
3322
+ 'Is set to wipe the cpi context since someone could have set it before',
3323
+ 'with unrelated data.'
3324
+ ];
3325
+ type: 'bool';
3326
+ },
3327
+ {
3328
+ name: 'cpiContextAccountIndex';
3329
+ docs: [
3330
+ 'Index of cpi context account in remaining accounts.'
3331
+ ];
3332
+ type: 'u8';
3333
+ }
3334
+ ];
3335
+ };
3336
+ },
3337
+ {
3338
+ name: 'CompressedAccount';
3339
+ type: {
3340
+ kind: 'struct';
3341
+ fields: [
3342
+ {
3343
+ name: 'owner';
3344
+ type: 'publicKey';
3345
+ },
3346
+ {
3347
+ name: 'lamports';
3348
+ type: 'u64';
3349
+ },
3350
+ {
3351
+ name: 'address';
3352
+ type: {
3353
+ option: {
3354
+ array: ['u8', 32];
3355
+ };
3356
+ };
3357
+ },
3358
+ {
3359
+ name: 'data';
3360
+ type: {
3361
+ option: {
3362
+ defined: 'CompressedAccountData';
3363
+ };
3364
+ };
3365
+ }
3366
+ ];
3367
+ };
3368
+ },
3369
+ {
3370
+ name: 'CompressedAccountData';
3371
+ type: {
3372
+ kind: 'struct';
3373
+ fields: [
3374
+ {
3375
+ name: 'discriminator';
3376
+ type: {
3377
+ array: ['u8', 8];
3378
+ };
3379
+ },
3380
+ {
3381
+ name: 'data';
3382
+ type: 'bytes';
3383
+ },
3384
+ {
3385
+ name: 'dataHash';
3386
+ type: {
3387
+ array: ['u8', 32];
3388
+ };
3389
+ }
3390
+ ];
3391
+ };
3392
+ },
3393
+ {
3394
+ name: 'PackedCompressedAccountWithMerkleContext';
3395
+ type: {
3396
+ kind: 'struct';
3397
+ fields: [
3398
+ {
3399
+ name: 'compressedAccount';
3400
+ type: {
3401
+ defined: 'CompressedAccount';
3402
+ };
3403
+ },
3404
+ {
3405
+ name: 'merkleContext';
3406
+ type: {
3407
+ defined: 'PackedMerkleContext';
3408
+ };
3409
+ },
3410
+ {
3411
+ name: 'rootIndex';
3412
+ docs: [
3413
+ 'Index of root used in inclusion validity proof.'
3414
+ ];
3415
+ type: 'u16';
3416
+ },
3417
+ {
3418
+ name: 'readOnly';
3419
+ docs: [
3420
+ 'Placeholder to mark accounts read-only unimplemented set to false.'
3421
+ ];
3422
+ type: 'bool';
3423
+ }
3424
+ ];
3425
+ };
3426
+ },
3427
+ {
3428
+ name: 'PackedMerkleContext';
3429
+ type: {
3430
+ kind: 'struct';
3431
+ fields: [
3432
+ {
3433
+ name: 'merkleTreePubkeyIndex';
3434
+ type: 'u8';
3435
+ },
3436
+ {
3437
+ name: 'nullifierQueuePubkeyIndex';
3438
+ type: 'u8';
3439
+ },
3440
+ {
3441
+ name: 'leafIndex';
3442
+ type: 'u32';
3443
+ },
3444
+ {
3445
+ name: 'queueIndex';
3446
+ type: {
3447
+ option: {
3448
+ defined: 'QueueIndex';
3449
+ };
3450
+ };
3451
+ }
3452
+ ];
3453
+ };
3454
+ },
3455
+ {
3456
+ name: 'QueueIndex';
3457
+ type: {
3458
+ kind: 'struct';
3459
+ fields: [
3460
+ {
3461
+ name: 'queueId';
3462
+ docs: ['Id of queue in queue account.'];
3463
+ type: 'u8';
3464
+ },
3465
+ {
3466
+ name: 'index';
3467
+ docs: ['Index of compressed account hash in queue.'];
3468
+ type: 'u16';
3469
+ }
3470
+ ];
3471
+ };
3472
+ },
3473
+ {
3474
+ name: 'MerkleTreeSequenceNumber';
3475
+ type: {
3476
+ kind: 'struct';
3477
+ fields: [
3478
+ {
3479
+ name: 'pubkey';
3480
+ type: 'publicKey';
3481
+ },
3482
+ {
3483
+ name: 'seq';
3484
+ type: 'u64';
3485
+ }
3486
+ ];
3487
+ };
3488
+ },
3489
+ {
3490
+ name: 'PublicTransactionEvent';
3491
+ type: {
3492
+ kind: 'struct';
3493
+ fields: [
3494
+ {
3495
+ name: 'inputCompressedAccountHashes';
3496
+ type: {
3497
+ vec: {
3498
+ array: ['u8', 32];
3499
+ };
3500
+ };
3501
+ },
3502
+ {
3503
+ name: 'outputCompressedAccountHashes';
3504
+ type: {
3505
+ vec: {
3506
+ array: ['u8', 32];
3507
+ };
3508
+ };
3509
+ },
3510
+ {
3511
+ name: 'outputCompressedAccounts';
3512
+ type: {
3513
+ vec: {
3514
+ defined: 'OutputCompressedAccountWithPackedContext';
3515
+ };
3516
+ };
3517
+ },
3518
+ {
3519
+ name: 'outputLeafIndices';
3520
+ type: {
3521
+ vec: 'u32';
3522
+ };
3523
+ },
3524
+ {
3525
+ name: 'sequenceNumbers';
3526
+ type: {
3527
+ vec: {
3528
+ defined: 'MerkleTreeSequenceNumber';
3529
+ };
3530
+ };
3531
+ },
3532
+ {
3533
+ name: 'relayFee';
3534
+ type: {
3535
+ option: 'u64';
3536
+ };
3537
+ },
3538
+ {
3539
+ name: 'isCompress';
3540
+ type: 'bool';
3541
+ },
3542
+ {
3543
+ name: 'compressOrDecompressLamports';
3544
+ type: {
3545
+ option: 'u64';
3546
+ };
3547
+ },
3548
+ {
3549
+ name: 'pubkeyArray';
3550
+ type: {
3551
+ vec: 'publicKey';
3552
+ };
3553
+ },
3554
+ {
3555
+ name: 'message';
3556
+ type: {
3557
+ option: 'bytes';
3558
+ };
3559
+ }
3560
+ ];
3561
+ };
3562
+ }
3563
+ ];
3564
+ errors: [
3565
+ {
3566
+ code: 6000;
3567
+ name: 'SumCheckFailed';
3568
+ msg: 'Sum check failed';
3569
+ },
3570
+ {
3571
+ code: 6001;
3572
+ name: 'SignerCheckFailed';
3573
+ msg: 'Signer check failed';
3574
+ },
3575
+ {
3576
+ code: 6002;
3577
+ name: 'CpiSignerCheckFailed';
3578
+ msg: 'Cpi signer check failed';
3579
+ },
3580
+ {
3581
+ code: 6003;
3582
+ name: 'ComputeInputSumFailed';
3583
+ msg: 'Computing input sum failed.';
3584
+ },
3585
+ {
3586
+ code: 6004;
3587
+ name: 'ComputeOutputSumFailed';
3588
+ msg: 'Computing output sum failed.';
3589
+ },
3590
+ {
3591
+ code: 6005;
3592
+ name: 'ComputeRpcSumFailed';
3593
+ msg: 'Computing rpc sum failed.';
3594
+ },
3595
+ {
3596
+ code: 6006;
3597
+ name: 'InvalidAddress';
3598
+ msg: 'InvalidAddress';
3599
+ },
3600
+ {
3601
+ code: 6007;
3602
+ name: 'DeriveAddressError';
3603
+ msg: 'DeriveAddressError';
3604
+ },
3605
+ {
3606
+ code: 6008;
3607
+ name: 'CompressedSolPdaUndefinedForCompressSol';
3608
+ msg: 'CompressedSolPdaUndefinedForCompressSol';
3609
+ },
3610
+ {
3611
+ code: 6009;
3612
+ name: 'DeCompressLamportsUndefinedForCompressSol';
3613
+ msg: 'DeCompressLamportsUndefinedForCompressSol';
3614
+ },
3615
+ {
3616
+ code: 6010;
3617
+ name: 'CompressedSolPdaUndefinedForDecompressSol';
3618
+ msg: 'CompressedSolPdaUndefinedForDecompressSol';
3619
+ },
3620
+ {
3621
+ code: 6011;
3622
+ name: 'DeCompressLamportsUndefinedForDecompressSol';
3623
+ msg: 'DeCompressLamportsUndefinedForDecompressSol';
3624
+ },
3625
+ {
3626
+ code: 6012;
3627
+ name: 'DecompressRecipientUndefinedForDecompressSol';
3628
+ msg: 'DecompressRecipientUndefinedForDecompressSol';
3629
+ },
3630
+ {
3631
+ code: 6013;
3632
+ name: 'WriteAccessCheckFailed';
3633
+ msg: 'WriteAccessCheckFailed';
3634
+ },
3635
+ {
3636
+ code: 6014;
3637
+ name: 'InvokingProgramNotProvided';
3638
+ msg: 'InvokingProgramNotProvided';
3639
+ },
3640
+ {
3641
+ code: 6015;
3642
+ name: 'InvalidCapacity';
3643
+ msg: 'InvalidCapacity';
3644
+ },
3645
+ {
3646
+ code: 6016;
3647
+ name: 'InvalidMerkleTreeOwner';
3648
+ msg: 'InvalidMerkleTreeOwner';
3649
+ },
3650
+ {
3651
+ code: 6017;
3652
+ name: 'ProofIsNone';
3653
+ msg: 'ProofIsNone';
3654
+ },
3655
+ {
3656
+ code: 6018;
3657
+ name: 'ProofIsSome';
3658
+ msg: 'Proof is some but no input compressed accounts or new addresses provided.';
3659
+ },
3660
+ {
3661
+ code: 6019;
3662
+ name: 'EmptyInputs';
3663
+ msg: 'EmptyInputs';
3664
+ },
3665
+ {
3666
+ code: 6020;
3667
+ name: 'CpiContextAccountUndefined';
3668
+ msg: 'CpiContextAccountUndefined';
3669
+ },
3670
+ {
3671
+ code: 6021;
3672
+ name: 'CpiContextEmpty';
3673
+ msg: 'CpiContextEmpty';
3674
+ },
3675
+ {
3676
+ code: 6022;
3677
+ name: 'CpiContextMissing';
3678
+ msg: 'CpiContextMissing';
3679
+ },
3680
+ {
3681
+ code: 6023;
3682
+ name: 'DecompressionRecipientDefined';
3683
+ msg: 'DecompressionRecipientDefined';
3684
+ },
3685
+ {
3686
+ code: 6024;
3687
+ name: 'SolPoolPdaDefined';
3688
+ msg: 'SolPoolPdaDefined';
3689
+ },
3690
+ {
3691
+ code: 6025;
3692
+ name: 'AppendStateFailed';
3693
+ msg: 'AppendStateFailed';
3694
+ },
3695
+ {
3696
+ code: 6026;
3697
+ name: 'InstructionNotCallable';
3698
+ msg: 'The instruction is not callable';
3699
+ },
3700
+ {
3701
+ code: 6027;
3702
+ name: 'CpiContextFeePayerMismatch';
3703
+ msg: 'CpiContextFeePayerMismatch';
3704
+ },
3705
+ {
3706
+ code: 6028;
3707
+ name: 'CpiContextAssociatedMerkleTreeMismatch';
3708
+ msg: 'CpiContextAssociatedMerkleTreeMismatch';
3709
+ },
3710
+ {
3711
+ code: 6029;
3712
+ name: 'NoInputs';
3713
+ msg: 'NoInputs';
3714
+ },
3715
+ {
3716
+ code: 6030;
3717
+ name: 'InputMerkleTreeIndicesNotInOrder';
3718
+ msg: 'Input merkle tree indices are not in ascending order.';
3719
+ },
3720
+ {
3721
+ code: 6031;
3722
+ name: 'OutputMerkleTreeIndicesNotInOrder';
3723
+ msg: 'Output merkle tree indices are not in ascending order.';
3724
+ },
3725
+ {
3726
+ code: 6032;
3727
+ name: 'OutputMerkleTreeNotUnique';
3728
+ },
3729
+ {
3730
+ code: 6033;
3731
+ name: 'DataFieldUndefined';
3732
+ },
3733
+ {
3734
+ code: 6034;
3735
+ name: 'ReadOnlyAddressAlreadyExists';
3736
+ },
3737
+ {
3738
+ code: 6035;
3739
+ name: 'ReadOnlyAccountDoesNotExist';
3740
+ },
3741
+ {
3742
+ code: 6036;
3743
+ name: 'HashChainInputsLenghtInconsistent';
3744
+ },
3745
+ {
3746
+ code: 6037;
3747
+ name: 'InvalidAddressTreeHeight';
3748
+ }
3749
+ ];
3750
+ };
3751
+ declare const IDL: LightSystemProgram;
3752
+
3753
+ export { ADDRESS_QUEUE_ROLLOVER_FEE, ADDRESS_TREE_NETWORK_FEE, ALICE, AccountProofResult, type AddressWithTree, type BN254, BOB, BalanceResult, CHARLIE, type ClientSubscriptionId, type CompressedAccount, type CompressedAccountData, CompressedAccountLayout, CompressedAccountResult, type CompressedAccountWithMerkleContext, CompressedAccountsByOwnerResult, type CompressedMintTokenHolders, CompressedMintTokenHoldersResult, type CompressedProof, type CompressedProofWithContext, CompressedTokenAccountResult, CompressedTokenAccountsByOwnerOrDelegateResult, type CompressedTransaction, CompressedTransactionResult, 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, HealthResult, type HexBatchInputsForProver, type HexInputsForProver, IDL, INVOKE_DISCRIMINATOR, IndexedArray, IndexedElement, IndexedElementBundle, type InputTokenDataWithContext, type InstructionDataInvoke, InstructionDataInvokeLayout, type LatestNonVotingSignatures, type LatestNonVotingSignaturesPaginated, LatestNonVotingSignaturesResult, LatestNonVotingSignaturesResultPaginated, LightSystemProgram$1 as LightSystemProgram, type LightSystemProgram as LightSystemProgramIDL, type LightWasm, LookupTableError, LookupTableErrorCode, MerkeProofResult, type MerkleContext, MerkleContextLayout, type MerkleContextWithMerkleProof, type MerkleContextWithNewAddressProof, MerkleTree, MerkleTreeError, MerkleTreeErrorCode, type MerkleTreeSequenceNumber, MultipleCompressedAccountsResult, MultipleMerkleProofsResult, NativeBalanceResult, type NewAddressParams, NewAddressParamsLayout, type NewAddressParamsPacked, NewAddressProofResult, type NonInclusionJsonStruct, type NonInclusionMerkleProofInputs, type OutputCompressedAccountWithPackedContext, type PackedCompressedAccountWithMerkleContext, type PackedMerkleContext, type PaginatedOptions, type ParsedTokenAccount, ProofError, ProofErrorCode, type PublicTransactionEvent, PublicTransactionEventLayout, type QueueIndex, 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, TRANSACTION_MERKLE_TREE_ROLLOVER_THRESHOLD, TestRpc, type TestRpcConfig, type TokenBalance, TokenBalanceListResult, TokenBalanceListResultV2, TokenBalanceResult, type TokenData$1 as TokenData, TokenDataLayout, TokenDataResult, UTXO_MERGE_MAXIMUM, UTXO_MERGE_THRESHOLD, UtilsError, UtilsErrorCode, UtxoError, UtxoErrorCode, ValidityProofResult, type WithContext, type WithCursor, type WithRpcContext, accountCompressionProgram, addressQueue, addressTree, airdropSol, bn, bufToDecStr, buildAndSignTx, buildTx, byteArrayToKeypair, calculateComputeUnitPrice, checkValidityProofShape, compress, confirmConfig, confirmTransaction, confirmTx, convertMerkleProofsWithContextToHex, convertNonInclusionMerkleProofInputsToHex, createAccount, createAccountWithLamports, createBN254, createCompressedAccount, createCompressedAccountWithMerkleContext, createMerkleContext, createRpc, createRpcResult, decodeInstructionDataInvoke, decodePublicTransactionEvent, decompress, dedupeSigner, deepEqual, defaultStaticAccounts, defaultStaticAccountsStruct, defaultTestStateTreeAccounts, deriveAddress, deriveAddressSeed, encodeBN254toBase58, encodeInstructionDataInvoke, encodePublicTransactionEvent, getAccountCompressionAuthority, getCompressedTokenAccountByHashTest, getCompressedTokenAccounts, getCompressedTokenAccountsByDelegateTest, getCompressedTokenAccountsByOwnerTest, getConnection, getIndexOrAdd, getParsedEvents, getPublicInputHash, getRegisteredProgramPda, getTestKeypair, getTestRpc, hashToBn254FieldSizeBe, hashvToBn254FieldSizeBe, invokeAccountsLayout, type invokeAccountsLayoutParams, jsonRpcResult, jsonRpcResultAndContext, lightProgram, merkletreePubkey, negateAndCompressProof, newAccountWithLamports, noopProgram, nullifierQueuePubkey, packCompressedAccounts, packNewAddressParams, padOutputStateMerkleTrees, parseAccountData, parseEvents, parsePublicTransactionEventWithIdl, parseTokenLayoutWithIdl, pipe, placeholderValidityProof, proofFromJsonStruct, proverRequest, pushUniqueItems, rpcRequest, selectMinCompressedSolAccountsForTransfer, sendAndConfirmTx, sleep, sumUpLamports, toAccountMetas, toArray, toCamelCase, toHex, toUnixTimestamp, transfer, validateSameOwner, validateSufficientBalance };