@lightprotocol/stateless.js 0.20.8 → 0.21.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/actions/compress.d.ts +9 -7
- package/dist/cjs/browser/actions/create-account.d.ts +25 -28
- package/dist/cjs/browser/actions/decompress.d.ts +6 -7
- package/dist/cjs/browser/actions/index.d.ts +1 -1
- package/dist/cjs/browser/actions/transfer.d.ts +8 -11
- package/dist/cjs/browser/constants.d.ts +16 -6
- package/dist/cjs/browser/index.cjs +1 -1
- package/dist/cjs/browser/index.cjs.map +1 -1
- package/dist/cjs/browser/index.d.ts +2 -2
- package/dist/cjs/browser/instruction/pack-compressed-accounts.d.ts +6 -24
- package/dist/cjs/browser/programs/layout.d.ts +27 -0
- package/dist/cjs/browser/programs/system.d.ts +18 -27
- package/dist/cjs/browser/rpc-interface.d.ts +115 -50
- package/dist/cjs/browser/rpc.d.ts +21 -41
- package/dist/cjs/browser/state/BN254.d.ts +0 -1
- package/dist/cjs/browser/state/bn.d.ts +3 -0
- package/dist/cjs/browser/state/compressed-account.d.ts +53 -13
- package/dist/cjs/browser/state/index.d.ts +1 -0
- package/dist/cjs/browser/state/types.d.ts +87 -12
- package/dist/cjs/browser/test-helpers/test-rpc/get-compressed-accounts.d.ts +10 -1
- package/dist/cjs/browser/test-helpers/test-rpc/get-compressed-token-accounts.d.ts +1 -1
- package/dist/cjs/browser/test-helpers/test-rpc/test-rpc.d.ts +15 -19
- package/dist/cjs/browser/utils/get-state-tree-infos.d.ts +41 -0
- package/dist/cjs/browser/utils/index.d.ts +5 -2
- package/dist/cjs/browser/utils/parse-validity-proof.d.ts +3 -3
- package/dist/cjs/browser/utils/state-tree-lookup-table.d.ts +68 -0
- package/dist/cjs/node/actions/compress.d.ts +9 -7
- package/dist/cjs/node/actions/create-account.d.ts +25 -28
- package/dist/cjs/node/actions/decompress.d.ts +6 -7
- package/dist/cjs/node/actions/index.d.ts +1 -1
- package/dist/cjs/node/actions/transfer.d.ts +8 -11
- package/dist/cjs/node/constants.d.ts +16 -6
- package/dist/cjs/node/index.cjs +1 -1
- package/dist/cjs/node/index.cjs.map +1 -1
- package/dist/cjs/node/index.d.ts +2 -2
- package/dist/cjs/node/instruction/pack-compressed-accounts.d.ts +6 -24
- package/dist/cjs/node/programs/layout.d.ts +27 -0
- package/dist/cjs/node/programs/system.d.ts +18 -27
- package/dist/cjs/node/rpc-interface.d.ts +115 -50
- package/dist/cjs/node/rpc.d.ts +21 -41
- package/dist/cjs/node/state/BN254.d.ts +0 -1
- package/dist/cjs/node/state/bn.d.ts +3 -0
- package/dist/cjs/node/state/compressed-account.d.ts +53 -13
- package/dist/cjs/node/state/index.d.ts +1 -0
- package/dist/cjs/node/state/types.d.ts +87 -12
- package/dist/cjs/node/test-helpers/test-rpc/get-compressed-accounts.d.ts +10 -1
- package/dist/cjs/node/test-helpers/test-rpc/get-compressed-token-accounts.d.ts +1 -1
- package/dist/cjs/node/test-helpers/test-rpc/test-rpc.d.ts +15 -19
- package/dist/cjs/node/utils/get-state-tree-infos.d.ts +41 -0
- package/dist/cjs/node/utils/index.d.ts +5 -2
- package/dist/cjs/node/utils/parse-validity-proof.d.ts +3 -3
- package/dist/cjs/node/utils/state-tree-lookup-table.d.ts +68 -0
- package/dist/types/index.d.ts +596 -405
- package/package.json +4 -3
- package/dist/cjs/browser/utils/get-light-state-tree-info.d.ts +0 -76
- package/dist/cjs/node/utils/get-light-state-tree-info.d.ts +0 -76
- /package/dist/cjs/browser/{actions/common.d.ts → utils/dedupe-signer.d.ts} +0 -0
- /package/dist/cjs/node/{actions/common.d.ts → utils/dedupe-signer.d.ts} +0 -0
|
@@ -2,10 +2,10 @@ export * from './actions';
|
|
|
2
2
|
export * from './instruction';
|
|
3
3
|
export * from './programs';
|
|
4
4
|
export * from './state';
|
|
5
|
+
export * from './test-helpers';
|
|
5
6
|
export * from './utils';
|
|
6
7
|
export * from './constants';
|
|
7
8
|
export * from './errors';
|
|
9
|
+
export { LightSystemProgram as LightSystemProgramIDL, IDL } from './idl';
|
|
8
10
|
export * from './rpc-interface';
|
|
9
11
|
export * from './rpc';
|
|
10
|
-
export * from './test-helpers';
|
|
11
|
-
export { LightSystemProgram as LightSystemProgramIDL, IDL } from './idl';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AccountMeta, PublicKey } from '@solana/web3.js';
|
|
2
|
-
import {
|
|
2
|
+
import { CompressedAccount, OutputCompressedAccountWithPackedContext, PackedCompressedAccountWithMerkleContext, StateTreeInfo } from '../state';
|
|
3
3
|
import { CompressedAccountWithMerkleContext } from '../state/compressed-account';
|
|
4
4
|
/**
|
|
5
5
|
* @internal Finds the index of a PublicKey in an array, or adds it if not
|
|
@@ -19,20 +19,10 @@ export declare function getIndexOrAdd(accountsArray: PublicKey[], key: PublicKey
|
|
|
19
19
|
* outputCompressedAccounts.
|
|
20
20
|
* @param numberOfOutputCompressedAccounts The number of output
|
|
21
21
|
* compressed accounts.
|
|
22
|
-
* @param inputCompressedAccountsWithMerkleContext The input compressed
|
|
23
|
-
* accounts with merkle
|
|
24
|
-
* context.
|
|
25
|
-
* @param activeTreeBundles Optional active tree bundles
|
|
26
|
-
* to be used as fallback for
|
|
27
|
-
* padding. Prioritizes ones
|
|
28
|
-
* that are explicitly passed
|
|
29
|
-
* via outputStateMerkleTrees
|
|
30
|
-
* or
|
|
31
|
-
* inputCompressedAccountsWithMerkleContext.
|
|
32
22
|
*
|
|
33
23
|
* @returns Padded output state trees.
|
|
34
24
|
*/
|
|
35
|
-
export declare function padOutputStateMerkleTrees(outputStateMerkleTrees: PublicKey
|
|
25
|
+
export declare function padOutputStateMerkleTrees(outputStateMerkleTrees: PublicKey, numberOfOutputCompressedAccounts: number): PublicKey[];
|
|
36
26
|
export declare function toAccountMetas(remainingAccounts: PublicKey[]): AccountMeta[];
|
|
37
27
|
/**
|
|
38
28
|
* Packs Compressed Accounts.
|
|
@@ -45,22 +35,14 @@ export declare function toAccountMetas(remainingAccounts: PublicKey[]): AccountM
|
|
|
45
35
|
* input state. The expiry is tied to
|
|
46
36
|
* the proof.
|
|
47
37
|
* @param outputCompressedAccounts Ix output state to be created
|
|
48
|
-
* @param
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
* the input state. Gets padded to the
|
|
52
|
-
* length of outputCompressedAccounts.
|
|
53
|
-
*
|
|
54
|
-
* @param activeTreeBundles Optional active tree bundles to be
|
|
55
|
-
* used as fallback for padding.
|
|
56
|
-
* Prioritizes ones that are explicitly
|
|
57
|
-
* passed via outputStateMerkleTrees or
|
|
58
|
-
* inputCompressedAccountsWithMerkleContext.
|
|
38
|
+
* @param outputStateTreeInfo The output state tree info. Gets
|
|
39
|
+
* padded to the length of
|
|
40
|
+
* outputCompressedAccounts.
|
|
59
41
|
*
|
|
60
42
|
* @param remainingAccounts Optional existing array of accounts
|
|
61
43
|
* to append to.
|
|
62
44
|
**/
|
|
63
|
-
export declare function packCompressedAccounts(inputCompressedAccounts: CompressedAccountWithMerkleContext[], inputStateRootIndices: number[], outputCompressedAccounts: CompressedAccount[],
|
|
45
|
+
export declare function packCompressedAccounts(inputCompressedAccounts: CompressedAccountWithMerkleContext[], inputStateRootIndices: number[], outputCompressedAccounts: CompressedAccount[], outputStateTreeInfo?: StateTreeInfo, remainingAccounts?: PublicKey[]): {
|
|
64
46
|
packedInputCompressedAccounts: PackedCompressedAccountWithMerkleContext[];
|
|
65
47
|
packedOutputCompressedAccounts: OutputCompressedAccountWithPackedContext[];
|
|
66
48
|
remainingAccounts: PublicKey[];
|
|
@@ -11,14 +11,41 @@ export declare const InstructionDataInvokeCpiLayout: Layout<InstructionDataInvok
|
|
|
11
11
|
export declare function decodeInstructionDataInvoke(buffer: Buffer): InstructionDataInvoke;
|
|
12
12
|
export declare function decodeInstructionDataInvokeCpi(buffer: Buffer): InstructionDataInvokeCpi;
|
|
13
13
|
export type invokeAccountsLayoutParams = {
|
|
14
|
+
/**
|
|
15
|
+
* Fee payer.
|
|
16
|
+
*/
|
|
14
17
|
feePayer: PublicKey;
|
|
18
|
+
/**
|
|
19
|
+
* Authority.
|
|
20
|
+
*/
|
|
15
21
|
authority: PublicKey;
|
|
22
|
+
/**
|
|
23
|
+
* The registered program pda
|
|
24
|
+
*/
|
|
16
25
|
registeredProgramPda: PublicKey;
|
|
26
|
+
/**
|
|
27
|
+
* Noop program.
|
|
28
|
+
*/
|
|
17
29
|
noopProgram: PublicKey;
|
|
30
|
+
/**
|
|
31
|
+
* Account compression authority.
|
|
32
|
+
*/
|
|
18
33
|
accountCompressionAuthority: PublicKey;
|
|
34
|
+
/**
|
|
35
|
+
* Account compression program.
|
|
36
|
+
*/
|
|
19
37
|
accountCompressionProgram: PublicKey;
|
|
38
|
+
/**
|
|
39
|
+
* Solana pool pda. Some() if compression or decompression is done.
|
|
40
|
+
*/
|
|
20
41
|
solPoolPda: PublicKey | null;
|
|
42
|
+
/**
|
|
43
|
+
* Decompression recipient.
|
|
44
|
+
*/
|
|
21
45
|
decompressionRecipient: PublicKey | null;
|
|
46
|
+
/**
|
|
47
|
+
* Solana system program.
|
|
48
|
+
*/
|
|
22
49
|
systemProgram: PublicKey;
|
|
23
50
|
};
|
|
24
51
|
export declare const invokeAccountsLayout: (accounts: invokeAccountsLayoutParams) => AccountMeta[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import BN from 'bn.js';
|
|
2
2
|
import { PublicKey, TransactionInstruction } from '@solana/web3.js';
|
|
3
|
-
import { CompressedAccount, CompressedAccountWithMerkleContext,
|
|
3
|
+
import { CompressedAccount, CompressedAccountWithMerkleContext, ValidityProof, StateTreeInfo } from '../state';
|
|
4
4
|
import { NewAddressParams } from '../utils';
|
|
5
5
|
export declare const sumUpLamports: (accounts: CompressedAccountWithMerkleContext[]) => BN;
|
|
6
6
|
/**
|
|
@@ -12,21 +12,24 @@ type CreateAccountWithSeedParams = {
|
|
|
12
12
|
*/
|
|
13
13
|
payer: PublicKey;
|
|
14
14
|
/**
|
|
15
|
-
* Address params for the new compressed account
|
|
15
|
+
* Address params for the new compressed account.
|
|
16
16
|
*/
|
|
17
17
|
newAddressParams: NewAddressParams;
|
|
18
|
+
/**
|
|
19
|
+
* Address of the new compressed account
|
|
20
|
+
*/
|
|
18
21
|
newAddress: number[];
|
|
19
22
|
/**
|
|
20
23
|
* Recent validity proof proving that there's no existing compressed account
|
|
21
24
|
* registered with newAccountAddress
|
|
22
25
|
*/
|
|
23
|
-
recentValidityProof:
|
|
26
|
+
recentValidityProof: ValidityProof;
|
|
24
27
|
/**
|
|
25
28
|
* State tree pubkey. Defaults to a public state tree if unspecified.
|
|
26
29
|
*/
|
|
27
|
-
|
|
30
|
+
outputStateTreeInfo?: StateTreeInfo;
|
|
28
31
|
/**
|
|
29
|
-
* Public key of the program to assign as the owner of the created account
|
|
32
|
+
* Public key of the program to assign as the owner of the created account.
|
|
30
33
|
*/
|
|
31
34
|
programId?: PublicKey;
|
|
32
35
|
/**
|
|
@@ -57,11 +60,11 @@ type TransferParams = {
|
|
|
57
60
|
*/
|
|
58
61
|
inputCompressedAccounts: CompressedAccountWithMerkleContext[];
|
|
59
62
|
/**
|
|
60
|
-
* Recipient address
|
|
63
|
+
* Recipient address.
|
|
61
64
|
*/
|
|
62
65
|
toAddress: PublicKey;
|
|
63
66
|
/**
|
|
64
|
-
*
|
|
67
|
+
* Amount of lamports to transfer.
|
|
65
68
|
*/
|
|
66
69
|
lamports: number | BN;
|
|
67
70
|
/**
|
|
@@ -75,13 +78,7 @@ type TransferParams = {
|
|
|
75
78
|
* The recent validity proof for state inclusion of the input state. It
|
|
76
79
|
* expires after n slots.
|
|
77
80
|
*/
|
|
78
|
-
recentValidityProof:
|
|
79
|
-
/**
|
|
80
|
-
* The state trees that the tx output should be inserted into. This can be a
|
|
81
|
-
* single PublicKey or an array of PublicKey. Defaults to the 0th state tree
|
|
82
|
-
* of input state.
|
|
83
|
-
*/
|
|
84
|
-
outputStateTrees?: PublicKey[] | PublicKey;
|
|
81
|
+
recentValidityProof: ValidityProof;
|
|
85
82
|
};
|
|
86
83
|
/**
|
|
87
84
|
* Defines the parameters for the transfer method
|
|
@@ -103,7 +100,7 @@ type CompressParams = {
|
|
|
103
100
|
* The state tree that the tx output should be inserted into. Defaults to a
|
|
104
101
|
* public state tree if unspecified.
|
|
105
102
|
*/
|
|
106
|
-
|
|
103
|
+
outputStateTreeInfo: StateTreeInfo;
|
|
107
104
|
};
|
|
108
105
|
/**
|
|
109
106
|
* Defines the parameters for the transfer method
|
|
@@ -136,13 +133,7 @@ type DecompressParams = {
|
|
|
136
133
|
* The recent validity proof for state inclusion of the input state. It
|
|
137
134
|
* expires after n slots.
|
|
138
135
|
*/
|
|
139
|
-
recentValidityProof:
|
|
140
|
-
/**
|
|
141
|
-
* The state trees that the tx output should be inserted into. This can be a
|
|
142
|
-
* single PublicKey or an array of PublicKey. Defaults to the 0th state tree
|
|
143
|
-
* of input state.
|
|
144
|
-
*/
|
|
145
|
-
outputStateTree?: PublicKey;
|
|
136
|
+
recentValidityProof: ValidityProof;
|
|
146
137
|
};
|
|
147
138
|
export declare class LightSystemProgram {
|
|
148
139
|
/**
|
|
@@ -150,7 +141,7 @@ export declare class LightSystemProgram {
|
|
|
150
141
|
*/
|
|
151
142
|
constructor();
|
|
152
143
|
/**
|
|
153
|
-
*
|
|
144
|
+
* The LightSystemProgram program ID.
|
|
154
145
|
*/
|
|
155
146
|
static programId: PublicKey;
|
|
156
147
|
/**
|
|
@@ -171,22 +162,22 @@ export declare class LightSystemProgram {
|
|
|
171
162
|
*
|
|
172
163
|
* TODO: support transfer of lamports to the new account.
|
|
173
164
|
*/
|
|
174
|
-
static createAccount({ payer, newAddressParams, newAddress, recentValidityProof,
|
|
165
|
+
static createAccount({ payer, newAddressParams, newAddress, recentValidityProof, outputStateTreeInfo, inputCompressedAccounts, inputStateRootIndices, lamports, }: CreateAccountWithSeedParams): Promise<TransactionInstruction>;
|
|
175
166
|
/**
|
|
176
167
|
* Creates a transaction instruction that transfers compressed lamports from
|
|
177
168
|
* one owner to another.
|
|
178
169
|
*/
|
|
179
|
-
static transfer({ payer, inputCompressedAccounts, toAddress, lamports, recentInputStateRootIndices, recentValidityProof,
|
|
170
|
+
static transfer({ payer, inputCompressedAccounts, toAddress, lamports, recentInputStateRootIndices, recentValidityProof, }: TransferParams): Promise<TransactionInstruction>;
|
|
180
171
|
/**
|
|
181
172
|
* Creates a transaction instruction that transfers compressed lamports from
|
|
182
173
|
* one owner to another.
|
|
183
174
|
*/
|
|
184
|
-
static compress({ payer, toAddress, lamports,
|
|
175
|
+
static compress({ payer, toAddress, lamports, outputStateTreeInfo, }: CompressParams): Promise<TransactionInstruction>;
|
|
185
176
|
/**
|
|
186
177
|
* Creates a transaction instruction that transfers compressed lamports from
|
|
187
178
|
* one owner to another.
|
|
188
179
|
*/
|
|
189
|
-
static decompress({ payer, inputCompressedAccounts, toAddress, lamports, recentInputStateRootIndices, recentValidityProof,
|
|
180
|
+
static decompress({ payer, inputCompressedAccounts, toAddress, lamports, recentInputStateRootIndices, recentValidityProof, }: DecompressParams): Promise<TransactionInstruction>;
|
|
190
181
|
}
|
|
191
182
|
/**
|
|
192
183
|
* Selects the minimal number of compressed SOL accounts for a transfer.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PublicKey, MemcmpFilter, DataSlice } from '@solana/web3.js';
|
|
2
2
|
import { Struct } from 'superstruct';
|
|
3
|
-
import { BN254,
|
|
3
|
+
import { BN254, ValidityProof, CompressedAccountWithMerkleContext, MerkleContextWithMerkleProof, TokenData, StateTreeInfo, AddressTreeInfo, CompressedProof } from './state';
|
|
4
4
|
import BN from 'bn.js';
|
|
5
5
|
export interface LatestNonVotingSignatures {
|
|
6
6
|
context: {
|
|
@@ -43,6 +43,32 @@ export interface SignatureWithMetadata {
|
|
|
43
43
|
signature: string;
|
|
44
44
|
slot: number;
|
|
45
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* Account hash and associated state tree info.
|
|
48
|
+
*/
|
|
49
|
+
export interface HashWithTreeInfo {
|
|
50
|
+
/**
|
|
51
|
+
* Account hash.
|
|
52
|
+
*/
|
|
53
|
+
hash: BN254;
|
|
54
|
+
/**
|
|
55
|
+
* State tree info.
|
|
56
|
+
*/
|
|
57
|
+
stateTreeInfo: StateTreeInfo;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Address and associated address tree info.
|
|
61
|
+
*/
|
|
62
|
+
export interface AddressWithTreeInfo {
|
|
63
|
+
/**
|
|
64
|
+
* Address.
|
|
65
|
+
*/
|
|
66
|
+
address: BN254;
|
|
67
|
+
/**
|
|
68
|
+
* Address tree info.
|
|
69
|
+
*/
|
|
70
|
+
addressTreeInfo: AddressTreeInfo;
|
|
71
|
+
}
|
|
46
72
|
export interface HashWithTree {
|
|
47
73
|
hash: BN254;
|
|
48
74
|
tree: PublicKey;
|
|
@@ -53,6 +79,10 @@ export interface AddressWithTree {
|
|
|
53
79
|
tree: PublicKey;
|
|
54
80
|
queue: PublicKey;
|
|
55
81
|
}
|
|
82
|
+
export interface AddressWithTreeInfo {
|
|
83
|
+
address: BN254;
|
|
84
|
+
treeInfo: AddressTreeInfo;
|
|
85
|
+
}
|
|
56
86
|
export interface CompressedTransaction {
|
|
57
87
|
compressionInfo: {
|
|
58
88
|
closedAccounts: {
|
|
@@ -85,6 +115,41 @@ export interface HexInputsForProver {
|
|
|
85
115
|
pathElements: string[];
|
|
86
116
|
leaf: string;
|
|
87
117
|
}
|
|
118
|
+
/**
|
|
119
|
+
* Validity proof with context.
|
|
120
|
+
*
|
|
121
|
+
* You can request proofs via `rpc.getValidityProof` or
|
|
122
|
+
* `rpc.getValidityProofV0`.
|
|
123
|
+
*/
|
|
124
|
+
export type ValidityProofWithContext = {
|
|
125
|
+
/**
|
|
126
|
+
* Validity proof.
|
|
127
|
+
*/
|
|
128
|
+
compressedProof: ValidityProof;
|
|
129
|
+
/**
|
|
130
|
+
* Roots.
|
|
131
|
+
*/
|
|
132
|
+
roots: BN[];
|
|
133
|
+
/**
|
|
134
|
+
* Root indices.
|
|
135
|
+
*/
|
|
136
|
+
rootIndices: number[];
|
|
137
|
+
/**
|
|
138
|
+
* Leaf indices.
|
|
139
|
+
*/
|
|
140
|
+
leafIndices: number[];
|
|
141
|
+
/**
|
|
142
|
+
* Leaves.
|
|
143
|
+
*/
|
|
144
|
+
leaves: BN[];
|
|
145
|
+
/**
|
|
146
|
+
* Tree infos.
|
|
147
|
+
*/
|
|
148
|
+
treeInfos: StateTreeInfo[];
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* @deprecated use {@link ValidityProofWithContext} instead
|
|
152
|
+
*/
|
|
88
153
|
export type CompressedProofWithContext = {
|
|
89
154
|
compressedProof: CompressedProof;
|
|
90
155
|
roots: BN[];
|
|
@@ -168,12 +233,12 @@ export declare const CompressedAccountResult: Struct<{
|
|
|
168
233
|
dataHash: BN;
|
|
169
234
|
discriminator: BN;
|
|
170
235
|
} | null;
|
|
236
|
+
lamports: BN;
|
|
237
|
+
tree: PublicKey;
|
|
171
238
|
address: number[] | null;
|
|
172
239
|
hash: BN;
|
|
173
|
-
lamports: BN;
|
|
174
240
|
owner: PublicKey;
|
|
175
241
|
leafIndex: number;
|
|
176
|
-
tree: PublicKey;
|
|
177
242
|
seq: BN | null;
|
|
178
243
|
slotCreated: BN;
|
|
179
244
|
}, {
|
|
@@ -225,12 +290,12 @@ export declare const CompressedTokenAccountResult: Struct<{
|
|
|
225
290
|
dataHash: BN;
|
|
226
291
|
discriminator: BN;
|
|
227
292
|
} | null;
|
|
293
|
+
lamports: BN;
|
|
294
|
+
tree: PublicKey;
|
|
228
295
|
address: number[] | null;
|
|
229
296
|
hash: BN;
|
|
230
|
-
lamports: BN;
|
|
231
297
|
owner: PublicKey;
|
|
232
298
|
leafIndex: number;
|
|
233
|
-
tree: PublicKey;
|
|
234
299
|
seq: BN | null;
|
|
235
300
|
slotCreated: BN;
|
|
236
301
|
};
|
|
@@ -254,12 +319,12 @@ export declare const CompressedTokenAccountResult: Struct<{
|
|
|
254
319
|
dataHash: BN;
|
|
255
320
|
discriminator: BN;
|
|
256
321
|
} | null;
|
|
322
|
+
lamports: BN;
|
|
323
|
+
tree: PublicKey;
|
|
257
324
|
address: number[] | null;
|
|
258
325
|
hash: BN;
|
|
259
|
-
lamports: BN;
|
|
260
326
|
owner: PublicKey;
|
|
261
327
|
leafIndex: number;
|
|
262
|
-
tree: PublicKey;
|
|
263
328
|
seq: BN | null;
|
|
264
329
|
slotCreated: BN;
|
|
265
330
|
}, {
|
|
@@ -292,12 +357,12 @@ export declare const MultipleCompressedAccountsResult: Struct<{
|
|
|
292
357
|
dataHash: BN;
|
|
293
358
|
discriminator: BN;
|
|
294
359
|
} | null;
|
|
360
|
+
lamports: BN;
|
|
361
|
+
tree: PublicKey;
|
|
295
362
|
address: number[] | null;
|
|
296
363
|
hash: BN;
|
|
297
|
-
lamports: BN;
|
|
298
364
|
owner: PublicKey;
|
|
299
365
|
leafIndex: number;
|
|
300
|
-
tree: PublicKey;
|
|
301
366
|
seq: BN | null;
|
|
302
367
|
slotCreated: BN;
|
|
303
368
|
}[];
|
|
@@ -308,12 +373,12 @@ export declare const MultipleCompressedAccountsResult: Struct<{
|
|
|
308
373
|
dataHash: BN;
|
|
309
374
|
discriminator: BN;
|
|
310
375
|
} | null;
|
|
376
|
+
lamports: BN;
|
|
377
|
+
tree: PublicKey;
|
|
311
378
|
address: number[] | null;
|
|
312
379
|
hash: BN;
|
|
313
|
-
lamports: BN;
|
|
314
380
|
owner: PublicKey;
|
|
315
381
|
leafIndex: number;
|
|
316
|
-
tree: PublicKey;
|
|
317
382
|
seq: BN | null;
|
|
318
383
|
slotCreated: BN;
|
|
319
384
|
}[], Struct<{
|
|
@@ -322,12 +387,12 @@ export declare const MultipleCompressedAccountsResult: Struct<{
|
|
|
322
387
|
dataHash: BN;
|
|
323
388
|
discriminator: BN;
|
|
324
389
|
} | null;
|
|
390
|
+
lamports: BN;
|
|
391
|
+
tree: PublicKey;
|
|
325
392
|
address: number[] | null;
|
|
326
393
|
hash: BN;
|
|
327
|
-
lamports: BN;
|
|
328
394
|
owner: PublicKey;
|
|
329
395
|
leafIndex: number;
|
|
330
|
-
tree: PublicKey;
|
|
331
396
|
seq: BN | null;
|
|
332
397
|
slotCreated: BN;
|
|
333
398
|
}, {
|
|
@@ -360,12 +425,12 @@ export declare const CompressedAccountsByOwnerResult: Struct<{
|
|
|
360
425
|
dataHash: BN;
|
|
361
426
|
discriminator: BN;
|
|
362
427
|
} | null;
|
|
428
|
+
lamports: BN;
|
|
429
|
+
tree: PublicKey;
|
|
363
430
|
address: number[] | null;
|
|
364
431
|
hash: BN;
|
|
365
|
-
lamports: BN;
|
|
366
432
|
owner: PublicKey;
|
|
367
433
|
leafIndex: number;
|
|
368
|
-
tree: PublicKey;
|
|
369
434
|
seq: BN | null;
|
|
370
435
|
slotCreated: BN;
|
|
371
436
|
}[];
|
|
@@ -377,12 +442,12 @@ export declare const CompressedAccountsByOwnerResult: Struct<{
|
|
|
377
442
|
dataHash: BN;
|
|
378
443
|
discriminator: BN;
|
|
379
444
|
} | null;
|
|
445
|
+
lamports: BN;
|
|
446
|
+
tree: PublicKey;
|
|
380
447
|
address: number[] | null;
|
|
381
448
|
hash: BN;
|
|
382
|
-
lamports: BN;
|
|
383
449
|
owner: PublicKey;
|
|
384
450
|
leafIndex: number;
|
|
385
|
-
tree: PublicKey;
|
|
386
451
|
seq: BN | null;
|
|
387
452
|
slotCreated: BN;
|
|
388
453
|
}[], Struct<{
|
|
@@ -391,12 +456,12 @@ export declare const CompressedAccountsByOwnerResult: Struct<{
|
|
|
391
456
|
dataHash: BN;
|
|
392
457
|
discriminator: BN;
|
|
393
458
|
} | null;
|
|
459
|
+
lamports: BN;
|
|
460
|
+
tree: PublicKey;
|
|
394
461
|
address: number[] | null;
|
|
395
462
|
hash: BN;
|
|
396
|
-
lamports: BN;
|
|
397
463
|
owner: PublicKey;
|
|
398
464
|
leafIndex: number;
|
|
399
|
-
tree: PublicKey;
|
|
400
465
|
seq: BN | null;
|
|
401
466
|
slotCreated: BN;
|
|
402
467
|
}, {
|
|
@@ -438,12 +503,12 @@ export declare const CompressedTokenAccountsByOwnerOrDelegateResult: Struct<{
|
|
|
438
503
|
dataHash: BN;
|
|
439
504
|
discriminator: BN;
|
|
440
505
|
} | null;
|
|
506
|
+
lamports: BN;
|
|
507
|
+
tree: PublicKey;
|
|
441
508
|
address: number[] | null;
|
|
442
509
|
hash: BN;
|
|
443
|
-
lamports: BN;
|
|
444
510
|
owner: PublicKey;
|
|
445
511
|
leafIndex: number;
|
|
446
|
-
tree: PublicKey;
|
|
447
512
|
seq: BN | null;
|
|
448
513
|
slotCreated: BN;
|
|
449
514
|
};
|
|
@@ -464,12 +529,12 @@ export declare const CompressedTokenAccountsByOwnerOrDelegateResult: Struct<{
|
|
|
464
529
|
dataHash: BN;
|
|
465
530
|
discriminator: BN;
|
|
466
531
|
} | null;
|
|
532
|
+
lamports: BN;
|
|
533
|
+
tree: PublicKey;
|
|
467
534
|
address: number[] | null;
|
|
468
535
|
hash: BN;
|
|
469
|
-
lamports: BN;
|
|
470
536
|
owner: PublicKey;
|
|
471
537
|
leafIndex: number;
|
|
472
|
-
tree: PublicKey;
|
|
473
538
|
seq: BN | null;
|
|
474
539
|
slotCreated: BN;
|
|
475
540
|
};
|
|
@@ -487,12 +552,12 @@ export declare const CompressedTokenAccountsByOwnerOrDelegateResult: Struct<{
|
|
|
487
552
|
dataHash: BN;
|
|
488
553
|
discriminator: BN;
|
|
489
554
|
} | null;
|
|
555
|
+
lamports: BN;
|
|
556
|
+
tree: PublicKey;
|
|
490
557
|
address: number[] | null;
|
|
491
558
|
hash: BN;
|
|
492
|
-
lamports: BN;
|
|
493
559
|
owner: PublicKey;
|
|
494
560
|
leafIndex: number;
|
|
495
|
-
tree: PublicKey;
|
|
496
561
|
seq: BN | null;
|
|
497
562
|
slotCreated: BN;
|
|
498
563
|
};
|
|
@@ -516,12 +581,12 @@ export declare const CompressedTokenAccountsByOwnerOrDelegateResult: Struct<{
|
|
|
516
581
|
dataHash: BN;
|
|
517
582
|
discriminator: BN;
|
|
518
583
|
} | null;
|
|
584
|
+
lamports: BN;
|
|
585
|
+
tree: PublicKey;
|
|
519
586
|
address: number[] | null;
|
|
520
587
|
hash: BN;
|
|
521
|
-
lamports: BN;
|
|
522
588
|
owner: PublicKey;
|
|
523
589
|
leafIndex: number;
|
|
524
|
-
tree: PublicKey;
|
|
525
590
|
seq: BN | null;
|
|
526
591
|
slotCreated: BN;
|
|
527
592
|
}, {
|
|
@@ -841,12 +906,12 @@ export declare const CompressedTransactionResult: Struct<{
|
|
|
841
906
|
dataHash: BN;
|
|
842
907
|
discriminator: BN;
|
|
843
908
|
} | null;
|
|
909
|
+
lamports: BN;
|
|
910
|
+
tree: PublicKey;
|
|
844
911
|
address: number[] | null;
|
|
845
912
|
hash: BN;
|
|
846
|
-
lamports: BN;
|
|
847
913
|
owner: PublicKey;
|
|
848
914
|
leafIndex: number;
|
|
849
|
-
tree: PublicKey;
|
|
850
915
|
seq: BN | null;
|
|
851
916
|
slotCreated: BN;
|
|
852
917
|
};
|
|
@@ -865,12 +930,12 @@ export declare const CompressedTransactionResult: Struct<{
|
|
|
865
930
|
dataHash: BN;
|
|
866
931
|
discriminator: BN;
|
|
867
932
|
} | null;
|
|
933
|
+
lamports: BN;
|
|
934
|
+
tree: PublicKey;
|
|
868
935
|
address: number[] | null;
|
|
869
936
|
hash: BN;
|
|
870
|
-
lamports: BN;
|
|
871
937
|
owner: PublicKey;
|
|
872
938
|
leafIndex: number;
|
|
873
|
-
tree: PublicKey;
|
|
874
939
|
seq: BN | null;
|
|
875
940
|
slotCreated: BN;
|
|
876
941
|
};
|
|
@@ -893,12 +958,12 @@ export declare const CompressedTransactionResult: Struct<{
|
|
|
893
958
|
dataHash: BN;
|
|
894
959
|
discriminator: BN;
|
|
895
960
|
} | null;
|
|
961
|
+
lamports: BN;
|
|
962
|
+
tree: PublicKey;
|
|
896
963
|
address: number[] | null;
|
|
897
964
|
hash: BN;
|
|
898
|
-
lamports: BN;
|
|
899
965
|
owner: PublicKey;
|
|
900
966
|
leafIndex: number;
|
|
901
|
-
tree: PublicKey;
|
|
902
967
|
seq: BN | null;
|
|
903
968
|
slotCreated: BN;
|
|
904
969
|
};
|
|
@@ -917,12 +982,12 @@ export declare const CompressedTransactionResult: Struct<{
|
|
|
917
982
|
dataHash: BN;
|
|
918
983
|
discriminator: BN;
|
|
919
984
|
} | null;
|
|
985
|
+
lamports: BN;
|
|
986
|
+
tree: PublicKey;
|
|
920
987
|
address: number[] | null;
|
|
921
988
|
hash: BN;
|
|
922
|
-
lamports: BN;
|
|
923
989
|
owner: PublicKey;
|
|
924
990
|
leafIndex: number;
|
|
925
|
-
tree: PublicKey;
|
|
926
991
|
seq: BN | null;
|
|
927
992
|
slotCreated: BN;
|
|
928
993
|
};
|
|
@@ -942,12 +1007,12 @@ export declare const CompressedTransactionResult: Struct<{
|
|
|
942
1007
|
dataHash: BN;
|
|
943
1008
|
discriminator: BN;
|
|
944
1009
|
} | null;
|
|
1010
|
+
lamports: BN;
|
|
1011
|
+
tree: PublicKey;
|
|
945
1012
|
address: number[] | null;
|
|
946
1013
|
hash: BN;
|
|
947
|
-
lamports: BN;
|
|
948
1014
|
owner: PublicKey;
|
|
949
1015
|
leafIndex: number;
|
|
950
|
-
tree: PublicKey;
|
|
951
1016
|
seq: BN | null;
|
|
952
1017
|
slotCreated: BN;
|
|
953
1018
|
};
|
|
@@ -965,12 +1030,12 @@ export declare const CompressedTransactionResult: Struct<{
|
|
|
965
1030
|
dataHash: BN;
|
|
966
1031
|
discriminator: BN;
|
|
967
1032
|
} | null;
|
|
1033
|
+
lamports: BN;
|
|
1034
|
+
tree: PublicKey;
|
|
968
1035
|
address: number[] | null;
|
|
969
1036
|
hash: BN;
|
|
970
|
-
lamports: BN;
|
|
971
1037
|
owner: PublicKey;
|
|
972
1038
|
leafIndex: number;
|
|
973
|
-
tree: PublicKey;
|
|
974
1039
|
seq: BN | null;
|
|
975
1040
|
slotCreated: BN;
|
|
976
1041
|
};
|
|
@@ -988,12 +1053,12 @@ export declare const CompressedTransactionResult: Struct<{
|
|
|
988
1053
|
dataHash: BN;
|
|
989
1054
|
discriminator: BN;
|
|
990
1055
|
} | null;
|
|
1056
|
+
lamports: BN;
|
|
1057
|
+
tree: PublicKey;
|
|
991
1058
|
address: number[] | null;
|
|
992
1059
|
hash: BN;
|
|
993
|
-
lamports: BN;
|
|
994
1060
|
owner: PublicKey;
|
|
995
1061
|
leafIndex: number;
|
|
996
|
-
tree: PublicKey;
|
|
997
1062
|
seq: BN | null;
|
|
998
1063
|
slotCreated: BN;
|
|
999
1064
|
}, {
|
|
@@ -1036,12 +1101,12 @@ export declare const CompressedTransactionResult: Struct<{
|
|
|
1036
1101
|
dataHash: BN;
|
|
1037
1102
|
discriminator: BN;
|
|
1038
1103
|
} | null;
|
|
1104
|
+
lamports: BN;
|
|
1105
|
+
tree: PublicKey;
|
|
1039
1106
|
address: number[] | null;
|
|
1040
1107
|
hash: BN;
|
|
1041
|
-
lamports: BN;
|
|
1042
1108
|
owner: PublicKey;
|
|
1043
1109
|
leafIndex: number;
|
|
1044
|
-
tree: PublicKey;
|
|
1045
1110
|
seq: BN | null;
|
|
1046
1111
|
slotCreated: BN;
|
|
1047
1112
|
};
|
|
@@ -1059,12 +1124,12 @@ export declare const CompressedTransactionResult: Struct<{
|
|
|
1059
1124
|
dataHash: BN;
|
|
1060
1125
|
discriminator: BN;
|
|
1061
1126
|
} | null;
|
|
1127
|
+
lamports: BN;
|
|
1128
|
+
tree: PublicKey;
|
|
1062
1129
|
address: number[] | null;
|
|
1063
1130
|
hash: BN;
|
|
1064
|
-
lamports: BN;
|
|
1065
1131
|
owner: PublicKey;
|
|
1066
1132
|
leafIndex: number;
|
|
1067
|
-
tree: PublicKey;
|
|
1068
1133
|
seq: BN | null;
|
|
1069
1134
|
slotCreated: BN;
|
|
1070
1135
|
};
|
|
@@ -1082,12 +1147,12 @@ export declare const CompressedTransactionResult: Struct<{
|
|
|
1082
1147
|
dataHash: BN;
|
|
1083
1148
|
discriminator: BN;
|
|
1084
1149
|
} | null;
|
|
1150
|
+
lamports: BN;
|
|
1151
|
+
tree: PublicKey;
|
|
1085
1152
|
address: number[] | null;
|
|
1086
1153
|
hash: BN;
|
|
1087
|
-
lamports: BN;
|
|
1088
1154
|
owner: PublicKey;
|
|
1089
1155
|
leafIndex: number;
|
|
1090
|
-
tree: PublicKey;
|
|
1091
1156
|
seq: BN | null;
|
|
1092
1157
|
slotCreated: BN;
|
|
1093
1158
|
}, {
|
|
@@ -1133,9 +1198,9 @@ export interface CompressionApiInterface {
|
|
|
1133
1198
|
getCompressedAccountProof(hash: BN254): Promise<MerkleContextWithMerkleProof>;
|
|
1134
1199
|
getMultipleCompressedAccounts(hashes: BN254[]): Promise<CompressedAccountWithMerkleContext[]>;
|
|
1135
1200
|
getMultipleCompressedAccountProofs(hashes: BN254[]): Promise<MerkleContextWithMerkleProof[]>;
|
|
1136
|
-
getValidityProof(hashes: BN254[], newAddresses: BN254[]): Promise<
|
|
1137
|
-
getValidityProofV0(hashes: HashWithTree[], newAddresses: AddressWithTree[]): Promise<
|
|
1138
|
-
getValidityProofAndRpcContext(hashes: HashWithTree[], newAddresses: AddressWithTree[]): Promise<WithContext<
|
|
1201
|
+
getValidityProof(hashes: BN254[], newAddresses: BN254[]): Promise<ValidityProofWithContext>;
|
|
1202
|
+
getValidityProofV0(hashes: HashWithTree[], newAddresses: AddressWithTree[]): Promise<ValidityProofWithContext>;
|
|
1203
|
+
getValidityProofAndRpcContext(hashes: HashWithTree[], newAddresses: AddressWithTree[]): Promise<WithContext<ValidityProofWithContext>>;
|
|
1139
1204
|
getCompressedAccountsByOwner(owner: PublicKey, config?: GetCompressedAccountsByOwnerConfig): Promise<WithCursor<CompressedAccountWithMerkleContext[]>>;
|
|
1140
1205
|
getCompressedMintTokenHolders(mint: PublicKey, options?: PaginatedOptions): Promise<WithContext<WithCursor<CompressedMintTokenHolders[]>>>;
|
|
1141
1206
|
getCompressedTokenAccountsByOwner(publicKey: PublicKey, options: GetCompressedTokenAccountsByOwnerOrDelegateOptions): Promise<WithCursor<ParsedTokenAccount[]>>;
|