@lightprotocol/stateless.js 0.20.9 → 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 +15 -17
- 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 +92 -27
- 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 +15 -17
- 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 +92 -27
- 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 +565 -358
- 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
package/dist/cjs/node/index.d.ts
CHANGED
|
@@ -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 { CompressedAccount, OutputCompressedAccountWithPackedContext, PackedCompressedAccountWithMerkleContext } from '../state';
|
|
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
|
|
@@ -10,19 +10,19 @@ export declare function getIndexOrAdd(accountsArray: PublicKey[], key: PublicKey
|
|
|
10
10
|
* @internal
|
|
11
11
|
* Pads output state trees with the 0th state tree of the input state.
|
|
12
12
|
*
|
|
13
|
-
* @param outputStateMerkleTrees
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* @param
|
|
21
|
-
*
|
|
13
|
+
* @param outputStateMerkleTrees Optional output state trees
|
|
14
|
+
* to be inserted into the
|
|
15
|
+
* output state. Defaults to
|
|
16
|
+
* the 0th state tree of the
|
|
17
|
+
* input state. Gets padded to
|
|
18
|
+
* the length of
|
|
19
|
+
* outputCompressedAccounts.
|
|
20
|
+
* @param numberOfOutputCompressedAccounts The number of output
|
|
21
|
+
* compressed accounts.
|
|
22
22
|
*
|
|
23
23
|
* @returns Padded output state trees.
|
|
24
24
|
*/
|
|
25
|
-
export declare function padOutputStateMerkleTrees(outputStateMerkleTrees: PublicKey
|
|
25
|
+
export declare function padOutputStateMerkleTrees(outputStateMerkleTrees: PublicKey, numberOfOutputCompressedAccounts: number): PublicKey[];
|
|
26
26
|
export declare function toAccountMetas(remainingAccounts: PublicKey[]): AccountMeta[];
|
|
27
27
|
/**
|
|
28
28
|
* Packs Compressed Accounts.
|
|
@@ -35,16 +35,14 @@ export declare function toAccountMetas(remainingAccounts: PublicKey[]): AccountM
|
|
|
35
35
|
* input state. The expiry is tied to
|
|
36
36
|
* the proof.
|
|
37
37
|
* @param outputCompressedAccounts Ix output state to be created
|
|
38
|
-
* @param
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
* the input state. Gets padded to the
|
|
42
|
-
* length of outputCompressedAccounts.
|
|
38
|
+
* @param outputStateTreeInfo The output state tree info. Gets
|
|
39
|
+
* padded to the length of
|
|
40
|
+
* outputCompressedAccounts.
|
|
43
41
|
*
|
|
44
42
|
* @param remainingAccounts Optional existing array of accounts
|
|
45
43
|
* to append to.
|
|
46
44
|
**/
|
|
47
|
-
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[]): {
|
|
48
46
|
packedInputCompressedAccounts: PackedCompressedAccountWithMerkleContext[];
|
|
49
47
|
packedOutputCompressedAccounts: OutputCompressedAccountWithPackedContext[];
|
|
50
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[];
|
|
@@ -169,11 +234,11 @@ export declare const CompressedAccountResult: Struct<{
|
|
|
169
234
|
discriminator: BN;
|
|
170
235
|
} | null;
|
|
171
236
|
lamports: BN;
|
|
237
|
+
tree: PublicKey;
|
|
172
238
|
address: number[] | null;
|
|
173
239
|
hash: BN;
|
|
174
240
|
owner: PublicKey;
|
|
175
241
|
leafIndex: number;
|
|
176
|
-
tree: PublicKey;
|
|
177
242
|
seq: BN | null;
|
|
178
243
|
slotCreated: BN;
|
|
179
244
|
}, {
|
|
@@ -226,11 +291,11 @@ export declare const CompressedTokenAccountResult: Struct<{
|
|
|
226
291
|
discriminator: BN;
|
|
227
292
|
} | null;
|
|
228
293
|
lamports: BN;
|
|
294
|
+
tree: PublicKey;
|
|
229
295
|
address: number[] | null;
|
|
230
296
|
hash: BN;
|
|
231
297
|
owner: PublicKey;
|
|
232
298
|
leafIndex: number;
|
|
233
|
-
tree: PublicKey;
|
|
234
299
|
seq: BN | null;
|
|
235
300
|
slotCreated: BN;
|
|
236
301
|
};
|
|
@@ -255,11 +320,11 @@ export declare const CompressedTokenAccountResult: Struct<{
|
|
|
255
320
|
discriminator: BN;
|
|
256
321
|
} | null;
|
|
257
322
|
lamports: BN;
|
|
323
|
+
tree: PublicKey;
|
|
258
324
|
address: number[] | null;
|
|
259
325
|
hash: BN;
|
|
260
326
|
owner: PublicKey;
|
|
261
327
|
leafIndex: number;
|
|
262
|
-
tree: PublicKey;
|
|
263
328
|
seq: BN | null;
|
|
264
329
|
slotCreated: BN;
|
|
265
330
|
}, {
|
|
@@ -293,11 +358,11 @@ export declare const MultipleCompressedAccountsResult: Struct<{
|
|
|
293
358
|
discriminator: BN;
|
|
294
359
|
} | null;
|
|
295
360
|
lamports: BN;
|
|
361
|
+
tree: PublicKey;
|
|
296
362
|
address: number[] | null;
|
|
297
363
|
hash: BN;
|
|
298
364
|
owner: PublicKey;
|
|
299
365
|
leafIndex: number;
|
|
300
|
-
tree: PublicKey;
|
|
301
366
|
seq: BN | null;
|
|
302
367
|
slotCreated: BN;
|
|
303
368
|
}[];
|
|
@@ -309,11 +374,11 @@ export declare const MultipleCompressedAccountsResult: Struct<{
|
|
|
309
374
|
discriminator: BN;
|
|
310
375
|
} | null;
|
|
311
376
|
lamports: BN;
|
|
377
|
+
tree: PublicKey;
|
|
312
378
|
address: number[] | null;
|
|
313
379
|
hash: BN;
|
|
314
380
|
owner: PublicKey;
|
|
315
381
|
leafIndex: number;
|
|
316
|
-
tree: PublicKey;
|
|
317
382
|
seq: BN | null;
|
|
318
383
|
slotCreated: BN;
|
|
319
384
|
}[], Struct<{
|
|
@@ -323,11 +388,11 @@ export declare const MultipleCompressedAccountsResult: Struct<{
|
|
|
323
388
|
discriminator: BN;
|
|
324
389
|
} | null;
|
|
325
390
|
lamports: BN;
|
|
391
|
+
tree: PublicKey;
|
|
326
392
|
address: number[] | null;
|
|
327
393
|
hash: BN;
|
|
328
394
|
owner: PublicKey;
|
|
329
395
|
leafIndex: number;
|
|
330
|
-
tree: PublicKey;
|
|
331
396
|
seq: BN | null;
|
|
332
397
|
slotCreated: BN;
|
|
333
398
|
}, {
|
|
@@ -361,11 +426,11 @@ export declare const CompressedAccountsByOwnerResult: Struct<{
|
|
|
361
426
|
discriminator: BN;
|
|
362
427
|
} | null;
|
|
363
428
|
lamports: BN;
|
|
429
|
+
tree: PublicKey;
|
|
364
430
|
address: number[] | null;
|
|
365
431
|
hash: BN;
|
|
366
432
|
owner: PublicKey;
|
|
367
433
|
leafIndex: number;
|
|
368
|
-
tree: PublicKey;
|
|
369
434
|
seq: BN | null;
|
|
370
435
|
slotCreated: BN;
|
|
371
436
|
}[];
|
|
@@ -378,11 +443,11 @@ export declare const CompressedAccountsByOwnerResult: Struct<{
|
|
|
378
443
|
discriminator: BN;
|
|
379
444
|
} | null;
|
|
380
445
|
lamports: BN;
|
|
446
|
+
tree: PublicKey;
|
|
381
447
|
address: number[] | null;
|
|
382
448
|
hash: BN;
|
|
383
449
|
owner: PublicKey;
|
|
384
450
|
leafIndex: number;
|
|
385
|
-
tree: PublicKey;
|
|
386
451
|
seq: BN | null;
|
|
387
452
|
slotCreated: BN;
|
|
388
453
|
}[], Struct<{
|
|
@@ -392,11 +457,11 @@ export declare const CompressedAccountsByOwnerResult: Struct<{
|
|
|
392
457
|
discriminator: BN;
|
|
393
458
|
} | null;
|
|
394
459
|
lamports: BN;
|
|
460
|
+
tree: PublicKey;
|
|
395
461
|
address: number[] | null;
|
|
396
462
|
hash: BN;
|
|
397
463
|
owner: PublicKey;
|
|
398
464
|
leafIndex: number;
|
|
399
|
-
tree: PublicKey;
|
|
400
465
|
seq: BN | null;
|
|
401
466
|
slotCreated: BN;
|
|
402
467
|
}, {
|
|
@@ -439,11 +504,11 @@ export declare const CompressedTokenAccountsByOwnerOrDelegateResult: Struct<{
|
|
|
439
504
|
discriminator: BN;
|
|
440
505
|
} | null;
|
|
441
506
|
lamports: BN;
|
|
507
|
+
tree: PublicKey;
|
|
442
508
|
address: number[] | null;
|
|
443
509
|
hash: BN;
|
|
444
510
|
owner: PublicKey;
|
|
445
511
|
leafIndex: number;
|
|
446
|
-
tree: PublicKey;
|
|
447
512
|
seq: BN | null;
|
|
448
513
|
slotCreated: BN;
|
|
449
514
|
};
|
|
@@ -465,11 +530,11 @@ export declare const CompressedTokenAccountsByOwnerOrDelegateResult: Struct<{
|
|
|
465
530
|
discriminator: BN;
|
|
466
531
|
} | null;
|
|
467
532
|
lamports: BN;
|
|
533
|
+
tree: PublicKey;
|
|
468
534
|
address: number[] | null;
|
|
469
535
|
hash: BN;
|
|
470
536
|
owner: PublicKey;
|
|
471
537
|
leafIndex: number;
|
|
472
|
-
tree: PublicKey;
|
|
473
538
|
seq: BN | null;
|
|
474
539
|
slotCreated: BN;
|
|
475
540
|
};
|
|
@@ -488,11 +553,11 @@ export declare const CompressedTokenAccountsByOwnerOrDelegateResult: Struct<{
|
|
|
488
553
|
discriminator: BN;
|
|
489
554
|
} | null;
|
|
490
555
|
lamports: BN;
|
|
556
|
+
tree: PublicKey;
|
|
491
557
|
address: number[] | null;
|
|
492
558
|
hash: BN;
|
|
493
559
|
owner: PublicKey;
|
|
494
560
|
leafIndex: number;
|
|
495
|
-
tree: PublicKey;
|
|
496
561
|
seq: BN | null;
|
|
497
562
|
slotCreated: BN;
|
|
498
563
|
};
|
|
@@ -517,11 +582,11 @@ export declare const CompressedTokenAccountsByOwnerOrDelegateResult: Struct<{
|
|
|
517
582
|
discriminator: BN;
|
|
518
583
|
} | null;
|
|
519
584
|
lamports: BN;
|
|
585
|
+
tree: PublicKey;
|
|
520
586
|
address: number[] | null;
|
|
521
587
|
hash: BN;
|
|
522
588
|
owner: PublicKey;
|
|
523
589
|
leafIndex: number;
|
|
524
|
-
tree: PublicKey;
|
|
525
590
|
seq: BN | null;
|
|
526
591
|
slotCreated: BN;
|
|
527
592
|
}, {
|
|
@@ -842,11 +907,11 @@ export declare const CompressedTransactionResult: Struct<{
|
|
|
842
907
|
discriminator: BN;
|
|
843
908
|
} | null;
|
|
844
909
|
lamports: BN;
|
|
910
|
+
tree: PublicKey;
|
|
845
911
|
address: number[] | null;
|
|
846
912
|
hash: BN;
|
|
847
913
|
owner: PublicKey;
|
|
848
914
|
leafIndex: number;
|
|
849
|
-
tree: PublicKey;
|
|
850
915
|
seq: BN | null;
|
|
851
916
|
slotCreated: BN;
|
|
852
917
|
};
|
|
@@ -866,11 +931,11 @@ export declare const CompressedTransactionResult: Struct<{
|
|
|
866
931
|
discriminator: BN;
|
|
867
932
|
} | null;
|
|
868
933
|
lamports: BN;
|
|
934
|
+
tree: PublicKey;
|
|
869
935
|
address: number[] | null;
|
|
870
936
|
hash: BN;
|
|
871
937
|
owner: PublicKey;
|
|
872
938
|
leafIndex: number;
|
|
873
|
-
tree: PublicKey;
|
|
874
939
|
seq: BN | null;
|
|
875
940
|
slotCreated: BN;
|
|
876
941
|
};
|
|
@@ -894,11 +959,11 @@ export declare const CompressedTransactionResult: Struct<{
|
|
|
894
959
|
discriminator: BN;
|
|
895
960
|
} | null;
|
|
896
961
|
lamports: BN;
|
|
962
|
+
tree: PublicKey;
|
|
897
963
|
address: number[] | null;
|
|
898
964
|
hash: BN;
|
|
899
965
|
owner: PublicKey;
|
|
900
966
|
leafIndex: number;
|
|
901
|
-
tree: PublicKey;
|
|
902
967
|
seq: BN | null;
|
|
903
968
|
slotCreated: BN;
|
|
904
969
|
};
|
|
@@ -918,11 +983,11 @@ export declare const CompressedTransactionResult: Struct<{
|
|
|
918
983
|
discriminator: BN;
|
|
919
984
|
} | null;
|
|
920
985
|
lamports: BN;
|
|
986
|
+
tree: PublicKey;
|
|
921
987
|
address: number[] | null;
|
|
922
988
|
hash: BN;
|
|
923
989
|
owner: PublicKey;
|
|
924
990
|
leafIndex: number;
|
|
925
|
-
tree: PublicKey;
|
|
926
991
|
seq: BN | null;
|
|
927
992
|
slotCreated: BN;
|
|
928
993
|
};
|
|
@@ -943,11 +1008,11 @@ export declare const CompressedTransactionResult: Struct<{
|
|
|
943
1008
|
discriminator: BN;
|
|
944
1009
|
} | null;
|
|
945
1010
|
lamports: BN;
|
|
1011
|
+
tree: PublicKey;
|
|
946
1012
|
address: number[] | null;
|
|
947
1013
|
hash: BN;
|
|
948
1014
|
owner: PublicKey;
|
|
949
1015
|
leafIndex: number;
|
|
950
|
-
tree: PublicKey;
|
|
951
1016
|
seq: BN | null;
|
|
952
1017
|
slotCreated: BN;
|
|
953
1018
|
};
|
|
@@ -966,11 +1031,11 @@ export declare const CompressedTransactionResult: Struct<{
|
|
|
966
1031
|
discriminator: BN;
|
|
967
1032
|
} | null;
|
|
968
1033
|
lamports: BN;
|
|
1034
|
+
tree: PublicKey;
|
|
969
1035
|
address: number[] | null;
|
|
970
1036
|
hash: BN;
|
|
971
1037
|
owner: PublicKey;
|
|
972
1038
|
leafIndex: number;
|
|
973
|
-
tree: PublicKey;
|
|
974
1039
|
seq: BN | null;
|
|
975
1040
|
slotCreated: BN;
|
|
976
1041
|
};
|
|
@@ -989,11 +1054,11 @@ export declare const CompressedTransactionResult: Struct<{
|
|
|
989
1054
|
discriminator: BN;
|
|
990
1055
|
} | null;
|
|
991
1056
|
lamports: BN;
|
|
1057
|
+
tree: PublicKey;
|
|
992
1058
|
address: number[] | null;
|
|
993
1059
|
hash: BN;
|
|
994
1060
|
owner: PublicKey;
|
|
995
1061
|
leafIndex: number;
|
|
996
|
-
tree: PublicKey;
|
|
997
1062
|
seq: BN | null;
|
|
998
1063
|
slotCreated: BN;
|
|
999
1064
|
}, {
|
|
@@ -1037,11 +1102,11 @@ export declare const CompressedTransactionResult: Struct<{
|
|
|
1037
1102
|
discriminator: BN;
|
|
1038
1103
|
} | null;
|
|
1039
1104
|
lamports: BN;
|
|
1105
|
+
tree: PublicKey;
|
|
1040
1106
|
address: number[] | null;
|
|
1041
1107
|
hash: BN;
|
|
1042
1108
|
owner: PublicKey;
|
|
1043
1109
|
leafIndex: number;
|
|
1044
|
-
tree: PublicKey;
|
|
1045
1110
|
seq: BN | null;
|
|
1046
1111
|
slotCreated: BN;
|
|
1047
1112
|
};
|
|
@@ -1060,11 +1125,11 @@ export declare const CompressedTransactionResult: Struct<{
|
|
|
1060
1125
|
discriminator: BN;
|
|
1061
1126
|
} | null;
|
|
1062
1127
|
lamports: BN;
|
|
1128
|
+
tree: PublicKey;
|
|
1063
1129
|
address: number[] | null;
|
|
1064
1130
|
hash: BN;
|
|
1065
1131
|
owner: PublicKey;
|
|
1066
1132
|
leafIndex: number;
|
|
1067
|
-
tree: PublicKey;
|
|
1068
1133
|
seq: BN | null;
|
|
1069
1134
|
slotCreated: BN;
|
|
1070
1135
|
};
|
|
@@ -1083,11 +1148,11 @@ export declare const CompressedTransactionResult: Struct<{
|
|
|
1083
1148
|
discriminator: BN;
|
|
1084
1149
|
} | null;
|
|
1085
1150
|
lamports: BN;
|
|
1151
|
+
tree: PublicKey;
|
|
1086
1152
|
address: number[] | null;
|
|
1087
1153
|
hash: 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[]>>;
|