@thru/programs 0.2.30 → 0.2.31
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/amm/index.cjs +6424 -0
- package/dist/amm/index.cjs.map +1 -0
- package/dist/amm/index.d.cts +1424 -0
- package/dist/amm/index.d.ts +1424 -0
- package/dist/amm/index.js +6360 -0
- package/dist/amm/index.js.map +1 -0
- package/dist/chunk-P5OABVJI.js +28 -0
- package/dist/chunk-P5OABVJI.js.map +1 -0
- package/dist/multicall/index.cjs +1 -1
- package/dist/multicall/index.cjs.map +1 -1
- package/dist/multicall/index.d.cts +2 -2
- package/dist/multicall/index.d.ts +2 -2
- package/dist/multicall/index.js +1 -1
- package/dist/multicall/index.js.map +1 -1
- package/dist/passkey-manager/index.cjs +33 -27
- package/dist/passkey-manager/index.cjs.map +1 -1
- package/dist/passkey-manager/index.d.cts +4 -3
- package/dist/passkey-manager/index.d.ts +4 -3
- package/dist/passkey-manager/index.js +9 -28
- package/dist/passkey-manager/index.js.map +1 -1
- package/dist/token/index.cjs +1760 -275
- package/dist/token/index.cjs.map +1 -1
- package/dist/token/index.d.cts +124 -20
- package/dist/token/index.d.ts +124 -20
- package/dist/token/index.js +1760 -275
- package/dist/token/index.js.map +1 -1
- package/package.json +9 -2
- package/src/amm/abi/thru/common/primitives/types.ts +2269 -0
- package/src/amm/abi/thru/program/amm/types.ts +5621 -0
- package/src/amm/index.test.ts +255 -0
- package/src/amm/index.ts +434 -0
- package/src/helpers/bytes.ts +25 -0
- package/src/multicall/abi/thru/common/primitives/types.ts +5 -6
- package/src/multicall/abi/thru/program/multicall/types.ts +1 -2
- package/src/passkey-manager/abi/thru/blockchain/state_proof/types.ts +0 -1
- package/src/passkey-manager/abi/thru/common/primitives/types.ts +0 -1
- package/src/passkey-manager/abi/thru/program/passkey_manager/types.ts +4 -5
- package/src/passkey-manager/encoding.ts +2 -26
- package/src/token/abi/thru/blockchain/state_proof/types.ts +101 -21
- package/src/token/abi/thru/common/primitives/types.ts +1295 -167
- package/src/token/abi/thru/program/token/types.ts +647 -237
- package/tsup.config.ts +1 -0
|
@@ -0,0 +1,1424 @@
|
|
|
1
|
+
import { Account } from '@thru/sdk';
|
|
2
|
+
import { Thru } from '@thru/sdk/client';
|
|
3
|
+
|
|
4
|
+
type __TnValidateResult$1 = {
|
|
5
|
+
ok: boolean;
|
|
6
|
+
code?: string;
|
|
7
|
+
consumed?: bigint;
|
|
8
|
+
params?: Record<string, bigint>;
|
|
9
|
+
};
|
|
10
|
+
declare class Pubkey {
|
|
11
|
+
private buffer;
|
|
12
|
+
private view;
|
|
13
|
+
private constructor();
|
|
14
|
+
static __tnCreateView(buffer: Uint8Array, opts?: {
|
|
15
|
+
fieldContext?: Record<string, number | bigint>;
|
|
16
|
+
}): Pubkey;
|
|
17
|
+
static builder(): PubkeyBuilder;
|
|
18
|
+
static fromBuilder(builder: PubkeyBuilder): Pubkey | null;
|
|
19
|
+
get_bytes(): number[];
|
|
20
|
+
set_bytes(value: number[]): void;
|
|
21
|
+
get bytes(): number[];
|
|
22
|
+
set bytes(value: number[]);
|
|
23
|
+
private static __tnFootprintInternal;
|
|
24
|
+
private static __tnValidateInternal;
|
|
25
|
+
static __tnInvokeFootprint(__tnParams: Record<string, bigint>): bigint;
|
|
26
|
+
static __tnInvokeValidate(buffer: Uint8Array, __tnParams: Record<string, bigint>): __TnValidateResult$1;
|
|
27
|
+
static footprintIr(): bigint;
|
|
28
|
+
static footprint(): number;
|
|
29
|
+
static validate(buffer: Uint8Array, _opts?: {
|
|
30
|
+
params?: never;
|
|
31
|
+
}): {
|
|
32
|
+
ok: boolean;
|
|
33
|
+
code?: string;
|
|
34
|
+
consumed?: number;
|
|
35
|
+
};
|
|
36
|
+
static from_array(buffer: Uint8Array): Pubkey | null;
|
|
37
|
+
}
|
|
38
|
+
declare class PubkeyBuilder {
|
|
39
|
+
private buffer;
|
|
40
|
+
private view;
|
|
41
|
+
constructor();
|
|
42
|
+
set_bytes(values: number[]): this;
|
|
43
|
+
build(): Uint8Array;
|
|
44
|
+
buildInto(target: Uint8Array, offset?: number): Uint8Array;
|
|
45
|
+
finish(): Pubkey;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
type __TnValidateResult = {
|
|
49
|
+
ok: boolean;
|
|
50
|
+
code?: string;
|
|
51
|
+
consumed?: bigint;
|
|
52
|
+
params?: Record<string, bigint>;
|
|
53
|
+
};
|
|
54
|
+
type __TnBuilderLike = {
|
|
55
|
+
build(): Uint8Array;
|
|
56
|
+
};
|
|
57
|
+
type __TnVariantDescriptor = {
|
|
58
|
+
readonly name: string;
|
|
59
|
+
readonly tag: number;
|
|
60
|
+
readonly payloadSize: number | null;
|
|
61
|
+
readonly payloadType?: string;
|
|
62
|
+
readonly createPayloadBuilder?: () => unknown | null;
|
|
63
|
+
};
|
|
64
|
+
type __TnVariantSelectorResult<Parent> = {
|
|
65
|
+
select(name: string): {
|
|
66
|
+
writePayload(payload: Uint8Array | __TnBuilderLike): {
|
|
67
|
+
finish(): Parent;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
finish(): Parent;
|
|
71
|
+
};
|
|
72
|
+
type __TnFamWriterResult<Parent> = {
|
|
73
|
+
write(payload: Uint8Array | __TnBuilderLike): {
|
|
74
|
+
finish(): Parent;
|
|
75
|
+
};
|
|
76
|
+
finish(): Parent;
|
|
77
|
+
};
|
|
78
|
+
declare class AmmAddLiquidityInstruction {
|
|
79
|
+
private buffer;
|
|
80
|
+
private view;
|
|
81
|
+
private constructor();
|
|
82
|
+
static __tnCreateView(buffer: Uint8Array, opts?: {
|
|
83
|
+
fieldContext?: Record<string, number | bigint>;
|
|
84
|
+
}): AmmAddLiquidityInstruction;
|
|
85
|
+
static builder(): AmmAddLiquidityInstructionBuilder;
|
|
86
|
+
static fromBuilder(builder: AmmAddLiquidityInstructionBuilder): AmmAddLiquidityInstruction | null;
|
|
87
|
+
get_pool_account_idx(): number;
|
|
88
|
+
set_pool_account_idx(value: number): void;
|
|
89
|
+
get pool_account_idx(): number;
|
|
90
|
+
set pool_account_idx(value: number);
|
|
91
|
+
get_depositor_account_idx(): number;
|
|
92
|
+
set_depositor_account_idx(value: number): void;
|
|
93
|
+
get depositor_account_idx(): number;
|
|
94
|
+
set depositor_account_idx(value: number);
|
|
95
|
+
get_depositor_token_one_account_idx(): number;
|
|
96
|
+
set_depositor_token_one_account_idx(value: number): void;
|
|
97
|
+
get depositor_token_one_account_idx(): number;
|
|
98
|
+
set depositor_token_one_account_idx(value: number);
|
|
99
|
+
get_depositor_token_two_account_idx(): number;
|
|
100
|
+
set_depositor_token_two_account_idx(value: number): void;
|
|
101
|
+
get depositor_token_two_account_idx(): number;
|
|
102
|
+
set depositor_token_two_account_idx(value: number);
|
|
103
|
+
get_depositor_lp_account_idx(): number;
|
|
104
|
+
set_depositor_lp_account_idx(value: number): void;
|
|
105
|
+
get depositor_lp_account_idx(): number;
|
|
106
|
+
set depositor_lp_account_idx(value: number);
|
|
107
|
+
get_vault_one_account_idx(): number;
|
|
108
|
+
set_vault_one_account_idx(value: number): void;
|
|
109
|
+
get vault_one_account_idx(): number;
|
|
110
|
+
set vault_one_account_idx(value: number);
|
|
111
|
+
get_vault_two_account_idx(): number;
|
|
112
|
+
set_vault_two_account_idx(value: number): void;
|
|
113
|
+
get vault_two_account_idx(): number;
|
|
114
|
+
set vault_two_account_idx(value: number);
|
|
115
|
+
get_lp_mint_account_idx(): number;
|
|
116
|
+
set_lp_mint_account_idx(value: number): void;
|
|
117
|
+
get lp_mint_account_idx(): number;
|
|
118
|
+
set lp_mint_account_idx(value: number);
|
|
119
|
+
get_token_program_account_idx(): number;
|
|
120
|
+
set_token_program_account_idx(value: number): void;
|
|
121
|
+
get token_program_account_idx(): number;
|
|
122
|
+
set token_program_account_idx(value: number);
|
|
123
|
+
get_max_amount_mint_one(): bigint;
|
|
124
|
+
set_max_amount_mint_one(value: bigint): void;
|
|
125
|
+
get max_amount_mint_one(): bigint;
|
|
126
|
+
set max_amount_mint_one(value: bigint);
|
|
127
|
+
get_max_amount_mint_two(): bigint;
|
|
128
|
+
set_max_amount_mint_two(value: bigint): void;
|
|
129
|
+
get max_amount_mint_two(): bigint;
|
|
130
|
+
set max_amount_mint_two(value: bigint);
|
|
131
|
+
private static __tnFootprintInternal;
|
|
132
|
+
private static __tnValidateInternal;
|
|
133
|
+
static __tnInvokeFootprint(__tnParams: Record<string, bigint>): bigint;
|
|
134
|
+
static __tnInvokeValidate(buffer: Uint8Array, __tnParams: Record<string, bigint>): __TnValidateResult;
|
|
135
|
+
static footprintIr(): bigint;
|
|
136
|
+
static footprint(): number;
|
|
137
|
+
static validate(buffer: Uint8Array, _opts?: {
|
|
138
|
+
params?: never;
|
|
139
|
+
}): {
|
|
140
|
+
ok: boolean;
|
|
141
|
+
code?: string;
|
|
142
|
+
consumed?: number;
|
|
143
|
+
};
|
|
144
|
+
static new(pool_account_idx: number, depositor_account_idx: number, depositor_token_one_account_idx: number, depositor_token_two_account_idx: number, depositor_lp_account_idx: number, vault_one_account_idx: number, vault_two_account_idx: number, lp_mint_account_idx: number, token_program_account_idx: number, max_amount_mint_one: bigint, max_amount_mint_two: bigint): AmmAddLiquidityInstruction;
|
|
145
|
+
static from_array(buffer: Uint8Array): AmmAddLiquidityInstruction | null;
|
|
146
|
+
}
|
|
147
|
+
declare class AmmAddLiquidityInstructionBuilder {
|
|
148
|
+
private buffer;
|
|
149
|
+
private view;
|
|
150
|
+
constructor();
|
|
151
|
+
set_pool_account_idx(value: number): this;
|
|
152
|
+
set_depositor_account_idx(value: number): this;
|
|
153
|
+
set_depositor_token_one_account_idx(value: number): this;
|
|
154
|
+
set_depositor_token_two_account_idx(value: number): this;
|
|
155
|
+
set_depositor_lp_account_idx(value: number): this;
|
|
156
|
+
set_vault_one_account_idx(value: number): this;
|
|
157
|
+
set_vault_two_account_idx(value: number): this;
|
|
158
|
+
set_lp_mint_account_idx(value: number): this;
|
|
159
|
+
set_token_program_account_idx(value: number): this;
|
|
160
|
+
set_max_amount_mint_one(value: bigint): this;
|
|
161
|
+
set_max_amount_mint_two(value: bigint): this;
|
|
162
|
+
build(): Uint8Array;
|
|
163
|
+
buildInto(target: Uint8Array, offset?: number): Uint8Array;
|
|
164
|
+
finish(): AmmAddLiquidityInstruction;
|
|
165
|
+
}
|
|
166
|
+
declare class AmmError {
|
|
167
|
+
private buffer;
|
|
168
|
+
private view;
|
|
169
|
+
private constructor();
|
|
170
|
+
static __tnCreateView(buffer: Uint8Array, opts?: {
|
|
171
|
+
fieldContext?: Record<string, number | bigint>;
|
|
172
|
+
}): AmmError;
|
|
173
|
+
static builder(): AmmErrorBuilder;
|
|
174
|
+
static fromBuilder(builder: AmmErrorBuilder): AmmError | null;
|
|
175
|
+
get_code(): bigint;
|
|
176
|
+
set_code(value: bigint): void;
|
|
177
|
+
get code(): bigint;
|
|
178
|
+
set code(value: bigint);
|
|
179
|
+
private static __tnFootprintInternal;
|
|
180
|
+
private static __tnValidateInternal;
|
|
181
|
+
static __tnInvokeFootprint(__tnParams: Record<string, bigint>): bigint;
|
|
182
|
+
static __tnInvokeValidate(buffer: Uint8Array, __tnParams: Record<string, bigint>): __TnValidateResult;
|
|
183
|
+
static footprintIr(): bigint;
|
|
184
|
+
static footprint(): number;
|
|
185
|
+
static validate(buffer: Uint8Array, _opts?: {
|
|
186
|
+
params?: never;
|
|
187
|
+
}): {
|
|
188
|
+
ok: boolean;
|
|
189
|
+
code?: string;
|
|
190
|
+
consumed?: number;
|
|
191
|
+
};
|
|
192
|
+
static new(code: bigint): AmmError;
|
|
193
|
+
static from_array(buffer: Uint8Array): AmmError | null;
|
|
194
|
+
}
|
|
195
|
+
declare class AmmErrorBuilder {
|
|
196
|
+
private buffer;
|
|
197
|
+
private view;
|
|
198
|
+
constructor();
|
|
199
|
+
set_code(value: bigint): this;
|
|
200
|
+
build(): Uint8Array;
|
|
201
|
+
buildInto(target: Uint8Array, offset?: number): Uint8Array;
|
|
202
|
+
finish(): AmmError;
|
|
203
|
+
}
|
|
204
|
+
declare class AmmSwapInstruction {
|
|
205
|
+
private buffer;
|
|
206
|
+
private view;
|
|
207
|
+
private constructor();
|
|
208
|
+
static __tnCreateView(buffer: Uint8Array, opts?: {
|
|
209
|
+
fieldContext?: Record<string, number | bigint>;
|
|
210
|
+
}): AmmSwapInstruction;
|
|
211
|
+
static builder(): AmmSwapInstructionBuilder;
|
|
212
|
+
static fromBuilder(builder: AmmSwapInstructionBuilder): AmmSwapInstruction | null;
|
|
213
|
+
get_pool_account_idx(): number;
|
|
214
|
+
set_pool_account_idx(value: number): void;
|
|
215
|
+
get pool_account_idx(): number;
|
|
216
|
+
set pool_account_idx(value: number);
|
|
217
|
+
get_user_transfer_authority_idx(): number;
|
|
218
|
+
set_user_transfer_authority_idx(value: number): void;
|
|
219
|
+
get user_transfer_authority_idx(): number;
|
|
220
|
+
set user_transfer_authority_idx(value: number);
|
|
221
|
+
get_user_input_account_idx(): number;
|
|
222
|
+
set_user_input_account_idx(value: number): void;
|
|
223
|
+
get user_input_account_idx(): number;
|
|
224
|
+
set user_input_account_idx(value: number);
|
|
225
|
+
get_user_output_account_idx(): number;
|
|
226
|
+
set_user_output_account_idx(value: number): void;
|
|
227
|
+
get user_output_account_idx(): number;
|
|
228
|
+
set user_output_account_idx(value: number);
|
|
229
|
+
get_vault_input_account_idx(): number;
|
|
230
|
+
set_vault_input_account_idx(value: number): void;
|
|
231
|
+
get vault_input_account_idx(): number;
|
|
232
|
+
set vault_input_account_idx(value: number);
|
|
233
|
+
get_vault_output_account_idx(): number;
|
|
234
|
+
set_vault_output_account_idx(value: number): void;
|
|
235
|
+
get vault_output_account_idx(): number;
|
|
236
|
+
set vault_output_account_idx(value: number);
|
|
237
|
+
get_lp_mint_account_idx(): number;
|
|
238
|
+
set_lp_mint_account_idx(value: number): void;
|
|
239
|
+
get lp_mint_account_idx(): number;
|
|
240
|
+
set lp_mint_account_idx(value: number);
|
|
241
|
+
get_token_program_account_idx(): number;
|
|
242
|
+
set_token_program_account_idx(value: number): void;
|
|
243
|
+
get token_program_account_idx(): number;
|
|
244
|
+
set token_program_account_idx(value: number);
|
|
245
|
+
get_amount_in(): bigint;
|
|
246
|
+
set_amount_in(value: bigint): void;
|
|
247
|
+
get amount_in(): bigint;
|
|
248
|
+
set amount_in(value: bigint);
|
|
249
|
+
private static __tnFootprintInternal;
|
|
250
|
+
private static __tnValidateInternal;
|
|
251
|
+
static __tnInvokeFootprint(__tnParams: Record<string, bigint>): bigint;
|
|
252
|
+
static __tnInvokeValidate(buffer: Uint8Array, __tnParams: Record<string, bigint>): __TnValidateResult;
|
|
253
|
+
static footprintIr(): bigint;
|
|
254
|
+
static footprint(): number;
|
|
255
|
+
static validate(buffer: Uint8Array, _opts?: {
|
|
256
|
+
params?: never;
|
|
257
|
+
}): {
|
|
258
|
+
ok: boolean;
|
|
259
|
+
code?: string;
|
|
260
|
+
consumed?: number;
|
|
261
|
+
};
|
|
262
|
+
static new(pool_account_idx: number, user_transfer_authority_idx: number, user_input_account_idx: number, user_output_account_idx: number, vault_input_account_idx: number, vault_output_account_idx: number, lp_mint_account_idx: number, token_program_account_idx: number, amount_in: bigint): AmmSwapInstruction;
|
|
263
|
+
static from_array(buffer: Uint8Array): AmmSwapInstruction | null;
|
|
264
|
+
}
|
|
265
|
+
declare class AmmSwapInstructionBuilder {
|
|
266
|
+
private buffer;
|
|
267
|
+
private view;
|
|
268
|
+
constructor();
|
|
269
|
+
set_pool_account_idx(value: number): this;
|
|
270
|
+
set_user_transfer_authority_idx(value: number): this;
|
|
271
|
+
set_user_input_account_idx(value: number): this;
|
|
272
|
+
set_user_output_account_idx(value: number): this;
|
|
273
|
+
set_vault_input_account_idx(value: number): this;
|
|
274
|
+
set_vault_output_account_idx(value: number): this;
|
|
275
|
+
set_lp_mint_account_idx(value: number): this;
|
|
276
|
+
set_token_program_account_idx(value: number): this;
|
|
277
|
+
set_amount_in(value: bigint): this;
|
|
278
|
+
build(): Uint8Array;
|
|
279
|
+
buildInto(target: Uint8Array, offset?: number): Uint8Array;
|
|
280
|
+
finish(): AmmSwapInstruction;
|
|
281
|
+
}
|
|
282
|
+
declare class AmmWithdrawLiquidityInstruction {
|
|
283
|
+
private buffer;
|
|
284
|
+
private view;
|
|
285
|
+
private constructor();
|
|
286
|
+
static __tnCreateView(buffer: Uint8Array, opts?: {
|
|
287
|
+
fieldContext?: Record<string, number | bigint>;
|
|
288
|
+
}): AmmWithdrawLiquidityInstruction;
|
|
289
|
+
static builder(): AmmWithdrawLiquidityInstructionBuilder;
|
|
290
|
+
static fromBuilder(builder: AmmWithdrawLiquidityInstructionBuilder): AmmWithdrawLiquidityInstruction | null;
|
|
291
|
+
get_pool_account_idx(): number;
|
|
292
|
+
set_pool_account_idx(value: number): void;
|
|
293
|
+
get pool_account_idx(): number;
|
|
294
|
+
set pool_account_idx(value: number);
|
|
295
|
+
get_withdrawer_account_idx(): number;
|
|
296
|
+
set_withdrawer_account_idx(value: number): void;
|
|
297
|
+
get withdrawer_account_idx(): number;
|
|
298
|
+
set withdrawer_account_idx(value: number);
|
|
299
|
+
get_withdrawer_token_one_account_idx(): number;
|
|
300
|
+
set_withdrawer_token_one_account_idx(value: number): void;
|
|
301
|
+
get withdrawer_token_one_account_idx(): number;
|
|
302
|
+
set withdrawer_token_one_account_idx(value: number);
|
|
303
|
+
get_withdrawer_token_two_account_idx(): number;
|
|
304
|
+
set_withdrawer_token_two_account_idx(value: number): void;
|
|
305
|
+
get withdrawer_token_two_account_idx(): number;
|
|
306
|
+
set withdrawer_token_two_account_idx(value: number);
|
|
307
|
+
get_withdrawer_lp_account_idx(): number;
|
|
308
|
+
set_withdrawer_lp_account_idx(value: number): void;
|
|
309
|
+
get withdrawer_lp_account_idx(): number;
|
|
310
|
+
set withdrawer_lp_account_idx(value: number);
|
|
311
|
+
get_vault_one_account_idx(): number;
|
|
312
|
+
set_vault_one_account_idx(value: number): void;
|
|
313
|
+
get vault_one_account_idx(): number;
|
|
314
|
+
set vault_one_account_idx(value: number);
|
|
315
|
+
get_vault_two_account_idx(): number;
|
|
316
|
+
set_vault_two_account_idx(value: number): void;
|
|
317
|
+
get vault_two_account_idx(): number;
|
|
318
|
+
set vault_two_account_idx(value: number);
|
|
319
|
+
get_lp_mint_account_idx(): number;
|
|
320
|
+
set_lp_mint_account_idx(value: number): void;
|
|
321
|
+
get lp_mint_account_idx(): number;
|
|
322
|
+
set lp_mint_account_idx(value: number);
|
|
323
|
+
get_token_program_account_idx(): number;
|
|
324
|
+
set_token_program_account_idx(value: number): void;
|
|
325
|
+
get token_program_account_idx(): number;
|
|
326
|
+
set token_program_account_idx(value: number);
|
|
327
|
+
get_lp_amount(): bigint;
|
|
328
|
+
set_lp_amount(value: bigint): void;
|
|
329
|
+
get lp_amount(): bigint;
|
|
330
|
+
set lp_amount(value: bigint);
|
|
331
|
+
private static __tnFootprintInternal;
|
|
332
|
+
private static __tnValidateInternal;
|
|
333
|
+
static __tnInvokeFootprint(__tnParams: Record<string, bigint>): bigint;
|
|
334
|
+
static __tnInvokeValidate(buffer: Uint8Array, __tnParams: Record<string, bigint>): __TnValidateResult;
|
|
335
|
+
static footprintIr(): bigint;
|
|
336
|
+
static footprint(): number;
|
|
337
|
+
static validate(buffer: Uint8Array, _opts?: {
|
|
338
|
+
params?: never;
|
|
339
|
+
}): {
|
|
340
|
+
ok: boolean;
|
|
341
|
+
code?: string;
|
|
342
|
+
consumed?: number;
|
|
343
|
+
};
|
|
344
|
+
static new(pool_account_idx: number, withdrawer_account_idx: number, withdrawer_token_one_account_idx: number, withdrawer_token_two_account_idx: number, withdrawer_lp_account_idx: number, vault_one_account_idx: number, vault_two_account_idx: number, lp_mint_account_idx: number, token_program_account_idx: number, lp_amount: bigint): AmmWithdrawLiquidityInstruction;
|
|
345
|
+
static from_array(buffer: Uint8Array): AmmWithdrawLiquidityInstruction | null;
|
|
346
|
+
}
|
|
347
|
+
declare class AmmWithdrawLiquidityInstructionBuilder {
|
|
348
|
+
private buffer;
|
|
349
|
+
private view;
|
|
350
|
+
constructor();
|
|
351
|
+
set_pool_account_idx(value: number): this;
|
|
352
|
+
set_withdrawer_account_idx(value: number): this;
|
|
353
|
+
set_withdrawer_token_one_account_idx(value: number): this;
|
|
354
|
+
set_withdrawer_token_two_account_idx(value: number): this;
|
|
355
|
+
set_withdrawer_lp_account_idx(value: number): this;
|
|
356
|
+
set_vault_one_account_idx(value: number): this;
|
|
357
|
+
set_vault_two_account_idx(value: number): this;
|
|
358
|
+
set_lp_mint_account_idx(value: number): this;
|
|
359
|
+
set_token_program_account_idx(value: number): this;
|
|
360
|
+
set_lp_amount(value: bigint): this;
|
|
361
|
+
build(): Uint8Array;
|
|
362
|
+
buildInto(target: Uint8Array, offset?: number): Uint8Array;
|
|
363
|
+
finish(): AmmWithdrawLiquidityInstruction;
|
|
364
|
+
}
|
|
365
|
+
declare class Seed32 {
|
|
366
|
+
private buffer;
|
|
367
|
+
private view;
|
|
368
|
+
private constructor();
|
|
369
|
+
private static readonly __tnElementSize;
|
|
370
|
+
private static readonly __tnElementCount;
|
|
371
|
+
get length(): number;
|
|
372
|
+
getElementBytes(index: number): Uint8Array;
|
|
373
|
+
static from_array(buffer: Uint8Array): Seed32 | null;
|
|
374
|
+
asUint8Array(): Uint8Array;
|
|
375
|
+
private static __tnFootprintInternal;
|
|
376
|
+
private static __tnValidateInternal;
|
|
377
|
+
static __tnInvokeFootprint(__tnParams: Record<string, bigint>): bigint;
|
|
378
|
+
static __tnInvokeValidate(buffer: Uint8Array, __tnParams: Record<string, bigint>): __TnValidateResult;
|
|
379
|
+
static footprintIr(): bigint;
|
|
380
|
+
static footprint(): number;
|
|
381
|
+
static validate(buffer: Uint8Array, _opts?: {
|
|
382
|
+
params?: never;
|
|
383
|
+
}): {
|
|
384
|
+
ok: boolean;
|
|
385
|
+
code?: string;
|
|
386
|
+
consumed?: number;
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
declare class SwapEventData {
|
|
390
|
+
private buffer;
|
|
391
|
+
private view;
|
|
392
|
+
private constructor();
|
|
393
|
+
static __tnCreateView(buffer: Uint8Array, opts?: {
|
|
394
|
+
fieldContext?: Record<string, number | bigint>;
|
|
395
|
+
}): SwapEventData;
|
|
396
|
+
static builder(): SwapEventDataBuilder;
|
|
397
|
+
static fromBuilder(builder: SwapEventDataBuilder): SwapEventData | null;
|
|
398
|
+
get_pool(): Pubkey;
|
|
399
|
+
set_pool(value: Pubkey): void;
|
|
400
|
+
get pool(): Pubkey;
|
|
401
|
+
set pool(value: Pubkey);
|
|
402
|
+
get_sender(): Pubkey;
|
|
403
|
+
set_sender(value: Pubkey): void;
|
|
404
|
+
get sender(): Pubkey;
|
|
405
|
+
set sender(value: Pubkey);
|
|
406
|
+
get_to(): Pubkey;
|
|
407
|
+
set_to(value: Pubkey): void;
|
|
408
|
+
get to(): Pubkey;
|
|
409
|
+
set to(value: Pubkey);
|
|
410
|
+
get_amount_in(): bigint;
|
|
411
|
+
set_amount_in(value: bigint): void;
|
|
412
|
+
get amount_in(): bigint;
|
|
413
|
+
set amount_in(value: bigint);
|
|
414
|
+
get_amount_out(): bigint;
|
|
415
|
+
set_amount_out(value: bigint): void;
|
|
416
|
+
get amount_out(): bigint;
|
|
417
|
+
set amount_out(value: bigint);
|
|
418
|
+
get_swap_direction(): number;
|
|
419
|
+
set_swap_direction(value: number): void;
|
|
420
|
+
get swap_direction(): number;
|
|
421
|
+
set swap_direction(value: number);
|
|
422
|
+
private static __tnFootprintInternal;
|
|
423
|
+
private static __tnValidateInternal;
|
|
424
|
+
static __tnInvokeFootprint(__tnParams: Record<string, bigint>): bigint;
|
|
425
|
+
static __tnInvokeValidate(buffer: Uint8Array, __tnParams: Record<string, bigint>): __TnValidateResult;
|
|
426
|
+
static footprintIr(): bigint;
|
|
427
|
+
static footprint(): number;
|
|
428
|
+
static validate(buffer: Uint8Array, _opts?: {
|
|
429
|
+
params?: never;
|
|
430
|
+
}): {
|
|
431
|
+
ok: boolean;
|
|
432
|
+
code?: string;
|
|
433
|
+
consumed?: number;
|
|
434
|
+
};
|
|
435
|
+
static from_array(buffer: Uint8Array): SwapEventData | null;
|
|
436
|
+
}
|
|
437
|
+
declare class SwapEventDataBuilder {
|
|
438
|
+
private buffer;
|
|
439
|
+
private view;
|
|
440
|
+
constructor();
|
|
441
|
+
set_pool(value: Uint8Array): this;
|
|
442
|
+
set_sender(value: Uint8Array): this;
|
|
443
|
+
set_to(value: Uint8Array): this;
|
|
444
|
+
set_amount_in(value: bigint): this;
|
|
445
|
+
set_amount_out(value: bigint): this;
|
|
446
|
+
set_swap_direction(value: number): this;
|
|
447
|
+
build(): Uint8Array;
|
|
448
|
+
buildInto(target: Uint8Array, offset?: number): Uint8Array;
|
|
449
|
+
finish(): SwapEventData;
|
|
450
|
+
}
|
|
451
|
+
declare class SyncEventData {
|
|
452
|
+
private buffer;
|
|
453
|
+
private view;
|
|
454
|
+
private constructor();
|
|
455
|
+
static __tnCreateView(buffer: Uint8Array, opts?: {
|
|
456
|
+
fieldContext?: Record<string, number | bigint>;
|
|
457
|
+
}): SyncEventData;
|
|
458
|
+
static builder(): SyncEventDataBuilder;
|
|
459
|
+
static fromBuilder(builder: SyncEventDataBuilder): SyncEventData | null;
|
|
460
|
+
get_pool(): Pubkey;
|
|
461
|
+
set_pool(value: Pubkey): void;
|
|
462
|
+
get pool(): Pubkey;
|
|
463
|
+
set pool(value: Pubkey);
|
|
464
|
+
get_reserve_one(): bigint;
|
|
465
|
+
set_reserve_one(value: bigint): void;
|
|
466
|
+
get reserve_one(): bigint;
|
|
467
|
+
set reserve_one(value: bigint);
|
|
468
|
+
get_reserve_two(): bigint;
|
|
469
|
+
set_reserve_two(value: bigint): void;
|
|
470
|
+
get reserve_two(): bigint;
|
|
471
|
+
set reserve_two(value: bigint);
|
|
472
|
+
private static __tnFootprintInternal;
|
|
473
|
+
private static __tnValidateInternal;
|
|
474
|
+
static __tnInvokeFootprint(__tnParams: Record<string, bigint>): bigint;
|
|
475
|
+
static __tnInvokeValidate(buffer: Uint8Array, __tnParams: Record<string, bigint>): __TnValidateResult;
|
|
476
|
+
static footprintIr(): bigint;
|
|
477
|
+
static footprint(): number;
|
|
478
|
+
static validate(buffer: Uint8Array, _opts?: {
|
|
479
|
+
params?: never;
|
|
480
|
+
}): {
|
|
481
|
+
ok: boolean;
|
|
482
|
+
code?: string;
|
|
483
|
+
consumed?: number;
|
|
484
|
+
};
|
|
485
|
+
static from_array(buffer: Uint8Array): SyncEventData | null;
|
|
486
|
+
}
|
|
487
|
+
declare class SyncEventDataBuilder {
|
|
488
|
+
private buffer;
|
|
489
|
+
private view;
|
|
490
|
+
constructor();
|
|
491
|
+
set_pool(value: Uint8Array): this;
|
|
492
|
+
set_reserve_one(value: bigint): this;
|
|
493
|
+
set_reserve_two(value: bigint): this;
|
|
494
|
+
build(): Uint8Array;
|
|
495
|
+
buildInto(target: Uint8Array, offset?: number): Uint8Array;
|
|
496
|
+
finish(): SyncEventData;
|
|
497
|
+
}
|
|
498
|
+
declare class AmmInitPoolInstruction {
|
|
499
|
+
private buffer;
|
|
500
|
+
private view;
|
|
501
|
+
private __tnFieldContext;
|
|
502
|
+
private __tnParams;
|
|
503
|
+
private constructor();
|
|
504
|
+
static __tnCreateView(buffer: Uint8Array, opts?: {
|
|
505
|
+
params?: AmmInitPoolInstruction.Params;
|
|
506
|
+
fieldContext?: Record<string, number | bigint>;
|
|
507
|
+
}): AmmInitPoolInstruction;
|
|
508
|
+
dynamicParams(): AmmInitPoolInstruction.Params;
|
|
509
|
+
withFieldContext(context: Record<string, number | bigint>): this;
|
|
510
|
+
private __tnResolveFieldRef;
|
|
511
|
+
static builder(): AmmInitPoolInstructionBuilder;
|
|
512
|
+
static fromBuilder(builder: AmmInitPoolInstructionBuilder): AmmInitPoolInstruction | null;
|
|
513
|
+
static readonly flexibleArrayWriters: readonly [{
|
|
514
|
+
readonly field: "pool_proof";
|
|
515
|
+
readonly method: "pool_proof";
|
|
516
|
+
readonly sizeField: "pool_proof_size";
|
|
517
|
+
readonly paramKey: "pool_proof_size";
|
|
518
|
+
readonly elementSize: 1;
|
|
519
|
+
}, {
|
|
520
|
+
readonly field: "lp_mint_proof";
|
|
521
|
+
readonly method: "lp_mint_proof";
|
|
522
|
+
readonly sizeField: "lp_mint_proof_size";
|
|
523
|
+
readonly paramKey: "lp_mint_proof_size";
|
|
524
|
+
readonly elementSize: 1;
|
|
525
|
+
}, {
|
|
526
|
+
readonly field: "vault_one_proof";
|
|
527
|
+
readonly method: "vault_one_proof";
|
|
528
|
+
readonly sizeField: "vault_one_proof_size";
|
|
529
|
+
readonly paramKey: "vault_one_proof_size";
|
|
530
|
+
readonly elementSize: 1;
|
|
531
|
+
}, {
|
|
532
|
+
readonly field: "vault_two_proof";
|
|
533
|
+
readonly method: "vault_two_proof";
|
|
534
|
+
readonly sizeField: "vault_two_proof_size";
|
|
535
|
+
readonly paramKey: "vault_two_proof_size";
|
|
536
|
+
readonly elementSize: 1;
|
|
537
|
+
}];
|
|
538
|
+
static __tnComputeSequentialLayout(view: DataView, buffer: Uint8Array): {
|
|
539
|
+
params: Record<string, bigint> | null;
|
|
540
|
+
offsets: Record<string, number> | null;
|
|
541
|
+
derived: Record<string, bigint> | null;
|
|
542
|
+
} | null;
|
|
543
|
+
private static __tnExtractParams;
|
|
544
|
+
private __tnDynamicOffsetCache;
|
|
545
|
+
private __tnGetDynamicOffset;
|
|
546
|
+
private __tnComputeDynamicOffsets;
|
|
547
|
+
get_payer_account_idx(): number;
|
|
548
|
+
set_payer_account_idx(value: number): void;
|
|
549
|
+
get payer_account_idx(): number;
|
|
550
|
+
set payer_account_idx(value: number);
|
|
551
|
+
get_pool_account_idx(): number;
|
|
552
|
+
set_pool_account_idx(value: number): void;
|
|
553
|
+
get pool_account_idx(): number;
|
|
554
|
+
set pool_account_idx(value: number);
|
|
555
|
+
get_lp_mint_account_idx(): number;
|
|
556
|
+
set_lp_mint_account_idx(value: number): void;
|
|
557
|
+
get lp_mint_account_idx(): number;
|
|
558
|
+
set lp_mint_account_idx(value: number);
|
|
559
|
+
get_vault_one_account_idx(): number;
|
|
560
|
+
set_vault_one_account_idx(value: number): void;
|
|
561
|
+
get vault_one_account_idx(): number;
|
|
562
|
+
set vault_one_account_idx(value: number);
|
|
563
|
+
get_vault_two_account_idx(): number;
|
|
564
|
+
set_vault_two_account_idx(value: number): void;
|
|
565
|
+
get vault_two_account_idx(): number;
|
|
566
|
+
set vault_two_account_idx(value: number);
|
|
567
|
+
get_mint_one_account_idx(): number;
|
|
568
|
+
set_mint_one_account_idx(value: number): void;
|
|
569
|
+
get mint_one_account_idx(): number;
|
|
570
|
+
set mint_one_account_idx(value: number);
|
|
571
|
+
get_mint_two_account_idx(): number;
|
|
572
|
+
set_mint_two_account_idx(value: number): void;
|
|
573
|
+
get mint_two_account_idx(): number;
|
|
574
|
+
set mint_two_account_idx(value: number);
|
|
575
|
+
get_token_program_account_idx(): number;
|
|
576
|
+
set_token_program_account_idx(value: number): void;
|
|
577
|
+
get token_program_account_idx(): number;
|
|
578
|
+
set token_program_account_idx(value: number);
|
|
579
|
+
get_swap_fee_bps(): number;
|
|
580
|
+
set_swap_fee_bps(value: number): void;
|
|
581
|
+
get swap_fee_bps(): number;
|
|
582
|
+
set swap_fee_bps(value: number);
|
|
583
|
+
get_lp_mint_seed(): Seed32;
|
|
584
|
+
set_lp_mint_seed(value: Seed32): void;
|
|
585
|
+
get lp_mint_seed(): Seed32;
|
|
586
|
+
set lp_mint_seed(value: Seed32);
|
|
587
|
+
get_pool_proof_size(): bigint;
|
|
588
|
+
set_pool_proof_size(value: bigint): void;
|
|
589
|
+
get pool_proof_size(): bigint;
|
|
590
|
+
set pool_proof_size(value: bigint);
|
|
591
|
+
get_lp_mint_proof_size(): bigint;
|
|
592
|
+
set_lp_mint_proof_size(value: bigint): void;
|
|
593
|
+
get lp_mint_proof_size(): bigint;
|
|
594
|
+
set lp_mint_proof_size(value: bigint);
|
|
595
|
+
get_vault_one_proof_size(): bigint;
|
|
596
|
+
set_vault_one_proof_size(value: bigint): void;
|
|
597
|
+
get vault_one_proof_size(): bigint;
|
|
598
|
+
set vault_one_proof_size(value: bigint);
|
|
599
|
+
get_vault_two_proof_size(): bigint;
|
|
600
|
+
set_vault_two_proof_size(value: bigint): void;
|
|
601
|
+
get vault_two_proof_size(): bigint;
|
|
602
|
+
set vault_two_proof_size(value: bigint);
|
|
603
|
+
get_pool_proof_length(): number;
|
|
604
|
+
get_pool_proof_at(index: number): number;
|
|
605
|
+
get_pool_proof(): number[];
|
|
606
|
+
set_pool_proof_at(index: number, value: number): void;
|
|
607
|
+
set_pool_proof(value: number[]): void;
|
|
608
|
+
get pool_proof(): number[];
|
|
609
|
+
set pool_proof(value: number[]);
|
|
610
|
+
get_lp_mint_proof_length(): number;
|
|
611
|
+
get_lp_mint_proof_at(index: number): number;
|
|
612
|
+
get_lp_mint_proof(): number[];
|
|
613
|
+
set_lp_mint_proof_at(index: number, value: number): void;
|
|
614
|
+
set_lp_mint_proof(value: number[]): void;
|
|
615
|
+
get lp_mint_proof(): number[];
|
|
616
|
+
set lp_mint_proof(value: number[]);
|
|
617
|
+
get_vault_one_proof_length(): number;
|
|
618
|
+
get_vault_one_proof_at(index: number): number;
|
|
619
|
+
get_vault_one_proof(): number[];
|
|
620
|
+
set_vault_one_proof_at(index: number, value: number): void;
|
|
621
|
+
set_vault_one_proof(value: number[]): void;
|
|
622
|
+
get vault_one_proof(): number[];
|
|
623
|
+
set vault_one_proof(value: number[]);
|
|
624
|
+
get_vault_two_proof_length(): number;
|
|
625
|
+
get_vault_two_proof_at(index: number): number;
|
|
626
|
+
get_vault_two_proof(): number[];
|
|
627
|
+
set_vault_two_proof_at(index: number, value: number): void;
|
|
628
|
+
set_vault_two_proof(value: number[]): void;
|
|
629
|
+
get vault_two_proof(): number[];
|
|
630
|
+
set vault_two_proof(value: number[]);
|
|
631
|
+
private static __tnFootprintInternal;
|
|
632
|
+
private static __tnValidateInternal;
|
|
633
|
+
static __tnInvokeFootprint(__tnParams: Record<string, bigint>): bigint;
|
|
634
|
+
static __tnInvokeValidate(buffer: Uint8Array, __tnParams: Record<string, bigint>): __TnValidateResult;
|
|
635
|
+
static footprintIr(lp_mint_proof_lp_mint_proof_size: number | bigint, pool_proof_pool_proof_size: number | bigint, vault_one_proof_vault_one_proof_size: number | bigint, vault_two_proof_vault_two_proof_size: number | bigint): bigint;
|
|
636
|
+
private static __tnPackParams;
|
|
637
|
+
static footprintIrFromParams(params: AmmInitPoolInstruction.Params): bigint;
|
|
638
|
+
static footprintFromParams(params: AmmInitPoolInstruction.Params): number;
|
|
639
|
+
static footprintFromValues(input: {
|
|
640
|
+
lp_mint_proof_lp_mint_proof_size: number | bigint;
|
|
641
|
+
pool_proof_pool_proof_size: number | bigint;
|
|
642
|
+
vault_one_proof_vault_one_proof_size: number | bigint;
|
|
643
|
+
vault_two_proof_vault_two_proof_size: number | bigint;
|
|
644
|
+
}): number;
|
|
645
|
+
static footprint(params: AmmInitPoolInstruction.Params): number;
|
|
646
|
+
static validate(buffer: Uint8Array, opts?: {
|
|
647
|
+
params?: AmmInitPoolInstruction.Params;
|
|
648
|
+
}): {
|
|
649
|
+
ok: boolean;
|
|
650
|
+
code?: string;
|
|
651
|
+
consumed?: number;
|
|
652
|
+
params?: AmmInitPoolInstruction.Params;
|
|
653
|
+
};
|
|
654
|
+
static from_array(buffer: Uint8Array, opts?: {
|
|
655
|
+
params?: AmmInitPoolInstruction.Params;
|
|
656
|
+
}): AmmInitPoolInstruction | null;
|
|
657
|
+
}
|
|
658
|
+
declare namespace AmmInitPoolInstruction {
|
|
659
|
+
type Params = {
|
|
660
|
+
/** ABI path: lp_mint_proof.lp_mint_proof_size */
|
|
661
|
+
readonly lp_mint_proof_lp_mint_proof_size: bigint;
|
|
662
|
+
/** ABI path: pool_proof.pool_proof_size */
|
|
663
|
+
readonly pool_proof_pool_proof_size: bigint;
|
|
664
|
+
/** ABI path: vault_one_proof.vault_one_proof_size */
|
|
665
|
+
readonly vault_one_proof_vault_one_proof_size: bigint;
|
|
666
|
+
/** ABI path: vault_two_proof.vault_two_proof_size */
|
|
667
|
+
readonly vault_two_proof_vault_two_proof_size: bigint;
|
|
668
|
+
};
|
|
669
|
+
const ParamKeys: Readonly<{
|
|
670
|
+
readonly lp_mint_proof_lp_mint_proof_size: "lp_mint_proof.lp_mint_proof_size";
|
|
671
|
+
readonly pool_proof_pool_proof_size: "pool_proof.pool_proof_size";
|
|
672
|
+
readonly vault_one_proof_vault_one_proof_size: "vault_one_proof.vault_one_proof_size";
|
|
673
|
+
readonly vault_two_proof_vault_two_proof_size: "vault_two_proof.vault_two_proof_size";
|
|
674
|
+
}>;
|
|
675
|
+
const Params: {
|
|
676
|
+
fromValues(input: {
|
|
677
|
+
lp_mint_proof_lp_mint_proof_size: number | bigint;
|
|
678
|
+
pool_proof_pool_proof_size: number | bigint;
|
|
679
|
+
vault_one_proof_vault_one_proof_size: number | bigint;
|
|
680
|
+
vault_two_proof_vault_two_proof_size: number | bigint;
|
|
681
|
+
}): Params;
|
|
682
|
+
fromBuilder(source: {
|
|
683
|
+
dynamicParams(): Params;
|
|
684
|
+
} | {
|
|
685
|
+
params: Params;
|
|
686
|
+
} | Params): Params;
|
|
687
|
+
};
|
|
688
|
+
function params(input: {
|
|
689
|
+
lp_mint_proof_lp_mint_proof_size: number | bigint;
|
|
690
|
+
pool_proof_pool_proof_size: number | bigint;
|
|
691
|
+
vault_one_proof_vault_one_proof_size: number | bigint;
|
|
692
|
+
vault_two_proof_vault_two_proof_size: number | bigint;
|
|
693
|
+
}): Params;
|
|
694
|
+
}
|
|
695
|
+
declare class AmmInitPoolInstructionBuilder {
|
|
696
|
+
private buffer;
|
|
697
|
+
private view;
|
|
698
|
+
private __tnCachedParams;
|
|
699
|
+
private __tnLastBuffer;
|
|
700
|
+
private __tnLastParams;
|
|
701
|
+
private __tnFam_pool_proof;
|
|
702
|
+
private __tnFam_pool_proofCount;
|
|
703
|
+
private __tnFamWriter_pool_proof?;
|
|
704
|
+
private __tnFam_lp_mint_proof;
|
|
705
|
+
private __tnFam_lp_mint_proofCount;
|
|
706
|
+
private __tnFamWriter_lp_mint_proof?;
|
|
707
|
+
private __tnFam_vault_one_proof;
|
|
708
|
+
private __tnFam_vault_one_proofCount;
|
|
709
|
+
private __tnFamWriter_vault_one_proof?;
|
|
710
|
+
private __tnFam_vault_two_proof;
|
|
711
|
+
private __tnFam_vault_two_proofCount;
|
|
712
|
+
private __tnFamWriter_vault_two_proof?;
|
|
713
|
+
constructor();
|
|
714
|
+
private __tnInvalidate;
|
|
715
|
+
set_payer_account_idx(value: number): this;
|
|
716
|
+
set_pool_account_idx(value: number): this;
|
|
717
|
+
set_lp_mint_account_idx(value: number): this;
|
|
718
|
+
set_vault_one_account_idx(value: number): this;
|
|
719
|
+
set_vault_two_account_idx(value: number): this;
|
|
720
|
+
set_mint_one_account_idx(value: number): this;
|
|
721
|
+
set_mint_two_account_idx(value: number): this;
|
|
722
|
+
set_token_program_account_idx(value: number): this;
|
|
723
|
+
set_swap_fee_bps(value: number): this;
|
|
724
|
+
set_lp_mint_seed(value: Uint8Array): this;
|
|
725
|
+
set_pool_proof_size(value: bigint): this;
|
|
726
|
+
set_lp_mint_proof_size(value: bigint): this;
|
|
727
|
+
set_vault_one_proof_size(value: bigint): this;
|
|
728
|
+
set_vault_two_proof_size(value: bigint): this;
|
|
729
|
+
pool_proof(): __TnFamWriterResult<AmmInitPoolInstructionBuilder>;
|
|
730
|
+
lp_mint_proof(): __TnFamWriterResult<AmmInitPoolInstructionBuilder>;
|
|
731
|
+
vault_one_proof(): __TnFamWriterResult<AmmInitPoolInstructionBuilder>;
|
|
732
|
+
vault_two_proof(): __TnFamWriterResult<AmmInitPoolInstructionBuilder>;
|
|
733
|
+
build(): Uint8Array;
|
|
734
|
+
buildInto(target: Uint8Array, offset?: number): Uint8Array;
|
|
735
|
+
finish(): AmmInitPoolInstruction;
|
|
736
|
+
finishView(): AmmInitPoolInstruction;
|
|
737
|
+
dynamicParams(): AmmInitPoolInstruction.Params;
|
|
738
|
+
private __tnComputeParams;
|
|
739
|
+
private __tnWriteInto;
|
|
740
|
+
private __tnValidateOrThrow;
|
|
741
|
+
}
|
|
742
|
+
declare class AmmInstruction_payload_Inner {
|
|
743
|
+
private buffer;
|
|
744
|
+
private descriptor;
|
|
745
|
+
private view;
|
|
746
|
+
private __tnFieldContext;
|
|
747
|
+
private constructor();
|
|
748
|
+
static __tnCreate(payload: Uint8Array, descriptor: __TnVariantDescriptor | null, fieldContext?: Record<string, number | bigint>): AmmInstruction_payload_Inner;
|
|
749
|
+
bytes(): Uint8Array;
|
|
750
|
+
variant(): __TnVariantDescriptor | null;
|
|
751
|
+
asInitPool(): AmmInitPoolInstruction | null;
|
|
752
|
+
asAddLiquidity(): AmmAddLiquidityInstruction | null;
|
|
753
|
+
asWithdrawLiquidity(): AmmWithdrawLiquidityInstruction | null;
|
|
754
|
+
asSwap(): AmmSwapInstruction | null;
|
|
755
|
+
}
|
|
756
|
+
declare class AmmInstruction {
|
|
757
|
+
private buffer;
|
|
758
|
+
private view;
|
|
759
|
+
private static readonly __tnFieldOffset_payload;
|
|
760
|
+
private __tnParams;
|
|
761
|
+
private constructor();
|
|
762
|
+
static __tnCreateView(buffer: Uint8Array, opts?: {
|
|
763
|
+
params?: AmmInstruction.Params;
|
|
764
|
+
fieldContext?: Record<string, number | bigint>;
|
|
765
|
+
}): AmmInstruction;
|
|
766
|
+
dynamicParams(): AmmInstruction.Params;
|
|
767
|
+
static builder(): AmmInstructionBuilder;
|
|
768
|
+
static fromBuilder(builder: AmmInstructionBuilder): AmmInstruction | null;
|
|
769
|
+
static readonly payloadVariantDescriptors: readonly [{
|
|
770
|
+
readonly name: "init_pool";
|
|
771
|
+
readonly tag: 0;
|
|
772
|
+
readonly payloadSize: null;
|
|
773
|
+
readonly payloadType: "AmmInstruction::payload::init_pool";
|
|
774
|
+
readonly createPayloadBuilder: () => unknown;
|
|
775
|
+
}, {
|
|
776
|
+
readonly name: "add_liquidity";
|
|
777
|
+
readonly tag: 1;
|
|
778
|
+
readonly payloadSize: 34;
|
|
779
|
+
readonly payloadType: "AmmInstruction::payload::add_liquidity";
|
|
780
|
+
readonly createPayloadBuilder: () => unknown;
|
|
781
|
+
}, {
|
|
782
|
+
readonly name: "withdraw_liquidity";
|
|
783
|
+
readonly tag: 2;
|
|
784
|
+
readonly payloadSize: 26;
|
|
785
|
+
readonly payloadType: "AmmInstruction::payload::withdraw_liquidity";
|
|
786
|
+
readonly createPayloadBuilder: () => unknown;
|
|
787
|
+
}, {
|
|
788
|
+
readonly name: "swap";
|
|
789
|
+
readonly tag: 3;
|
|
790
|
+
readonly payloadSize: 24;
|
|
791
|
+
readonly payloadType: "AmmInstruction::payload::swap";
|
|
792
|
+
readonly createPayloadBuilder: () => unknown;
|
|
793
|
+
}];
|
|
794
|
+
static __tnComputeSequentialLayout(view: DataView, buffer: Uint8Array): {
|
|
795
|
+
params: Record<string, bigint> | null;
|
|
796
|
+
offsets: Record<string, number> | null;
|
|
797
|
+
derived: Record<string, bigint> | null;
|
|
798
|
+
} | null;
|
|
799
|
+
private static __tnExtractParams;
|
|
800
|
+
get_discriminant(): number;
|
|
801
|
+
set_discriminant(value: number): void;
|
|
802
|
+
get discriminant(): number;
|
|
803
|
+
set discriminant(value: number);
|
|
804
|
+
payloadVariant(): typeof AmmInstruction.payloadVariantDescriptors[number] | null;
|
|
805
|
+
payload(): AmmInstruction_payload_Inner;
|
|
806
|
+
private static __tnFootprintInternal;
|
|
807
|
+
private static __tnValidateInternal;
|
|
808
|
+
static __tnInvokeFootprint(__tnParams: Record<string, bigint>): bigint;
|
|
809
|
+
static __tnInvokeValidate(buffer: Uint8Array, __tnParams: Record<string, bigint>): __TnValidateResult;
|
|
810
|
+
static footprintIr(payload_discriminant: number | bigint, payload_payload_size: number | bigint): bigint;
|
|
811
|
+
private static __tnPackParams;
|
|
812
|
+
static footprintIrFromParams(params: AmmInstruction.Params): bigint;
|
|
813
|
+
static footprintFromParams(params: AmmInstruction.Params): number;
|
|
814
|
+
static footprintFromValues(input: {
|
|
815
|
+
payload_discriminant: number | bigint;
|
|
816
|
+
payload_payload_size: number | bigint;
|
|
817
|
+
}): number;
|
|
818
|
+
static footprint(params: AmmInstruction.Params): number;
|
|
819
|
+
static validate(buffer: Uint8Array, opts?: {
|
|
820
|
+
params?: AmmInstruction.Params;
|
|
821
|
+
}): {
|
|
822
|
+
ok: boolean;
|
|
823
|
+
code?: string;
|
|
824
|
+
consumed?: number;
|
|
825
|
+
params?: AmmInstruction.Params;
|
|
826
|
+
};
|
|
827
|
+
static from_array(buffer: Uint8Array, opts?: {
|
|
828
|
+
params?: AmmInstruction.Params;
|
|
829
|
+
}): AmmInstruction | null;
|
|
830
|
+
}
|
|
831
|
+
declare namespace AmmInstruction {
|
|
832
|
+
type Params = {
|
|
833
|
+
/** ABI path: payload.discriminant */
|
|
834
|
+
readonly payload_discriminant: bigint;
|
|
835
|
+
/** ABI path: payload.payload_size */
|
|
836
|
+
readonly payload_payload_size: bigint;
|
|
837
|
+
};
|
|
838
|
+
const ParamKeys: Readonly<{
|
|
839
|
+
readonly payload_discriminant: "payload.discriminant";
|
|
840
|
+
readonly payload_payload_size: "payload.payload_size";
|
|
841
|
+
}>;
|
|
842
|
+
const Params: {
|
|
843
|
+
fromValues(input: {
|
|
844
|
+
payload_discriminant: number | bigint;
|
|
845
|
+
payload_payload_size: number | bigint;
|
|
846
|
+
}): Params;
|
|
847
|
+
fromBuilder(source: {
|
|
848
|
+
dynamicParams(): Params;
|
|
849
|
+
} | {
|
|
850
|
+
params: Params;
|
|
851
|
+
} | Params): Params;
|
|
852
|
+
};
|
|
853
|
+
function params(input: {
|
|
854
|
+
payload_discriminant: number | bigint;
|
|
855
|
+
payload_payload_size: number | bigint;
|
|
856
|
+
}): Params;
|
|
857
|
+
}
|
|
858
|
+
declare class AmmInstructionBuilder {
|
|
859
|
+
private __tnPrefixBuffer;
|
|
860
|
+
private __tnPrefixView;
|
|
861
|
+
private __tnField_discriminant;
|
|
862
|
+
private __tnPayload_payload;
|
|
863
|
+
private __tnCachedParams;
|
|
864
|
+
private __tnLastBuffer;
|
|
865
|
+
private __tnLastParams;
|
|
866
|
+
private __tnVariantSelector_payload?;
|
|
867
|
+
constructor();
|
|
868
|
+
private __tnInvalidate;
|
|
869
|
+
private __tnAssign_discriminant;
|
|
870
|
+
set_discriminant(value: number): this;
|
|
871
|
+
payload(): __TnVariantSelectorResult<AmmInstructionBuilder>;
|
|
872
|
+
build(): Uint8Array;
|
|
873
|
+
buildInto(target: Uint8Array, offset?: number): Uint8Array;
|
|
874
|
+
finish(): AmmInstruction;
|
|
875
|
+
finishView(): AmmInstruction;
|
|
876
|
+
dynamicParams(): AmmInstruction.Params;
|
|
877
|
+
private __tnComputeParams;
|
|
878
|
+
private __tnWriteInto;
|
|
879
|
+
private __tnValidateOrThrow;
|
|
880
|
+
}
|
|
881
|
+
declare class AmmPoolMetadata$1 {
|
|
882
|
+
private buffer;
|
|
883
|
+
private view;
|
|
884
|
+
private constructor();
|
|
885
|
+
static __tnCreateView(buffer: Uint8Array, opts?: {
|
|
886
|
+
fieldContext?: Record<string, number | bigint>;
|
|
887
|
+
}): AmmPoolMetadata$1;
|
|
888
|
+
static builder(): AmmPoolMetadataBuilder;
|
|
889
|
+
static fromBuilder(builder: AmmPoolMetadataBuilder): AmmPoolMetadata$1 | null;
|
|
890
|
+
get_is_initialized(): number;
|
|
891
|
+
set_is_initialized(value: number): void;
|
|
892
|
+
get is_initialized(): number;
|
|
893
|
+
set is_initialized(value: number);
|
|
894
|
+
get_locked_lp_supply(): bigint;
|
|
895
|
+
set_locked_lp_supply(value: bigint): void;
|
|
896
|
+
get locked_lp_supply(): bigint;
|
|
897
|
+
set locked_lp_supply(value: bigint);
|
|
898
|
+
get_swap_fee_bps(): number;
|
|
899
|
+
set_swap_fee_bps(value: number): void;
|
|
900
|
+
get swap_fee_bps(): number;
|
|
901
|
+
set swap_fee_bps(value: number);
|
|
902
|
+
get_swap_pool_authority(): Pubkey;
|
|
903
|
+
set_swap_pool_authority(value: Pubkey): void;
|
|
904
|
+
get swap_pool_authority(): Pubkey;
|
|
905
|
+
set swap_pool_authority(value: Pubkey);
|
|
906
|
+
get_mint_one(): Pubkey;
|
|
907
|
+
set_mint_one(value: Pubkey): void;
|
|
908
|
+
get mint_one(): Pubkey;
|
|
909
|
+
set mint_one(value: Pubkey);
|
|
910
|
+
get_mint_two(): Pubkey;
|
|
911
|
+
set_mint_two(value: Pubkey): void;
|
|
912
|
+
get mint_two(): Pubkey;
|
|
913
|
+
set mint_two(value: Pubkey);
|
|
914
|
+
get_vault_one(): Pubkey;
|
|
915
|
+
set_vault_one(value: Pubkey): void;
|
|
916
|
+
get vault_one(): Pubkey;
|
|
917
|
+
set vault_one(value: Pubkey);
|
|
918
|
+
get_vault_two(): Pubkey;
|
|
919
|
+
set_vault_two(value: Pubkey): void;
|
|
920
|
+
get vault_two(): Pubkey;
|
|
921
|
+
set vault_two(value: Pubkey);
|
|
922
|
+
get_lp_mint(): Pubkey;
|
|
923
|
+
set_lp_mint(value: Pubkey): void;
|
|
924
|
+
get lp_mint(): Pubkey;
|
|
925
|
+
set lp_mint(value: Pubkey);
|
|
926
|
+
private static __tnFootprintInternal;
|
|
927
|
+
private static __tnValidateInternal;
|
|
928
|
+
static __tnInvokeFootprint(__tnParams: Record<string, bigint>): bigint;
|
|
929
|
+
static __tnInvokeValidate(buffer: Uint8Array, __tnParams: Record<string, bigint>): __TnValidateResult;
|
|
930
|
+
static footprintIr(): bigint;
|
|
931
|
+
static footprint(): number;
|
|
932
|
+
static validate(buffer: Uint8Array, _opts?: {
|
|
933
|
+
params?: never;
|
|
934
|
+
}): {
|
|
935
|
+
ok: boolean;
|
|
936
|
+
code?: string;
|
|
937
|
+
consumed?: number;
|
|
938
|
+
};
|
|
939
|
+
static from_array(buffer: Uint8Array): AmmPoolMetadata$1 | null;
|
|
940
|
+
}
|
|
941
|
+
declare class AmmPoolMetadataBuilder {
|
|
942
|
+
private buffer;
|
|
943
|
+
private view;
|
|
944
|
+
constructor();
|
|
945
|
+
set_is_initialized(value: number): this;
|
|
946
|
+
set_locked_lp_supply(value: bigint): this;
|
|
947
|
+
set_swap_fee_bps(value: number): this;
|
|
948
|
+
set_swap_pool_authority(value: Uint8Array): this;
|
|
949
|
+
set_mint_one(value: Uint8Array): this;
|
|
950
|
+
set_mint_two(value: Uint8Array): this;
|
|
951
|
+
set_vault_one(value: Uint8Array): this;
|
|
952
|
+
set_vault_two(value: Uint8Array): this;
|
|
953
|
+
set_lp_mint(value: Uint8Array): this;
|
|
954
|
+
build(): Uint8Array;
|
|
955
|
+
buildInto(target: Uint8Array, offset?: number): Uint8Array;
|
|
956
|
+
finish(): AmmPoolMetadata$1;
|
|
957
|
+
}
|
|
958
|
+
declare class BurnEventData {
|
|
959
|
+
private buffer;
|
|
960
|
+
private view;
|
|
961
|
+
private constructor();
|
|
962
|
+
static __tnCreateView(buffer: Uint8Array, opts?: {
|
|
963
|
+
fieldContext?: Record<string, number | bigint>;
|
|
964
|
+
}): BurnEventData;
|
|
965
|
+
static builder(): BurnEventDataBuilder;
|
|
966
|
+
static fromBuilder(builder: BurnEventDataBuilder): BurnEventData | null;
|
|
967
|
+
get_pool(): Pubkey;
|
|
968
|
+
set_pool(value: Pubkey): void;
|
|
969
|
+
get pool(): Pubkey;
|
|
970
|
+
set pool(value: Pubkey);
|
|
971
|
+
get_sender(): Pubkey;
|
|
972
|
+
set_sender(value: Pubkey): void;
|
|
973
|
+
get sender(): Pubkey;
|
|
974
|
+
set sender(value: Pubkey);
|
|
975
|
+
get_to(): Pubkey;
|
|
976
|
+
set_to(value: Pubkey): void;
|
|
977
|
+
get to(): Pubkey;
|
|
978
|
+
set to(value: Pubkey);
|
|
979
|
+
get_amount_one(): bigint;
|
|
980
|
+
set_amount_one(value: bigint): void;
|
|
981
|
+
get amount_one(): bigint;
|
|
982
|
+
set amount_one(value: bigint);
|
|
983
|
+
get_amount_two(): bigint;
|
|
984
|
+
set_amount_two(value: bigint): void;
|
|
985
|
+
get amount_two(): bigint;
|
|
986
|
+
set amount_two(value: bigint);
|
|
987
|
+
get_lp_burned(): bigint;
|
|
988
|
+
set_lp_burned(value: bigint): void;
|
|
989
|
+
get lp_burned(): bigint;
|
|
990
|
+
set lp_burned(value: bigint);
|
|
991
|
+
get_lp_total_supply(): bigint;
|
|
992
|
+
set_lp_total_supply(value: bigint): void;
|
|
993
|
+
get lp_total_supply(): bigint;
|
|
994
|
+
set lp_total_supply(value: bigint);
|
|
995
|
+
private static __tnFootprintInternal;
|
|
996
|
+
private static __tnValidateInternal;
|
|
997
|
+
static __tnInvokeFootprint(__tnParams: Record<string, bigint>): bigint;
|
|
998
|
+
static __tnInvokeValidate(buffer: Uint8Array, __tnParams: Record<string, bigint>): __TnValidateResult;
|
|
999
|
+
static footprintIr(): bigint;
|
|
1000
|
+
static footprint(): number;
|
|
1001
|
+
static validate(buffer: Uint8Array, _opts?: {
|
|
1002
|
+
params?: never;
|
|
1003
|
+
}): {
|
|
1004
|
+
ok: boolean;
|
|
1005
|
+
code?: string;
|
|
1006
|
+
consumed?: number;
|
|
1007
|
+
};
|
|
1008
|
+
static from_array(buffer: Uint8Array): BurnEventData | null;
|
|
1009
|
+
}
|
|
1010
|
+
declare class BurnEventDataBuilder {
|
|
1011
|
+
private buffer;
|
|
1012
|
+
private view;
|
|
1013
|
+
constructor();
|
|
1014
|
+
set_pool(value: Uint8Array): this;
|
|
1015
|
+
set_sender(value: Uint8Array): this;
|
|
1016
|
+
set_to(value: Uint8Array): this;
|
|
1017
|
+
set_amount_one(value: bigint): this;
|
|
1018
|
+
set_amount_two(value: bigint): this;
|
|
1019
|
+
set_lp_burned(value: bigint): this;
|
|
1020
|
+
set_lp_total_supply(value: bigint): this;
|
|
1021
|
+
build(): Uint8Array;
|
|
1022
|
+
buildInto(target: Uint8Array, offset?: number): Uint8Array;
|
|
1023
|
+
finish(): BurnEventData;
|
|
1024
|
+
}
|
|
1025
|
+
declare class MintEventData {
|
|
1026
|
+
private buffer;
|
|
1027
|
+
private view;
|
|
1028
|
+
private constructor();
|
|
1029
|
+
static __tnCreateView(buffer: Uint8Array, opts?: {
|
|
1030
|
+
fieldContext?: Record<string, number | bigint>;
|
|
1031
|
+
}): MintEventData;
|
|
1032
|
+
static builder(): MintEventDataBuilder;
|
|
1033
|
+
static fromBuilder(builder: MintEventDataBuilder): MintEventData | null;
|
|
1034
|
+
get_pool(): Pubkey;
|
|
1035
|
+
set_pool(value: Pubkey): void;
|
|
1036
|
+
get pool(): Pubkey;
|
|
1037
|
+
set pool(value: Pubkey);
|
|
1038
|
+
get_sender(): Pubkey;
|
|
1039
|
+
set_sender(value: Pubkey): void;
|
|
1040
|
+
get sender(): Pubkey;
|
|
1041
|
+
set sender(value: Pubkey);
|
|
1042
|
+
get_amount_one(): bigint;
|
|
1043
|
+
set_amount_one(value: bigint): void;
|
|
1044
|
+
get amount_one(): bigint;
|
|
1045
|
+
set amount_one(value: bigint);
|
|
1046
|
+
get_amount_two(): bigint;
|
|
1047
|
+
set_amount_two(value: bigint): void;
|
|
1048
|
+
get amount_two(): bigint;
|
|
1049
|
+
set amount_two(value: bigint);
|
|
1050
|
+
get_lp_minted(): bigint;
|
|
1051
|
+
set_lp_minted(value: bigint): void;
|
|
1052
|
+
get lp_minted(): bigint;
|
|
1053
|
+
set lp_minted(value: bigint);
|
|
1054
|
+
get_lp_total_supply(): bigint;
|
|
1055
|
+
set_lp_total_supply(value: bigint): void;
|
|
1056
|
+
get lp_total_supply(): bigint;
|
|
1057
|
+
set lp_total_supply(value: bigint);
|
|
1058
|
+
private static __tnFootprintInternal;
|
|
1059
|
+
private static __tnValidateInternal;
|
|
1060
|
+
static __tnInvokeFootprint(__tnParams: Record<string, bigint>): bigint;
|
|
1061
|
+
static __tnInvokeValidate(buffer: Uint8Array, __tnParams: Record<string, bigint>): __TnValidateResult;
|
|
1062
|
+
static footprintIr(): bigint;
|
|
1063
|
+
static footprint(): number;
|
|
1064
|
+
static validate(buffer: Uint8Array, _opts?: {
|
|
1065
|
+
params?: never;
|
|
1066
|
+
}): {
|
|
1067
|
+
ok: boolean;
|
|
1068
|
+
code?: string;
|
|
1069
|
+
consumed?: number;
|
|
1070
|
+
};
|
|
1071
|
+
static from_array(buffer: Uint8Array): MintEventData | null;
|
|
1072
|
+
}
|
|
1073
|
+
declare class MintEventDataBuilder {
|
|
1074
|
+
private buffer;
|
|
1075
|
+
private view;
|
|
1076
|
+
constructor();
|
|
1077
|
+
set_pool(value: Uint8Array): this;
|
|
1078
|
+
set_sender(value: Uint8Array): this;
|
|
1079
|
+
set_amount_one(value: bigint): this;
|
|
1080
|
+
set_amount_two(value: bigint): this;
|
|
1081
|
+
set_lp_minted(value: bigint): this;
|
|
1082
|
+
set_lp_total_supply(value: bigint): this;
|
|
1083
|
+
build(): Uint8Array;
|
|
1084
|
+
buildInto(target: Uint8Array, offset?: number): Uint8Array;
|
|
1085
|
+
finish(): MintEventData;
|
|
1086
|
+
}
|
|
1087
|
+
declare class PoolInitEventData {
|
|
1088
|
+
private buffer;
|
|
1089
|
+
private view;
|
|
1090
|
+
private constructor();
|
|
1091
|
+
static __tnCreateView(buffer: Uint8Array, opts?: {
|
|
1092
|
+
fieldContext?: Record<string, number | bigint>;
|
|
1093
|
+
}): PoolInitEventData;
|
|
1094
|
+
static builder(): PoolInitEventDataBuilder;
|
|
1095
|
+
static fromBuilder(builder: PoolInitEventDataBuilder): PoolInitEventData | null;
|
|
1096
|
+
get_pool(): Pubkey;
|
|
1097
|
+
set_pool(value: Pubkey): void;
|
|
1098
|
+
get pool(): Pubkey;
|
|
1099
|
+
set pool(value: Pubkey);
|
|
1100
|
+
get_mint_one(): Pubkey;
|
|
1101
|
+
set_mint_one(value: Pubkey): void;
|
|
1102
|
+
get mint_one(): Pubkey;
|
|
1103
|
+
set mint_one(value: Pubkey);
|
|
1104
|
+
get_mint_two(): Pubkey;
|
|
1105
|
+
set_mint_two(value: Pubkey): void;
|
|
1106
|
+
get mint_two(): Pubkey;
|
|
1107
|
+
set mint_two(value: Pubkey);
|
|
1108
|
+
get_lp_mint(): Pubkey;
|
|
1109
|
+
set_lp_mint(value: Pubkey): void;
|
|
1110
|
+
get lp_mint(): Pubkey;
|
|
1111
|
+
set lp_mint(value: Pubkey);
|
|
1112
|
+
get_vault_one(): Pubkey;
|
|
1113
|
+
set_vault_one(value: Pubkey): void;
|
|
1114
|
+
get vault_one(): Pubkey;
|
|
1115
|
+
set vault_one(value: Pubkey);
|
|
1116
|
+
get_vault_two(): Pubkey;
|
|
1117
|
+
set_vault_two(value: Pubkey): void;
|
|
1118
|
+
get vault_two(): Pubkey;
|
|
1119
|
+
set vault_two(value: Pubkey);
|
|
1120
|
+
get_swap_fee_bps(): number;
|
|
1121
|
+
set_swap_fee_bps(value: number): void;
|
|
1122
|
+
get swap_fee_bps(): number;
|
|
1123
|
+
set swap_fee_bps(value: number);
|
|
1124
|
+
private static __tnFootprintInternal;
|
|
1125
|
+
private static __tnValidateInternal;
|
|
1126
|
+
static __tnInvokeFootprint(__tnParams: Record<string, bigint>): bigint;
|
|
1127
|
+
static __tnInvokeValidate(buffer: Uint8Array, __tnParams: Record<string, bigint>): __TnValidateResult;
|
|
1128
|
+
static footprintIr(): bigint;
|
|
1129
|
+
static footprint(): number;
|
|
1130
|
+
static validate(buffer: Uint8Array, _opts?: {
|
|
1131
|
+
params?: never;
|
|
1132
|
+
}): {
|
|
1133
|
+
ok: boolean;
|
|
1134
|
+
code?: string;
|
|
1135
|
+
consumed?: number;
|
|
1136
|
+
};
|
|
1137
|
+
static from_array(buffer: Uint8Array): PoolInitEventData | null;
|
|
1138
|
+
}
|
|
1139
|
+
declare class PoolInitEventDataBuilder {
|
|
1140
|
+
private buffer;
|
|
1141
|
+
private view;
|
|
1142
|
+
constructor();
|
|
1143
|
+
set_pool(value: Uint8Array): this;
|
|
1144
|
+
set_mint_one(value: Uint8Array): this;
|
|
1145
|
+
set_mint_two(value: Uint8Array): this;
|
|
1146
|
+
set_lp_mint(value: Uint8Array): this;
|
|
1147
|
+
set_vault_one(value: Uint8Array): this;
|
|
1148
|
+
set_vault_two(value: Uint8Array): this;
|
|
1149
|
+
set_swap_fee_bps(value: number): this;
|
|
1150
|
+
build(): Uint8Array;
|
|
1151
|
+
buildInto(target: Uint8Array, offset?: number): Uint8Array;
|
|
1152
|
+
finish(): PoolInitEventData;
|
|
1153
|
+
}
|
|
1154
|
+
declare class AmmEvent_payload_Inner {
|
|
1155
|
+
private buffer;
|
|
1156
|
+
private descriptor;
|
|
1157
|
+
private view;
|
|
1158
|
+
private __tnFieldContext;
|
|
1159
|
+
private constructor();
|
|
1160
|
+
static __tnCreate(payload: Uint8Array, descriptor: __TnVariantDescriptor | null, fieldContext?: Record<string, number | bigint>): AmmEvent_payload_Inner;
|
|
1161
|
+
bytes(): Uint8Array;
|
|
1162
|
+
variant(): __TnVariantDescriptor | null;
|
|
1163
|
+
asPoolInit(): PoolInitEventData | null;
|
|
1164
|
+
asMint(): MintEventData | null;
|
|
1165
|
+
asBurn(): BurnEventData | null;
|
|
1166
|
+
asSwap(): SwapEventData | null;
|
|
1167
|
+
asSync(): SyncEventData | null;
|
|
1168
|
+
}
|
|
1169
|
+
declare class AmmEvent {
|
|
1170
|
+
private buffer;
|
|
1171
|
+
private view;
|
|
1172
|
+
private static readonly __tnFieldOffset_payload;
|
|
1173
|
+
private __tnParams;
|
|
1174
|
+
private constructor();
|
|
1175
|
+
static __tnCreateView(buffer: Uint8Array, opts?: {
|
|
1176
|
+
params?: AmmEvent.Params;
|
|
1177
|
+
fieldContext?: Record<string, number | bigint>;
|
|
1178
|
+
}): AmmEvent;
|
|
1179
|
+
dynamicParams(): AmmEvent.Params;
|
|
1180
|
+
static builder(): AmmEventBuilder;
|
|
1181
|
+
static fromBuilder(builder: AmmEventBuilder): AmmEvent | null;
|
|
1182
|
+
static readonly payloadVariantDescriptors: readonly [{
|
|
1183
|
+
readonly name: "pool_init";
|
|
1184
|
+
readonly tag: 0;
|
|
1185
|
+
readonly payloadSize: 194;
|
|
1186
|
+
readonly payloadType: "AmmEvent::payload::pool_init";
|
|
1187
|
+
readonly createPayloadBuilder: () => unknown;
|
|
1188
|
+
}, {
|
|
1189
|
+
readonly name: "mint";
|
|
1190
|
+
readonly tag: 1;
|
|
1191
|
+
readonly payloadSize: 96;
|
|
1192
|
+
readonly payloadType: "AmmEvent::payload::mint";
|
|
1193
|
+
readonly createPayloadBuilder: () => unknown;
|
|
1194
|
+
}, {
|
|
1195
|
+
readonly name: "burn";
|
|
1196
|
+
readonly tag: 2;
|
|
1197
|
+
readonly payloadSize: 128;
|
|
1198
|
+
readonly payloadType: "AmmEvent::payload::burn";
|
|
1199
|
+
readonly createPayloadBuilder: () => unknown;
|
|
1200
|
+
}, {
|
|
1201
|
+
readonly name: "swap";
|
|
1202
|
+
readonly tag: 3;
|
|
1203
|
+
readonly payloadSize: 113;
|
|
1204
|
+
readonly payloadType: "AmmEvent::payload::swap";
|
|
1205
|
+
readonly createPayloadBuilder: () => unknown;
|
|
1206
|
+
}, {
|
|
1207
|
+
readonly name: "sync";
|
|
1208
|
+
readonly tag: 4;
|
|
1209
|
+
readonly payloadSize: 48;
|
|
1210
|
+
readonly payloadType: "AmmEvent::payload::sync";
|
|
1211
|
+
readonly createPayloadBuilder: () => unknown;
|
|
1212
|
+
}];
|
|
1213
|
+
private static __tnExtractParams;
|
|
1214
|
+
get_event_type(): number;
|
|
1215
|
+
set_event_type(value: number): void;
|
|
1216
|
+
get event_type(): number;
|
|
1217
|
+
set event_type(value: number);
|
|
1218
|
+
payloadVariant(): typeof AmmEvent.payloadVariantDescriptors[number] | null;
|
|
1219
|
+
payload(): AmmEvent_payload_Inner;
|
|
1220
|
+
private static __tnFootprintInternal;
|
|
1221
|
+
private static __tnValidateInternal;
|
|
1222
|
+
static __tnInvokeFootprint(__tnParams: Record<string, bigint>): bigint;
|
|
1223
|
+
static __tnInvokeValidate(buffer: Uint8Array, __tnParams: Record<string, bigint>): __TnValidateResult;
|
|
1224
|
+
static footprintIr(payload_event_type: number | bigint): bigint;
|
|
1225
|
+
private static __tnPackParams;
|
|
1226
|
+
static footprintIrFromParams(params: AmmEvent.Params): bigint;
|
|
1227
|
+
static footprintFromParams(params: AmmEvent.Params): number;
|
|
1228
|
+
static footprintFromValues(input: {
|
|
1229
|
+
payload_event_type: number | bigint;
|
|
1230
|
+
}): number;
|
|
1231
|
+
static footprint(params: AmmEvent.Params): number;
|
|
1232
|
+
static validate(buffer: Uint8Array, opts?: {
|
|
1233
|
+
params?: AmmEvent.Params;
|
|
1234
|
+
}): {
|
|
1235
|
+
ok: boolean;
|
|
1236
|
+
code?: string;
|
|
1237
|
+
consumed?: number;
|
|
1238
|
+
params?: AmmEvent.Params;
|
|
1239
|
+
};
|
|
1240
|
+
static from_array(buffer: Uint8Array, opts?: {
|
|
1241
|
+
params?: AmmEvent.Params;
|
|
1242
|
+
}): AmmEvent | null;
|
|
1243
|
+
}
|
|
1244
|
+
declare namespace AmmEvent {
|
|
1245
|
+
type Params = {
|
|
1246
|
+
/** ABI path: payload.event_type */
|
|
1247
|
+
readonly payload_event_type: bigint;
|
|
1248
|
+
};
|
|
1249
|
+
const ParamKeys: Readonly<{
|
|
1250
|
+
readonly payload_event_type: "payload.event_type";
|
|
1251
|
+
}>;
|
|
1252
|
+
const Params: {
|
|
1253
|
+
fromValues(input: {
|
|
1254
|
+
payload_event_type: number | bigint;
|
|
1255
|
+
}): Params;
|
|
1256
|
+
fromBuilder(source: {
|
|
1257
|
+
dynamicParams(): Params;
|
|
1258
|
+
} | {
|
|
1259
|
+
params: Params;
|
|
1260
|
+
} | Params): Params;
|
|
1261
|
+
};
|
|
1262
|
+
function params(input: {
|
|
1263
|
+
payload_event_type: number | bigint;
|
|
1264
|
+
}): Params;
|
|
1265
|
+
}
|
|
1266
|
+
declare class AmmEventBuilder {
|
|
1267
|
+
private __tnPrefixBuffer;
|
|
1268
|
+
private __tnPrefixView;
|
|
1269
|
+
private __tnField_event_type;
|
|
1270
|
+
private __tnPayload_payload;
|
|
1271
|
+
private __tnCachedParams;
|
|
1272
|
+
private __tnLastBuffer;
|
|
1273
|
+
private __tnLastParams;
|
|
1274
|
+
private __tnVariantSelector_payload?;
|
|
1275
|
+
constructor();
|
|
1276
|
+
private __tnInvalidate;
|
|
1277
|
+
private __tnAssign_event_type;
|
|
1278
|
+
set_event_type(value: number): this;
|
|
1279
|
+
payload(): __TnVariantSelectorResult<AmmEventBuilder>;
|
|
1280
|
+
build(): Uint8Array;
|
|
1281
|
+
buildInto(target: Uint8Array, offset?: number): Uint8Array;
|
|
1282
|
+
finish(): AmmEvent;
|
|
1283
|
+
finishView(): AmmEvent;
|
|
1284
|
+
dynamicParams(): AmmEvent.Params;
|
|
1285
|
+
private __tnComputeParams;
|
|
1286
|
+
private __tnWriteInto;
|
|
1287
|
+
private __tnValidateOrThrow;
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
declare const AMM_INSTRUCTION_INIT_POOL = 0;
|
|
1291
|
+
declare const AMM_INSTRUCTION_ADD_LIQUIDITY = 1;
|
|
1292
|
+
declare const AMM_INSTRUCTION_WITHDRAW_LIQUIDITY = 2;
|
|
1293
|
+
declare const AMM_INSTRUCTION_SWAP = 3;
|
|
1294
|
+
declare const AMM_EVENT_POOL_INIT = 0;
|
|
1295
|
+
declare const AMM_EVENT_MINT = 1;
|
|
1296
|
+
declare const AMM_EVENT_BURN = 2;
|
|
1297
|
+
declare const AMM_EVENT_SWAP = 3;
|
|
1298
|
+
declare const AMM_EVENT_SYNC = 4;
|
|
1299
|
+
declare const AMM_BPS_DENOMINATOR = 10000;
|
|
1300
|
+
declare const AMM_DEFAULT_SWAP_FEE_BPS = 30;
|
|
1301
|
+
declare const AMM_MAX_SWAP_FEE_BPS = 500;
|
|
1302
|
+
declare const AMM_MINIMUM_LIQUIDITY = 1000n;
|
|
1303
|
+
declare const AMM_LP_DECIMALS = 6;
|
|
1304
|
+
declare const AMM_LP_SCALE = 1000000n;
|
|
1305
|
+
declare const AMM_POOL_METADATA_SIZE = 203;
|
|
1306
|
+
declare const AMM_PROGRAM_ADDRESS = "taCnhMCcBZSJ8MDLGYBnTIRgmWxZx_jNjoNwOwzk1g4ST1";
|
|
1307
|
+
declare const AMM_ERROR_LABELS: Record<number, string>;
|
|
1308
|
+
declare const AMM_VAULT_ONE_SEED: Uint8Array<ArrayBufferLike>;
|
|
1309
|
+
declare const AMM_VAULT_TWO_SEED: Uint8Array<ArrayBufferLike>;
|
|
1310
|
+
type AccountLookupContext = {
|
|
1311
|
+
getAccountIndex: (pubkey: Uint8Array) => number;
|
|
1312
|
+
};
|
|
1313
|
+
type InstructionData = (context: AccountLookupContext) => Promise<Uint8Array>;
|
|
1314
|
+
interface SortedAmmMints {
|
|
1315
|
+
mintOneBytes: Uint8Array;
|
|
1316
|
+
mintTwoBytes: Uint8Array;
|
|
1317
|
+
mintOneAddress: string;
|
|
1318
|
+
mintTwoAddress: string;
|
|
1319
|
+
inputOrder: 'already-sorted' | 'swapped';
|
|
1320
|
+
}
|
|
1321
|
+
interface AmmPoolAddresses {
|
|
1322
|
+
mintOneAddress: string;
|
|
1323
|
+
mintTwoAddress: string;
|
|
1324
|
+
mintOneBytes: Uint8Array;
|
|
1325
|
+
mintTwoBytes: Uint8Array;
|
|
1326
|
+
poolAddress: string;
|
|
1327
|
+
poolBytes: Uint8Array;
|
|
1328
|
+
poolSeed: Uint8Array;
|
|
1329
|
+
lpMintSeed: Uint8Array;
|
|
1330
|
+
vaultOneSeed: Uint8Array;
|
|
1331
|
+
vaultTwoSeed: Uint8Array;
|
|
1332
|
+
swapFeeBps: number;
|
|
1333
|
+
inputOrder: 'already-sorted' | 'swapped';
|
|
1334
|
+
}
|
|
1335
|
+
interface AmmPoolMetadata {
|
|
1336
|
+
isInitialized: boolean;
|
|
1337
|
+
lockedLpSupply: bigint;
|
|
1338
|
+
swapFeeBps: number;
|
|
1339
|
+
swapPoolAuthority: string;
|
|
1340
|
+
mintOne: string;
|
|
1341
|
+
mintTwo: string;
|
|
1342
|
+
vaultOne: string;
|
|
1343
|
+
vaultTwo: string;
|
|
1344
|
+
lpMint: string;
|
|
1345
|
+
}
|
|
1346
|
+
interface AmmQuoteExactIn {
|
|
1347
|
+
amountIn: bigint;
|
|
1348
|
+
amountInAfterFee: bigint;
|
|
1349
|
+
feeAmount: bigint;
|
|
1350
|
+
amountOut: bigint;
|
|
1351
|
+
}
|
|
1352
|
+
interface InitPoolArgs {
|
|
1353
|
+
payerAccountBytes: Uint8Array;
|
|
1354
|
+
poolAccountBytes: Uint8Array;
|
|
1355
|
+
lpMintAccountBytes: Uint8Array;
|
|
1356
|
+
vaultOneAccountBytes: Uint8Array;
|
|
1357
|
+
vaultTwoAccountBytes: Uint8Array;
|
|
1358
|
+
mintOneAccountBytes: Uint8Array;
|
|
1359
|
+
mintTwoAccountBytes: Uint8Array;
|
|
1360
|
+
tokenProgramAccountBytes: Uint8Array;
|
|
1361
|
+
swapFeeBps: number;
|
|
1362
|
+
lpMintSeed: Uint8Array;
|
|
1363
|
+
poolStateProof: Uint8Array;
|
|
1364
|
+
lpMintStateProof: Uint8Array;
|
|
1365
|
+
vaultOneStateProof: Uint8Array;
|
|
1366
|
+
vaultTwoStateProof: Uint8Array;
|
|
1367
|
+
}
|
|
1368
|
+
interface AddLiquidityArgs {
|
|
1369
|
+
poolAccountBytes: Uint8Array;
|
|
1370
|
+
depositorAccountBytes: Uint8Array;
|
|
1371
|
+
depositorTokenOneAccountBytes: Uint8Array;
|
|
1372
|
+
depositorTokenTwoAccountBytes: Uint8Array;
|
|
1373
|
+
depositorLpAccountBytes: Uint8Array;
|
|
1374
|
+
vaultOneAccountBytes: Uint8Array;
|
|
1375
|
+
vaultTwoAccountBytes: Uint8Array;
|
|
1376
|
+
lpMintAccountBytes: Uint8Array;
|
|
1377
|
+
tokenProgramAccountBytes: Uint8Array;
|
|
1378
|
+
maxAmountMintOne: bigint;
|
|
1379
|
+
maxAmountMintTwo: bigint;
|
|
1380
|
+
}
|
|
1381
|
+
interface WithdrawLiquidityArgs {
|
|
1382
|
+
poolAccountBytes: Uint8Array;
|
|
1383
|
+
withdrawerAccountBytes: Uint8Array;
|
|
1384
|
+
withdrawerTokenOneAccountBytes: Uint8Array;
|
|
1385
|
+
withdrawerTokenTwoAccountBytes: Uint8Array;
|
|
1386
|
+
withdrawerLpAccountBytes: Uint8Array;
|
|
1387
|
+
vaultOneAccountBytes: Uint8Array;
|
|
1388
|
+
vaultTwoAccountBytes: Uint8Array;
|
|
1389
|
+
lpMintAccountBytes: Uint8Array;
|
|
1390
|
+
tokenProgramAccountBytes: Uint8Array;
|
|
1391
|
+
lpAmount: bigint;
|
|
1392
|
+
}
|
|
1393
|
+
interface SwapArgs {
|
|
1394
|
+
poolAccountBytes: Uint8Array;
|
|
1395
|
+
userTransferAuthorityBytes: Uint8Array;
|
|
1396
|
+
userInputAccountBytes: Uint8Array;
|
|
1397
|
+
userOutputAccountBytes: Uint8Array;
|
|
1398
|
+
vaultInputAccountBytes: Uint8Array;
|
|
1399
|
+
vaultOutputAccountBytes: Uint8Array;
|
|
1400
|
+
lpMintAccountBytes: Uint8Array;
|
|
1401
|
+
tokenProgramAccountBytes: Uint8Array;
|
|
1402
|
+
amountIn: bigint;
|
|
1403
|
+
}
|
|
1404
|
+
declare function sortAmmMints(mintA: Uint8Array | string, mintB: Uint8Array | string): SortedAmmMints;
|
|
1405
|
+
declare function deriveAmmLpMintSeed(thru: Thru, poolBytes: Uint8Array | string): Uint8Array;
|
|
1406
|
+
declare function deriveAmmPoolAddresses(thru: Thru, args: {
|
|
1407
|
+
ammProgramAddress: string;
|
|
1408
|
+
mintAAddress: string;
|
|
1409
|
+
mintBAddress: string;
|
|
1410
|
+
swapFeeBps?: number;
|
|
1411
|
+
}): AmmPoolAddresses;
|
|
1412
|
+
declare function createInitPoolInstruction(args: InitPoolArgs): InstructionData;
|
|
1413
|
+
declare function createAddLiquidityInstruction(args: AddLiquidityArgs): InstructionData;
|
|
1414
|
+
declare function createWithdrawLiquidityInstruction(args: WithdrawLiquidityArgs): InstructionData;
|
|
1415
|
+
declare function createSwapInstruction(args: SwapArgs): InstructionData;
|
|
1416
|
+
declare function parseAmmPoolMetadata(accountOrData: Account | Uint8Array): AmmPoolMetadata;
|
|
1417
|
+
declare function quoteAmmSwapExactIn(args: {
|
|
1418
|
+
amountIn: bigint;
|
|
1419
|
+
reserveIn: bigint;
|
|
1420
|
+
reserveOut: bigint;
|
|
1421
|
+
swapFeeBps: number;
|
|
1422
|
+
}): AmmQuoteExactIn;
|
|
1423
|
+
|
|
1424
|
+
export { AMM_BPS_DENOMINATOR, AMM_DEFAULT_SWAP_FEE_BPS, AMM_ERROR_LABELS, AMM_EVENT_BURN, AMM_EVENT_MINT, AMM_EVENT_POOL_INIT, AMM_EVENT_SWAP, AMM_EVENT_SYNC, AMM_INSTRUCTION_ADD_LIQUIDITY, AMM_INSTRUCTION_INIT_POOL, AMM_INSTRUCTION_SWAP, AMM_INSTRUCTION_WITHDRAW_LIQUIDITY, AMM_LP_DECIMALS, AMM_LP_SCALE, AMM_MAX_SWAP_FEE_BPS, AMM_MINIMUM_LIQUIDITY, AMM_POOL_METADATA_SIZE, AMM_PROGRAM_ADDRESS, AMM_VAULT_ONE_SEED, AMM_VAULT_TWO_SEED, type AccountLookupContext, type AddLiquidityArgs, AmmAddLiquidityInstruction, AmmAddLiquidityInstructionBuilder, AmmError, AmmErrorBuilder, AmmEvent, AmmEventBuilder, AmmInitPoolInstruction, AmmInitPoolInstructionBuilder, AmmInstruction, AmmInstructionBuilder, type AmmPoolAddresses, type AmmPoolMetadata, AmmPoolMetadataBuilder, AmmPoolMetadata$1 as AmmPoolMetadataView, type AmmQuoteExactIn, AmmSwapInstruction, AmmSwapInstructionBuilder, AmmWithdrawLiquidityInstruction, AmmWithdrawLiquidityInstructionBuilder, BurnEventData, BurnEventDataBuilder, type InitPoolArgs, type InstructionData, MintEventData, MintEventDataBuilder, PoolInitEventData, PoolInitEventDataBuilder, Seed32, type SortedAmmMints, type SwapArgs, SwapEventData, SwapEventDataBuilder, SyncEventData, SyncEventDataBuilder, type WithdrawLiquidityArgs, createAddLiquidityInstruction, createInitPoolInstruction, createSwapInstruction, createWithdrawLiquidityInstruction, deriveAmmLpMintSeed, deriveAmmPoolAddresses, parseAmmPoolMetadata, quoteAmmSwapExactIn, sortAmmMints };
|