@pina-rs/amm 0.0.0 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/README.md +27 -2
  2. package/dist/index.cjs +1257 -0
  3. package/dist/index.cjs.map +1 -0
  4. package/dist/index.d.cts +1752 -0
  5. package/dist/index.d.ts +1752 -0
  6. package/dist/index.js +1078 -0
  7. package/dist/index.js.map +1 -0
  8. package/package.json +57 -8
  9. package/src/generated/accounts/ammConfig.ts +197 -0
  10. package/src/generated/accounts/index.ts +10 -0
  11. package/src/generated/accounts/pool.ts +218 -0
  12. package/src/generated/errors/index.ts +9 -0
  13. package/src/generated/errors/pinaAmm.ts +64 -0
  14. package/src/generated/events/feesCollected.ts +64 -0
  15. package/src/generated/events/index.ts +13 -0
  16. package/src/generated/events/liquidityChanged.ts +72 -0
  17. package/src/generated/events/logs.ts +372 -0
  18. package/src/generated/events/poolCreated.ts +80 -0
  19. package/src/generated/events/swapped.ts +100 -0
  20. package/src/generated/index.ts +14 -0
  21. package/src/generated/instructions/collectCreatorFees.ts +119 -0
  22. package/src/generated/instructions/collectProtocolFees.ts +123 -0
  23. package/src/generated/instructions/createConfig.ts +142 -0
  24. package/src/generated/instructions/createPool.ts +291 -0
  25. package/src/generated/instructions/deposit.ts +139 -0
  26. package/src/generated/instructions/index.ts +19 -0
  27. package/src/generated/instructions/migrate.ts +155 -0
  28. package/src/generated/instructions/setPoolCreator.ts +90 -0
  29. package/src/generated/instructions/swapExactIn.ts +119 -0
  30. package/src/generated/instructions/swapExactOut.ts +119 -0
  31. package/src/generated/instructions/updateConfig.ts +105 -0
  32. package/src/generated/instructions/withdraw.ts +139 -0
  33. package/src/generated/pdas/ammConfig.ts +18 -0
  34. package/src/generated/pdas/index.ts +12 -0
  35. package/src/generated/pdas/pool.ts +20 -0
  36. package/src/generated/pdas/poolLpMint.ts +18 -0
  37. package/src/generated/pdas/poolVault.ts +19 -0
  38. package/src/generated/pinaPodCodecs.ts +232 -0
  39. package/src/generated/programs/index.ts +9 -0
  40. package/src/generated/programs/pinaAmm.ts +115 -0
  41. package/src/index.ts +11 -0
  42. package/CHANGELOG.md +0 -5
@@ -0,0 +1,1752 @@
1
+ import { Address, ProgramDerivedAddress, FixedSizeCodec, ReadonlyUint8Array, EncodedAccount, Account, MaybeEncodedAccount, MaybeAccount, fetchEncodedAccounts, FetchAccountsConfig, fetchEncodedAccount, FetchAccountConfig, FixedSizeDecoder, FixedSizeEncoder, SolanaError, SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM, Instruction, InstructionWithData, ClientWithRpc, GetAccountInfoApi, GetMultipleAccountsApi, ClientWithTransactionPlanning, ClientWithTransactionSending, ExtendedClient, TransactionSigner, AccountMeta, InstructionWithAccounts, WritableSignerAccount, AccountSignerMeta, ReadonlyAccount, WritableAccount, ReadonlySignerAccount } from '@solana/kit';
2
+ import { SelfFetchFunctions, SelfPlanAndSendFunctions, InstructionSignerInput, InstructionAccountInput, ResolvedInstructionAccountMeta, InstructionAccountInputAddress } from '@solana/program-client-core';
3
+
4
+ /**
5
+ * This code was AUTOGENERATED using the Codama library.
6
+ * Please DO NOT EDIT THIS FILE, instead use visitors
7
+ * to add features, then rerun Codama to update it.
8
+ *
9
+ * @see https://github.com/codama-idl/codama
10
+ */
11
+
12
+ type AmmConfigSeeds = {
13
+ index: number;
14
+ };
15
+ declare function findAmmConfigPda(seeds: AmmConfigSeeds, config?: {
16
+ programAddress?: Address | undefined;
17
+ }): Promise<ProgramDerivedAddress>;
18
+
19
+ /**
20
+ * This code was AUTOGENERATED using the Codama library.
21
+ * Please DO NOT EDIT THIS FILE, instead use visitors
22
+ * to add features, then rerun Codama to update it.
23
+ *
24
+ * @see https://github.com/codama-idl/codama
25
+ */
26
+
27
+ type PoolSeeds = {
28
+ ammConfig: Address;
29
+ mint0: Address;
30
+ mint1: Address;
31
+ };
32
+ declare function findPoolPda(seeds: PoolSeeds, config?: {
33
+ programAddress?: Address | undefined;
34
+ }): Promise<ProgramDerivedAddress>;
35
+
36
+ /**
37
+ * This code was AUTOGENERATED using the Codama library.
38
+ * Please DO NOT EDIT THIS FILE, instead use visitors
39
+ * to add features, then rerun Codama to update it.
40
+ *
41
+ * @see https://github.com/codama-idl/codama
42
+ */
43
+
44
+ type PoolLpMintSeeds = {
45
+ pool: Address;
46
+ };
47
+ declare function findPoolLpMintPda(seeds: PoolLpMintSeeds, config?: {
48
+ programAddress?: Address | undefined;
49
+ }): Promise<ProgramDerivedAddress>;
50
+
51
+ /**
52
+ * This code was AUTOGENERATED using the Codama library.
53
+ * Please DO NOT EDIT THIS FILE, instead use visitors
54
+ * to add features, then rerun Codama to update it.
55
+ *
56
+ * @see https://github.com/codama-idl/codama
57
+ */
58
+
59
+ type PoolVaultSeeds = {
60
+ pool: Address;
61
+ mint: Address;
62
+ };
63
+ declare function findPoolVaultPda(seeds: PoolVaultSeeds, config?: {
64
+ programAddress?: Address | undefined;
65
+ }): Promise<ProgramDerivedAddress>;
66
+
67
+ /**
68
+ * This code was AUTOGENERATED using the Codama library.
69
+ * Please DO NOT EDIT THIS FILE, instead use visitors
70
+ * to add features, then rerun Codama to update it.
71
+ *
72
+ * @see https://github.com/codama-idl/codama
73
+ */
74
+
75
+ declare const AMM_CONFIG_DISCRIMINATOR = 1;
76
+ declare function getAmmConfigDiscriminatorBytes(): ReadonlyUint8Array;
77
+ declare const AMM_CONFIG_DISCRIMINATOR2 = 0;
78
+ declare function getAmmConfigDiscriminator2Bytes(): ReadonlyUint8Array;
79
+ /**
80
+ * A fee tier, created by the program's upgrade authority.
81
+ *
82
+ * Pools snapshot `trade_fee_rate`, `protocol_fee_rate`, and
83
+ * `creator_fee_rate` when they are created; later updates only affect new
84
+ * pools. `pool_creator_authority` is fixed for the life of the tier.
85
+ */
86
+ type AmmConfig = {
87
+ discriminator: number;
88
+ migrationVersion: number;
89
+ /**
90
+ * Signer that may update this tier and collect protocol fees from every
91
+ * pool created under it.
92
+ */
93
+ authority: Address;
94
+ /**
95
+ * When not the default address, the only signer allowed to create pools
96
+ * under this tier. The default address leaves pool creation open to
97
+ * anyone.
98
+ */
99
+ poolCreatorAuthority: Address;
100
+ /**
101
+ * Fee charged on every swap, in parts per million of the fee base. The
102
+ * LPs keep everything the protocol does not take.
103
+ */
104
+ tradeFeeRate: number;
105
+ /**
106
+ * Share of the trade fee paid to the protocol, in parts per million of
107
+ * the trade fee.
108
+ */
109
+ protocolFeeRate: number;
110
+ /**
111
+ * Additional fee paid to the pool's creator, in parts per million of the
112
+ * fee base.
113
+ */
114
+ creatorFeeRate: number;
115
+ /** Tier index used as the PDA seed. */
116
+ index: number;
117
+ /** Canonical bump of this tier's PDA. */
118
+ bump: number;
119
+ };
120
+ type AmmConfigArgs = {
121
+ /**
122
+ * Signer that may update this tier and collect protocol fees from every
123
+ * pool created under it.
124
+ */
125
+ authority: Address;
126
+ /**
127
+ * When not the default address, the only signer allowed to create pools
128
+ * under this tier. The default address leaves pool creation open to
129
+ * anyone.
130
+ */
131
+ poolCreatorAuthority: Address;
132
+ /**
133
+ * Fee charged on every swap, in parts per million of the fee base. The
134
+ * LPs keep everything the protocol does not take.
135
+ */
136
+ tradeFeeRate: number;
137
+ /**
138
+ * Share of the trade fee paid to the protocol, in parts per million of
139
+ * the trade fee.
140
+ */
141
+ protocolFeeRate: number;
142
+ /**
143
+ * Additional fee paid to the pool's creator, in parts per million of the
144
+ * fee base.
145
+ */
146
+ creatorFeeRate: number;
147
+ /** Tier index used as the PDA seed. */
148
+ index: number;
149
+ /** Canonical bump of this tier's PDA. */
150
+ bump: number;
151
+ };
152
+ /** Gets the encoder for {@link AmmConfigArgs} account data. */
153
+ declare function getAmmConfigEncoder(): FixedSizeEncoder<AmmConfigArgs>;
154
+ /** Gets the decoder for {@link AmmConfig} account data. */
155
+ declare function getAmmConfigDecoder(): FixedSizeDecoder<AmmConfig>;
156
+ /** Gets the codec for {@link AmmConfig} account data. */
157
+ declare function getAmmConfigCodec(): FixedSizeCodec<AmmConfigArgs, AmmConfig>;
158
+ declare function decodeAmmConfig<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<AmmConfig, TAddress>;
159
+ declare function decodeAmmConfig<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<AmmConfig, TAddress>;
160
+ declare function fetchAmmConfig<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<AmmConfig, TAddress>>;
161
+ declare function fetchMaybeAmmConfig<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<AmmConfig, TAddress>>;
162
+ declare function fetchAllAmmConfig(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<AmmConfig>[]>;
163
+ declare function fetchAllMaybeAmmConfig(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<AmmConfig>[]>;
164
+ declare function fetchAmmConfigFromSeeds(rpc: Parameters<typeof fetchEncodedAccount>[0], seeds: AmmConfigSeeds, config?: FetchAccountConfig & {
165
+ programAddress?: Address;
166
+ }): Promise<Account<AmmConfig>>;
167
+ declare function fetchMaybeAmmConfigFromSeeds(rpc: Parameters<typeof fetchEncodedAccount>[0], seeds: AmmConfigSeeds, config?: FetchAccountConfig & {
168
+ programAddress?: Address;
169
+ }): Promise<MaybeAccount<AmmConfig>>;
170
+ /** The account schema version this client was generated from. */
171
+ declare const AMM_CONFIG_MIGRATION_VERSION = 0;
172
+ /**
173
+ * Cheap envelope check for a fetched `AmmConfig` account: `true` only when the
174
+ * bytes name this account's discriminator and a migration version older than
175
+ * this client's schema. Those are exactly the accounts
176
+ * {@link getMigrateInstruction} can bring current; every other mismatch is
177
+ * reported by the decoder when the account is decoded.
178
+ *
179
+ * ```ts
180
+ * const account = await fetchEncodedAccount(rpc, address);
181
+ * if (account.exists && ammConfigNeedsMigration(account.data)) {
182
+ * // Migrate first, then retry the instruction that failed.
183
+ * await send(getMigrateInstruction({ ammConfig: address, payer }));
184
+ * }
185
+ * ```
186
+ */
187
+ declare function ammConfigNeedsMigration(data: ReadonlyUint8Array): boolean;
188
+
189
+ /**
190
+ * This code was AUTOGENERATED using the Codama library.
191
+ * Please DO NOT EDIT THIS FILE, instead use visitors
192
+ * to add features, then rerun Codama to update it.
193
+ *
194
+ * @see https://github.com/codama-idl/codama
195
+ */
196
+
197
+ declare const POOL_DISCRIMINATOR = 2;
198
+ declare function getPoolDiscriminatorBytes(): ReadonlyUint8Array;
199
+ declare const POOL_DISCRIMINATOR2 = 0;
200
+ declare function getPoolDiscriminator2Bytes(): ReadonlyUint8Array;
201
+ /**
202
+ * A constant-product pool for one token pair under one fee tier.
203
+ *
204
+ * `mint_0` is always the byte-wise smaller mint address, so every pair has
205
+ * exactly one canonical pool per tier.
206
+ */
207
+ type Pool = {
208
+ discriminator: number;
209
+ migrationVersion: number;
210
+ /** Fee tier this pool was created under. */
211
+ ammConfig: Address;
212
+ /** Recipient of this pool's creator fees. */
213
+ creator: Address;
214
+ /** Smaller mint of the pair. */
215
+ mint0: Address;
216
+ /** Larger mint of the pair. */
217
+ mint1: Address;
218
+ /** Pool-owned token account holding token 0. */
219
+ vault0: Address;
220
+ /** Pool-owned token account holding token 1. */
221
+ vault1: Address;
222
+ /** LP mint whose mint authority is this pool. */
223
+ lpMint: Address;
224
+ /**
225
+ * Economic LP supply, including `MINIMUM_LIQUIDITY` and any LP burned
226
+ * outside the program. Only deposits and withdrawals change it, so LP
227
+ * burned directly through the token program stays locked forever.
228
+ */
229
+ lpSupply: bigint;
230
+ /** Accrued, unpaid protocol fees held in vault 0. */
231
+ protocolFees0: bigint;
232
+ /** Accrued, unpaid protocol fees held in vault 1. */
233
+ protocolFees1: bigint;
234
+ /** Accrued, unpaid creator fees held in vault 0. */
235
+ creatorFees0: bigint;
236
+ /** Accrued, unpaid creator fees held in vault 1. */
237
+ creatorFees1: bigint;
238
+ /** Trade fee rate snapshotted from the tier, in parts per million. */
239
+ tradeFeeRate: number;
240
+ /**
241
+ * Protocol share of the trade fee snapshotted from the tier, in parts per
242
+ * million.
243
+ */
244
+ protocolFeeRate: number;
245
+ /** Creator fee rate snapshotted from the tier, in parts per million. */
246
+ creatorFeeRate: number;
247
+ /** `CreatorFeeMode` wire value. */
248
+ creatorFeeMode: number;
249
+ /** Canonical bump of this pool's PDA. */
250
+ bump: number;
251
+ };
252
+ type PoolArgs = {
253
+ /** Fee tier this pool was created under. */
254
+ ammConfig: Address;
255
+ /** Recipient of this pool's creator fees. */
256
+ creator: Address;
257
+ /** Smaller mint of the pair. */
258
+ mint0: Address;
259
+ /** Larger mint of the pair. */
260
+ mint1: Address;
261
+ /** Pool-owned token account holding token 0. */
262
+ vault0: Address;
263
+ /** Pool-owned token account holding token 1. */
264
+ vault1: Address;
265
+ /** LP mint whose mint authority is this pool. */
266
+ lpMint: Address;
267
+ /**
268
+ * Economic LP supply, including `MINIMUM_LIQUIDITY` and any LP burned
269
+ * outside the program. Only deposits and withdrawals change it, so LP
270
+ * burned directly through the token program stays locked forever.
271
+ */
272
+ lpSupply: number | bigint;
273
+ /** Accrued, unpaid protocol fees held in vault 0. */
274
+ protocolFees0: number | bigint;
275
+ /** Accrued, unpaid protocol fees held in vault 1. */
276
+ protocolFees1: number | bigint;
277
+ /** Accrued, unpaid creator fees held in vault 0. */
278
+ creatorFees0: number | bigint;
279
+ /** Accrued, unpaid creator fees held in vault 1. */
280
+ creatorFees1: number | bigint;
281
+ /** Trade fee rate snapshotted from the tier, in parts per million. */
282
+ tradeFeeRate: number;
283
+ /**
284
+ * Protocol share of the trade fee snapshotted from the tier, in parts per
285
+ * million.
286
+ */
287
+ protocolFeeRate: number;
288
+ /** Creator fee rate snapshotted from the tier, in parts per million. */
289
+ creatorFeeRate: number;
290
+ /** `CreatorFeeMode` wire value. */
291
+ creatorFeeMode: number;
292
+ /** Canonical bump of this pool's PDA. */
293
+ bump: number;
294
+ };
295
+ /** Gets the encoder for {@link PoolArgs} account data. */
296
+ declare function getPoolEncoder(): FixedSizeEncoder<PoolArgs>;
297
+ /** Gets the decoder for {@link Pool} account data. */
298
+ declare function getPoolDecoder(): FixedSizeDecoder<Pool>;
299
+ /** Gets the codec for {@link Pool} account data. */
300
+ declare function getPoolCodec(): FixedSizeCodec<PoolArgs, Pool>;
301
+ declare function decodePool<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<Pool, TAddress>;
302
+ declare function decodePool<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<Pool, TAddress>;
303
+ declare function fetchPool<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<Pool, TAddress>>;
304
+ declare function fetchMaybePool<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<Pool, TAddress>>;
305
+ declare function fetchAllPool(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<Pool>[]>;
306
+ declare function fetchAllMaybePool(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<Pool>[]>;
307
+ declare function fetchPoolFromSeeds(rpc: Parameters<typeof fetchEncodedAccount>[0], seeds: PoolSeeds, config?: FetchAccountConfig & {
308
+ programAddress?: Address;
309
+ }): Promise<Account<Pool>>;
310
+ declare function fetchMaybePoolFromSeeds(rpc: Parameters<typeof fetchEncodedAccount>[0], seeds: PoolSeeds, config?: FetchAccountConfig & {
311
+ programAddress?: Address;
312
+ }): Promise<MaybeAccount<Pool>>;
313
+ /** The account schema version this client was generated from. */
314
+ declare const POOL_MIGRATION_VERSION = 0;
315
+ /**
316
+ * Cheap envelope check for a fetched `Pool` account: `true` only when the
317
+ * bytes name this account's discriminator and a migration version older than
318
+ * this client's schema. Those are exactly the accounts
319
+ * {@link getMigrateInstruction} can bring current; every other mismatch is
320
+ * reported by the decoder when the account is decoded.
321
+ *
322
+ * ```ts
323
+ * const account = await fetchEncodedAccount(rpc, address);
324
+ * if (account.exists && poolNeedsMigration(account.data)) {
325
+ * // Migrate first, then retry the instruction that failed.
326
+ * await send(getMigrateInstruction({ pool: address, payer }));
327
+ * }
328
+ * ```
329
+ */
330
+ declare function poolNeedsMigration(data: ReadonlyUint8Array): boolean;
331
+
332
+ /**
333
+ * This code was AUTOGENERATED using the Codama library.
334
+ * Please DO NOT EDIT THIS FILE, instead use visitors
335
+ * to add features, then rerun Codama to update it.
336
+ *
337
+ * @see https://github.com/codama-idl/codama
338
+ */
339
+
340
+ /** Fee rates are out of range: trade plus creator fee above 10% or protocol share above 100%. */
341
+ declare const PINA_AMM_ERROR__INVALID_FEE_RATES = 0;
342
+ /** The signer is not the authority this instruction requires. */
343
+ declare const PINA_AMM_ERROR__UNAUTHORIZED = 1;
344
+ /** The program-data account is not this program's, or the program is not upgradeable. */
345
+ declare const PINA_AMM_ERROR__INVALID_PROGRAM_DATA = 2;
346
+ /** Pool mints must be distinct and passed in ascending byte order. */
347
+ declare const PINA_AMM_ERROR__INVALID_MINT_ORDER = 3;
348
+ /** The mint's token program or Token-2022 extensions are not supported. */
349
+ declare const PINA_AMM_ERROR__UNSUPPORTED_MINT = 4;
350
+ /** A vault, LP mint, or fee tier account does not belong to this pool. */
351
+ declare const PINA_AMM_ERROR__POOL_ACCOUNT_MISMATCH = 5;
352
+ /** The creator fee mode must be 0 (input token), 1 (token 0), or 2 (token 1). */
353
+ declare const PINA_AMM_ERROR__INVALID_CREATOR_FEE_MODE = 6;
354
+ /** The initial deposit must mint more LP than the permanently locked minimum. */
355
+ declare const PINA_AMM_ERROR__INSUFFICIENT_INITIAL_LIQUIDITY = 7;
356
+ /** An amount is zero or the trade rounds down to nothing. */
357
+ declare const PINA_AMM_ERROR__ZERO_AMOUNT = 8;
358
+ /** The result is worse than the caller's slippage limit. */
359
+ declare const PINA_AMM_ERROR__SLIPPAGE_EXCEEDED = 9;
360
+ /** The pool cannot pay this amount from its reserves. */
361
+ declare const PINA_AMM_ERROR__INSUFFICIENT_LIQUIDITY = 10;
362
+ /** An intermediate value overflowed or did not fit its type. */
363
+ declare const PINA_AMM_ERROR__MATH_OVERFLOW = 11;
364
+ /** The trade would decrease the pool's constant product. */
365
+ declare const PINA_AMM_ERROR__INVARIANT_VIOLATION = 12;
366
+ /** A vault holds less than the fees accrued against it. */
367
+ declare const PINA_AMM_ERROR__VAULT_ACCOUNTING_MISMATCH = 13;
368
+ /** This fee tier only lets its pool-creator authority create pools. */
369
+ declare const PINA_AMM_ERROR__POOL_CREATOR_NOT_AUTHORIZED = 14;
370
+ type PinaAmmError = typeof PINA_AMM_ERROR__INSUFFICIENT_INITIAL_LIQUIDITY | typeof PINA_AMM_ERROR__INSUFFICIENT_LIQUIDITY | typeof PINA_AMM_ERROR__INVALID_CREATOR_FEE_MODE | typeof PINA_AMM_ERROR__INVALID_FEE_RATES | typeof PINA_AMM_ERROR__INVALID_MINT_ORDER | typeof PINA_AMM_ERROR__INVALID_PROGRAM_DATA | typeof PINA_AMM_ERROR__INVARIANT_VIOLATION | typeof PINA_AMM_ERROR__MATH_OVERFLOW | typeof PINA_AMM_ERROR__POOL_ACCOUNT_MISMATCH | typeof PINA_AMM_ERROR__POOL_CREATOR_NOT_AUTHORIZED | typeof PINA_AMM_ERROR__SLIPPAGE_EXCEEDED | typeof PINA_AMM_ERROR__UNAUTHORIZED | typeof PINA_AMM_ERROR__UNSUPPORTED_MINT | typeof PINA_AMM_ERROR__VAULT_ACCOUNTING_MISMATCH | typeof PINA_AMM_ERROR__ZERO_AMOUNT;
371
+ declare function getPinaAmmErrorMessage(code: PinaAmmError): string;
372
+ declare function isPinaAmmError<TProgramErrorCode extends PinaAmmError>(error: unknown, transactionMessage: {
373
+ instructions: Record<number, {
374
+ programAddress: Address;
375
+ }>;
376
+ }, code?: TProgramErrorCode): error is SolanaError<typeof SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM> & Readonly<{
377
+ context: Readonly<{
378
+ code: TProgramErrorCode;
379
+ }>;
380
+ }>;
381
+
382
+ /**
383
+ * This code was AUTOGENERATED using the Codama library.
384
+ * Please DO NOT EDIT THIS FILE, instead use visitors
385
+ * to add features, then rerun Codama to update it.
386
+ *
387
+ * @see https://github.com/codama-idl/codama
388
+ */
389
+
390
+ declare const POOL_CREATED_EVENT_DISCRIMINATOR = 1;
391
+ declare function getPoolCreatedEventDiscriminatorBytes(): ReadonlyUint8Array;
392
+ declare const POOL_CREATED_EVENT_DISCRIMINATOR2 = 0;
393
+ declare function getPoolCreatedEventDiscriminator2Bytes(): ReadonlyUint8Array;
394
+ /** Emitted by `CreatePool`. */
395
+ type PoolCreatedEvent = {
396
+ discriminator: number;
397
+ migrationVersion: number;
398
+ /** The new pool. */
399
+ pool: Address;
400
+ /** Fee tier the pool was created under. */
401
+ ammConfig: Address;
402
+ /** Recipient of the pool's creator fees. */
403
+ creator: Address;
404
+ /** Smaller mint of the pair. */
405
+ mint0: Address;
406
+ /** Larger mint of the pair. */
407
+ mint1: Address;
408
+ /** The pool's LP mint. */
409
+ lpMint: Address;
410
+ /** Initial reserve of token 0. */
411
+ amount0: bigint;
412
+ /** Initial reserve of token 1. */
413
+ amount1: bigint;
414
+ /** Initial economic LP supply, including the locked minimum. */
415
+ lpSupply: bigint;
416
+ };
417
+ type PoolCreatedEventArgs = {
418
+ /** The new pool. */
419
+ pool: Address;
420
+ /** Fee tier the pool was created under. */
421
+ ammConfig: Address;
422
+ /** Recipient of the pool's creator fees. */
423
+ creator: Address;
424
+ /** Smaller mint of the pair. */
425
+ mint0: Address;
426
+ /** Larger mint of the pair. */
427
+ mint1: Address;
428
+ /** The pool's LP mint. */
429
+ lpMint: Address;
430
+ /** Initial reserve of token 0. */
431
+ amount0: number | bigint;
432
+ /** Initial reserve of token 1. */
433
+ amount1: number | bigint;
434
+ /** Initial economic LP supply, including the locked minimum. */
435
+ lpSupply: number | bigint;
436
+ };
437
+ /** Gets the encoder for {@link PoolCreatedEventArgs} event data. */
438
+ declare function getPoolCreatedEventEncoder(): FixedSizeEncoder<PoolCreatedEventArgs>;
439
+ /** Gets the decoder for {@link PoolCreatedEvent} event data. */
440
+ declare function getPoolCreatedEventDecoder(): FixedSizeDecoder<PoolCreatedEvent>;
441
+ /** Gets the codec for {@link PoolCreatedEvent} event data. */
442
+ declare function getPoolCreatedEventCodec(): FixedSizeCodec<PoolCreatedEventArgs, PoolCreatedEvent>;
443
+ /** Parses the provided bytes into {@link PoolCreatedEvent} event data. */
444
+ declare function parsePoolCreatedEvent(data: ReadonlyUint8Array | Uint8Array): PoolCreatedEvent;
445
+
446
+ /**
447
+ * This code was AUTOGENERATED using the Codama library.
448
+ * Please DO NOT EDIT THIS FILE, instead use visitors
449
+ * to add features, then rerun Codama to update it.
450
+ *
451
+ * @see https://github.com/codama-idl/codama
452
+ */
453
+
454
+ declare const SWAPPED_EVENT_DISCRIMINATOR = 2;
455
+ declare function getSwappedEventDiscriminatorBytes(): ReadonlyUint8Array;
456
+ declare const SWAPPED_EVENT_DISCRIMINATOR2 = 0;
457
+ declare function getSwappedEventDiscriminator2Bytes(): ReadonlyUint8Array;
458
+ /** Emitted by `SwapExactIn` and `SwapExactOut`. */
459
+ type SwappedEvent = {
460
+ discriminator: number;
461
+ migrationVersion: number;
462
+ /** The pool traded against. */
463
+ pool: Address;
464
+ /** The trader who signed. */
465
+ trader: Address;
466
+ /** `1` when the trader sold token 0 for token 1, `0` for the reverse. */
467
+ zeroForOne: number;
468
+ /** Tokens the trader paid. */
469
+ amountIn: bigint;
470
+ /** Tokens the trader received. */
471
+ amountOut: bigint;
472
+ /** Trade fee in the input token, including the protocol share. */
473
+ tradeFee: bigint;
474
+ /** Protocol share of the trade fee, in the input token. */
475
+ protocolFee: bigint;
476
+ /**
477
+ * Creator fee. It is in the input token when `creator_fee_on_input` is
478
+ * set and in the output token otherwise.
479
+ */
480
+ creatorFee: bigint;
481
+ /**
482
+ * `1` when `creator_fee` is denominated in the input token, `0` when it is
483
+ * in the output token.
484
+ */
485
+ creatorFeeOnInput: number;
486
+ /** Token 0 reserve after the swap. */
487
+ reserve0: bigint;
488
+ /** Token 1 reserve after the swap. */
489
+ reserve1: bigint;
490
+ };
491
+ type SwappedEventArgs = {
492
+ /** The pool traded against. */
493
+ pool: Address;
494
+ /** The trader who signed. */
495
+ trader: Address;
496
+ /** `1` when the trader sold token 0 for token 1, `0` for the reverse. */
497
+ zeroForOne: number;
498
+ /** Tokens the trader paid. */
499
+ amountIn: number | bigint;
500
+ /** Tokens the trader received. */
501
+ amountOut: number | bigint;
502
+ /** Trade fee in the input token, including the protocol share. */
503
+ tradeFee: number | bigint;
504
+ /** Protocol share of the trade fee, in the input token. */
505
+ protocolFee: number | bigint;
506
+ /**
507
+ * Creator fee. It is in the input token when `creator_fee_on_input` is
508
+ * set and in the output token otherwise.
509
+ */
510
+ creatorFee: number | bigint;
511
+ /**
512
+ * `1` when `creator_fee` is denominated in the input token, `0` when it is
513
+ * in the output token.
514
+ */
515
+ creatorFeeOnInput: number;
516
+ /** Token 0 reserve after the swap. */
517
+ reserve0: number | bigint;
518
+ /** Token 1 reserve after the swap. */
519
+ reserve1: number | bigint;
520
+ };
521
+ /** Gets the encoder for {@link SwappedEventArgs} event data. */
522
+ declare function getSwappedEventEncoder(): FixedSizeEncoder<SwappedEventArgs>;
523
+ /** Gets the decoder for {@link SwappedEvent} event data. */
524
+ declare function getSwappedEventDecoder(): FixedSizeDecoder<SwappedEvent>;
525
+ /** Gets the codec for {@link SwappedEvent} event data. */
526
+ declare function getSwappedEventCodec(): FixedSizeCodec<SwappedEventArgs, SwappedEvent>;
527
+ /** Parses the provided bytes into {@link SwappedEvent} event data. */
528
+ declare function parseSwappedEvent(data: ReadonlyUint8Array | Uint8Array): SwappedEvent;
529
+
530
+ /**
531
+ * This code was AUTOGENERATED using the Codama library.
532
+ * Please DO NOT EDIT THIS FILE, instead use visitors
533
+ * to add features, then rerun Codama to update it.
534
+ *
535
+ * @see https://github.com/codama-idl/codama
536
+ */
537
+
538
+ declare const LIQUIDITY_CHANGED_EVENT_DISCRIMINATOR = 3;
539
+ declare function getLiquidityChangedEventDiscriminatorBytes(): ReadonlyUint8Array;
540
+ declare const LIQUIDITY_CHANGED_EVENT_DISCRIMINATOR2 = 0;
541
+ declare function getLiquidityChangedEventDiscriminator2Bytes(): ReadonlyUint8Array;
542
+ /** Emitted by `Deposit` and `Withdraw`. */
543
+ type LiquidityChangedEvent = {
544
+ discriminator: number;
545
+ migrationVersion: number;
546
+ /** The pool whose liquidity changed. */
547
+ pool: Address;
548
+ /** The LP owner who signed. */
549
+ owner: Address;
550
+ /** `1` for a deposit and `0` for a withdrawal. */
551
+ isDeposit: number;
552
+ /** LP minted or burned. */
553
+ lpAmount: bigint;
554
+ /** Token 0 added or removed. */
555
+ amount0: bigint;
556
+ /** Token 1 added or removed. */
557
+ amount1: bigint;
558
+ /** Economic LP supply after the change. */
559
+ lpSupply: bigint;
560
+ };
561
+ type LiquidityChangedEventArgs = {
562
+ /** The pool whose liquidity changed. */
563
+ pool: Address;
564
+ /** The LP owner who signed. */
565
+ owner: Address;
566
+ /** `1` for a deposit and `0` for a withdrawal. */
567
+ isDeposit: number;
568
+ /** LP minted or burned. */
569
+ lpAmount: number | bigint;
570
+ /** Token 0 added or removed. */
571
+ amount0: number | bigint;
572
+ /** Token 1 added or removed. */
573
+ amount1: number | bigint;
574
+ /** Economic LP supply after the change. */
575
+ lpSupply: number | bigint;
576
+ };
577
+ /** Gets the encoder for {@link LiquidityChangedEventArgs} event data. */
578
+ declare function getLiquidityChangedEventEncoder(): FixedSizeEncoder<LiquidityChangedEventArgs>;
579
+ /** Gets the decoder for {@link LiquidityChangedEvent} event data. */
580
+ declare function getLiquidityChangedEventDecoder(): FixedSizeDecoder<LiquidityChangedEvent>;
581
+ /** Gets the codec for {@link LiquidityChangedEvent} event data. */
582
+ declare function getLiquidityChangedEventCodec(): FixedSizeCodec<LiquidityChangedEventArgs, LiquidityChangedEvent>;
583
+ /** Parses the provided bytes into {@link LiquidityChangedEvent} event data. */
584
+ declare function parseLiquidityChangedEvent(data: ReadonlyUint8Array | Uint8Array): LiquidityChangedEvent;
585
+
586
+ /**
587
+ * This code was AUTOGENERATED using the Codama library.
588
+ * Please DO NOT EDIT THIS FILE, instead use visitors
589
+ * to add features, then rerun Codama to update it.
590
+ *
591
+ * @see https://github.com/codama-idl/codama
592
+ */
593
+
594
+ declare const FEES_COLLECTED_EVENT_DISCRIMINATOR = 4;
595
+ declare function getFeesCollectedEventDiscriminatorBytes(): ReadonlyUint8Array;
596
+ declare const FEES_COLLECTED_EVENT_DISCRIMINATOR2 = 0;
597
+ declare function getFeesCollectedEventDiscriminator2Bytes(): ReadonlyUint8Array;
598
+ /** Emitted by `CollectProtocolFees` and `CollectCreatorFees`. */
599
+ type FeesCollectedEvent = {
600
+ discriminator: number;
601
+ migrationVersion: number;
602
+ /** The pool the fees were accrued in. */
603
+ pool: Address;
604
+ /** The signer who collected them. */
605
+ collector: Address;
606
+ /** `1` for protocol fees and `0` for creator fees. */
607
+ isProtocol: number;
608
+ /** Token 0 paid out. */
609
+ amount0: bigint;
610
+ /** Token 1 paid out. */
611
+ amount1: bigint;
612
+ };
613
+ type FeesCollectedEventArgs = {
614
+ /** The pool the fees were accrued in. */
615
+ pool: Address;
616
+ /** The signer who collected them. */
617
+ collector: Address;
618
+ /** `1` for protocol fees and `0` for creator fees. */
619
+ isProtocol: number;
620
+ /** Token 0 paid out. */
621
+ amount0: number | bigint;
622
+ /** Token 1 paid out. */
623
+ amount1: number | bigint;
624
+ };
625
+ /** Gets the encoder for {@link FeesCollectedEventArgs} event data. */
626
+ declare function getFeesCollectedEventEncoder(): FixedSizeEncoder<FeesCollectedEventArgs>;
627
+ /** Gets the decoder for {@link FeesCollectedEvent} event data. */
628
+ declare function getFeesCollectedEventDecoder(): FixedSizeDecoder<FeesCollectedEvent>;
629
+ /** Gets the codec for {@link FeesCollectedEvent} event data. */
630
+ declare function getFeesCollectedEventCodec(): FixedSizeCodec<FeesCollectedEventArgs, FeesCollectedEvent>;
631
+ /** Parses the provided bytes into {@link FeesCollectedEvent} event data. */
632
+ declare function parseFeesCollectedEvent(data: ReadonlyUint8Array | Uint8Array): FeesCollectedEvent;
633
+
634
+ /**
635
+ * This code was AUTOGENERATED using the Codama library and Pina's migration
636
+ * manifest. Please DO NOT EDIT THIS FILE, instead rerun client generation.
637
+ *
638
+ * Event log read path: decode `Program data:` log lines into typed events.
639
+ * A migration-aware event is decoded with the layout of the version that
640
+ * emitted it: each earlier version is its own `<Event>V<n>` event, and a
641
+ * version no event here describes fails instead of being misread.
642
+ */
643
+
644
+ /**
645
+ * Decode one `poolCreated` record: only records carrying this event's migration version decode.
646
+ */
647
+ declare function decodePoolCreatedEvent(data: ReadonlyUint8Array | Uint8Array): DecodedPoolCreatedEvent;
648
+ /** One log entry that named this event. */
649
+ type DecodedPoolCreatedEvent = {
650
+ name: "poolCreated";
651
+ data: PoolCreatedEvent;
652
+ };
653
+ /**
654
+ * Decode a `Program data:` log line, or return `null` when the line is not
655
+ * this event.
656
+ */
657
+ declare function parsePoolCreatedEventFromLog(log: string): DecodedPoolCreatedEvent | null;
658
+ /**
659
+ * Decode one `swapped` record: only records carrying this event's migration version decode.
660
+ */
661
+ declare function decodeSwappedEvent(data: ReadonlyUint8Array | Uint8Array): DecodedSwappedEvent;
662
+ /** One log entry that named this event. */
663
+ type DecodedSwappedEvent = {
664
+ name: "swapped";
665
+ data: SwappedEvent;
666
+ };
667
+ /**
668
+ * Decode a `Program data:` log line, or return `null` when the line is not
669
+ * this event.
670
+ */
671
+ declare function parseSwappedEventFromLog(log: string): DecodedSwappedEvent | null;
672
+ /**
673
+ * Decode one `liquidityChanged` record: only records carrying this event's migration version decode.
674
+ */
675
+ declare function decodeLiquidityChangedEvent(data: ReadonlyUint8Array | Uint8Array): DecodedLiquidityChangedEvent;
676
+ /** One log entry that named this event. */
677
+ type DecodedLiquidityChangedEvent = {
678
+ name: "liquidityChanged";
679
+ data: LiquidityChangedEvent;
680
+ };
681
+ /**
682
+ * Decode a `Program data:` log line, or return `null` when the line is not
683
+ * this event.
684
+ */
685
+ declare function parseLiquidityChangedEventFromLog(log: string): DecodedLiquidityChangedEvent | null;
686
+ /**
687
+ * Decode one `feesCollected` record: only records carrying this event's migration version decode.
688
+ */
689
+ declare function decodeFeesCollectedEvent(data: ReadonlyUint8Array | Uint8Array): DecodedFeesCollectedEvent;
690
+ /** One log entry that named this event. */
691
+ type DecodedFeesCollectedEvent = {
692
+ name: "feesCollected";
693
+ data: FeesCollectedEvent;
694
+ };
695
+ /**
696
+ * Decode a `Program data:` log line, or return `null` when the line is not
697
+ * this event.
698
+ */
699
+ declare function parseFeesCollectedEventFromLog(log: string): DecodedFeesCollectedEvent | null;
700
+ /** Every event this program can emit, as decoded from a log line. */
701
+ type DecodedPinaAmmEvent = DecodedPoolCreatedEvent | DecodedSwappedEvent | DecodedLiquidityChangedEvent | DecodedFeesCollectedEvent;
702
+ /** The program whose invocation frames emit the events decoded here. */
703
+ declare const PINA_AMM_EVENT_SOURCE_ADDRESS = "pAMMvXaqR2VVFqznf6dgvUFQjLXXAEeL9cb48cXsGeV";
704
+ /**
705
+ * Decode every `Program data:` line this program emitted in a transaction's
706
+ * logs.
707
+ *
708
+ * `logs` must be the complete, ordered log messages of one transaction. The
709
+ * parser follows the runtime's `Program <address> invoke [n]` and
710
+ * `Program <address> success` / `failed` frames and decodes a data line only
711
+ * while `programAddress` is the innermost invoked program. Any program can
712
+ * write a `Program data:` line with this program's discriminator, so data
713
+ * lines from other programs (including ones this program invokes through CPI)
714
+ * and lines outside any frame are skipped rather than trusted.
715
+ *
716
+ * Unrelated lines are skipped. A line this program emitted that names an event
717
+ * but carries a version no generated event describes throws instead of being
718
+ * silently dropped. The per-event `parse*FromLog` helpers decode one line
719
+ * without this attribution and are only safe for data already known to come
720
+ * from this program.
721
+ */
722
+ declare function parsePinaAmmEventsFromLogs(logs: readonly string[], programAddress?: string): DecodedPinaAmmEvent[];
723
+
724
+ /**
725
+ * This code was AUTOGENERATED using the Codama library.
726
+ * Please DO NOT EDIT THIS FILE, instead use visitors
727
+ * to add features, then rerun Codama to update it.
728
+ *
729
+ * @see https://github.com/codama-idl/codama
730
+ */
731
+
732
+ declare const PINA_AMM_PROGRAM_ADDRESS: Address<"pAMMvXaqR2VVFqznf6dgvUFQjLXXAEeL9cb48cXsGeV">;
733
+ declare enum PinaAmmAccount {
734
+ AmmConfig = 0,
735
+ Pool = 1
736
+ }
737
+ declare function identifyPinaAmmAccount(account: {
738
+ data: ReadonlyUint8Array;
739
+ } | ReadonlyUint8Array): PinaAmmAccount;
740
+ declare enum PinaAmmEvent {
741
+ PoolCreated = 0,
742
+ Swapped = 1,
743
+ LiquidityChanged = 2,
744
+ FeesCollected = 3
745
+ }
746
+ declare function identifyPinaAmmEvent(event: {
747
+ data: ReadonlyUint8Array;
748
+ } | ReadonlyUint8Array): PinaAmmEvent;
749
+ declare enum PinaAmmInstruction {
750
+ CreateConfig = 0,
751
+ UpdateConfig = 1,
752
+ CreatePool = 2,
753
+ Deposit = 3,
754
+ Withdraw = 4,
755
+ SwapExactIn = 5,
756
+ SwapExactOut = 6,
757
+ CollectProtocolFees = 7,
758
+ CollectCreatorFees = 8,
759
+ SetPoolCreator = 9
760
+ }
761
+ declare function identifyPinaAmmInstruction(instruction: {
762
+ data: ReadonlyUint8Array;
763
+ } | ReadonlyUint8Array): PinaAmmInstruction;
764
+ type ParsedPinaAmmInstruction<TProgram extends string = 'pAMMvXaqR2VVFqznf6dgvUFQjLXXAEeL9cb48cXsGeV'> = {
765
+ instructionType: PinaAmmInstruction.CreateConfig;
766
+ } & ParsedCreateConfigInstruction<TProgram> | {
767
+ instructionType: PinaAmmInstruction.UpdateConfig;
768
+ } & ParsedUpdateConfigInstruction<TProgram> | {
769
+ instructionType: PinaAmmInstruction.CreatePool;
770
+ } & ParsedCreatePoolInstruction<TProgram> | {
771
+ instructionType: PinaAmmInstruction.Deposit;
772
+ } & ParsedDepositInstruction<TProgram> | {
773
+ instructionType: PinaAmmInstruction.Withdraw;
774
+ } & ParsedWithdrawInstruction<TProgram> | {
775
+ instructionType: PinaAmmInstruction.SwapExactIn;
776
+ } & ParsedSwapExactInInstruction<TProgram> | {
777
+ instructionType: PinaAmmInstruction.SwapExactOut;
778
+ } & ParsedSwapExactOutInstruction<TProgram> | {
779
+ instructionType: PinaAmmInstruction.CollectProtocolFees;
780
+ } & ParsedCollectProtocolFeesInstruction<TProgram> | {
781
+ instructionType: PinaAmmInstruction.CollectCreatorFees;
782
+ } & ParsedCollectCreatorFeesInstruction<TProgram> | {
783
+ instructionType: PinaAmmInstruction.SetPoolCreator;
784
+ } & ParsedSetPoolCreatorInstruction<TProgram>;
785
+ declare function parsePinaAmmInstruction<TProgram extends string>(instruction: Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array>): ParsedPinaAmmInstruction<TProgram>;
786
+ type PinaAmmPlugin = {
787
+ accounts: PinaAmmPluginAccounts;
788
+ instructions: PinaAmmPluginInstructions;
789
+ pdas: PinaAmmPluginPdas;
790
+ identifyAccount: typeof identifyPinaAmmAccount;
791
+ identifyInstruction: typeof identifyPinaAmmInstruction;
792
+ parseInstruction: typeof parsePinaAmmInstruction;
793
+ };
794
+ type PinaAmmPluginAccounts = {
795
+ ammConfig: ReturnType<typeof getAmmConfigCodec> & SelfFetchFunctions<AmmConfigArgs, AmmConfig>;
796
+ pool: ReturnType<typeof getPoolCodec> & SelfFetchFunctions<PoolArgs, Pool>;
797
+ };
798
+ type PinaAmmPluginInstructions = {
799
+ createConfig: (input: CreateConfigInput) => ReturnType<typeof getCreateConfigInstruction> & SelfPlanAndSendFunctions;
800
+ updateConfig: (input: UpdateConfigInput) => ReturnType<typeof getUpdateConfigInstruction> & SelfPlanAndSendFunctions;
801
+ createPool: (input: CreatePoolAsyncInput) => ReturnType<typeof getCreatePoolInstructionAsync> & SelfPlanAndSendFunctions;
802
+ deposit: (input: DepositInput) => ReturnType<typeof getDepositInstruction> & SelfPlanAndSendFunctions;
803
+ withdraw: (input: WithdrawInput) => ReturnType<typeof getWithdrawInstruction> & SelfPlanAndSendFunctions;
804
+ swapExactIn: (input: SwapExactInInput) => ReturnType<typeof getSwapExactInInstruction> & SelfPlanAndSendFunctions;
805
+ swapExactOut: (input: SwapExactOutInput) => ReturnType<typeof getSwapExactOutInstruction> & SelfPlanAndSendFunctions;
806
+ collectProtocolFees: (input: CollectProtocolFeesInput) => ReturnType<typeof getCollectProtocolFeesInstruction> & SelfPlanAndSendFunctions;
807
+ collectCreatorFees: (input: CollectCreatorFeesInput) => ReturnType<typeof getCollectCreatorFeesInstruction> & SelfPlanAndSendFunctions;
808
+ setPoolCreator: (input: SetPoolCreatorInput) => ReturnType<typeof getSetPoolCreatorInstruction> & SelfPlanAndSendFunctions;
809
+ };
810
+ type PinaAmmPluginPdas = {
811
+ ammConfig: typeof findAmmConfigPda;
812
+ pool: typeof findPoolPda;
813
+ poolVault: typeof findPoolVaultPda;
814
+ poolLpMint: typeof findPoolLpMintPda;
815
+ };
816
+ type PinaAmmPluginRequirements = ClientWithRpc<GetAccountInfoApi & GetMultipleAccountsApi> & ClientWithTransactionPlanning & ClientWithTransactionSending;
817
+ declare function pinaAmmProgram(): <T extends PinaAmmPluginRequirements>(client: T) => ExtendedClient<T, {
818
+ pinaAmm: PinaAmmPlugin;
819
+ }>;
820
+
821
+ /**
822
+ * This code was AUTOGENERATED using the Codama library.
823
+ * Please DO NOT EDIT THIS FILE, instead use visitors
824
+ * to add features, then rerun Codama to update it.
825
+ *
826
+ * @see https://github.com/codama-idl/codama
827
+ *
828
+ * The framework-owned `Migrate` instruction: it runs the program's on-demand
829
+ * account migrations on their own, so the payer authorizes exactly the
830
+ * migration cost and the business instruction that follows sees current
831
+ * data. The intended flow around any instruction that failed with a
832
+ * migration version mismatch is catch -> migrate -> retry.
833
+ */
834
+
835
+ /** Discriminator reserved by Pina for the framework `Migrate` instruction. */
836
+ declare const MIGRATE_DISCRIMINATOR = 255;
837
+ declare function getMigrateDiscriminatorBytes(): ReadonlyUint8Array;
838
+ type MigrateInstruction<TProgram extends string = typeof PINA_AMM_PROGRAM_ADDRESS, TAccountPayer extends string | AccountMeta<string> = string, TAccountSystemProgram extends string | AccountMeta<string> = string, TAccountAmmConfig extends string | AccountMeta<string> = string, TAccountPool extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
839
+ TAccountPayer extends string ? WritableSignerAccount<TAccountPayer> & AccountSignerMeta<TAccountPayer> : TAccountPayer,
840
+ TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
841
+ TAccountAmmConfig extends string ? WritableAccount<TAccountAmmConfig> : TAccountAmmConfig,
842
+ TAccountPool extends string ? WritableAccount<TAccountPool> : TAccountPool,
843
+ ...TRemainingAccounts
844
+ ]>;
845
+ type MigrateInput<TAccountPayer extends string = string, TAccountSystemProgram extends string = string, TAccountAmmConfig extends string = string, TAccountPool extends string = string> = {
846
+ payer?: TransactionSigner<TAccountPayer>;
847
+ systemProgram?: Address<TAccountSystemProgram>;
848
+ ammConfig?: Address<TAccountAmmConfig>;
849
+ pool?: Address<TAccountPool>;
850
+ };
851
+ /**
852
+ * Composes the reserved `Migrate` instruction.
853
+ *
854
+ * Every migratable account is optional: omitted slots are filled with the
855
+ * program-address placeholder and trailing omitted slots are dropped, so a
856
+ * client sends only the accounts it needs to migrate. The `payer` funds rent
857
+ * deficits and must be a writable signer; omit it when no migration needs
858
+ * funding. `systemProgram` defaults to the system program, the only account
859
+ * the program accepts in that slot. The program caps the whole
860
+ * instruction's rent transfers at a program-chosen lamport budget.
861
+ */
862
+ declare function getMigrateInstruction<TAccountPayer extends string = string, TAccountSystemProgram extends string = string, TAccountAmmConfig extends string = string, TAccountPool extends string = string, TProgramAddress extends Address = typeof PINA_AMM_PROGRAM_ADDRESS>(input: MigrateInput<TAccountPayer, TAccountSystemProgram, TAccountAmmConfig, TAccountPool>, config?: {
863
+ programAddress?: TProgramAddress;
864
+ }): MigrateInstruction<TProgramAddress, TAccountPayer, TAccountSystemProgram, TAccountAmmConfig, TAccountPool>;
865
+
866
+ /**
867
+ * This code was AUTOGENERATED using the Codama library.
868
+ * Please DO NOT EDIT THIS FILE, instead use visitors
869
+ * to add features, then rerun Codama to update it.
870
+ *
871
+ * @see https://github.com/codama-idl/codama
872
+ */
873
+
874
+ declare const COLLECT_CREATOR_FEES_DISCRIMINATOR = 8;
875
+ declare function getCollectCreatorFeesDiscriminatorBytes(): ReadonlyUint8Array;
876
+ type CollectCreatorFeesInstruction<TProgram extends string = typeof PINA_AMM_PROGRAM_ADDRESS, TAccountCreator extends string | AccountMeta<string> = string, TAccountPool extends string | AccountMeta<string> = string, TAccountVault0 extends string | AccountMeta<string> = string, TAccountVault1 extends string | AccountMeta<string> = string, TAccountRecipientToken0 extends string | AccountMeta<string> = string, TAccountRecipientToken1 extends string | AccountMeta<string> = string, TAccountTokenProgram0 extends string | AccountMeta<string> = string, TAccountTokenProgram1 extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[TAccountCreator extends string ? ReadonlySignerAccount<TAccountCreator> & AccountSignerMeta<TAccountCreator> : TAccountCreator, TAccountPool extends string ? WritableAccount<TAccountPool> : TAccountPool, TAccountVault0 extends string ? WritableAccount<TAccountVault0> : TAccountVault0, TAccountVault1 extends string ? WritableAccount<TAccountVault1> : TAccountVault1, TAccountRecipientToken0 extends string ? WritableAccount<TAccountRecipientToken0> : TAccountRecipientToken0, TAccountRecipientToken1 extends string ? WritableAccount<TAccountRecipientToken1> : TAccountRecipientToken1, TAccountTokenProgram0 extends string ? ReadonlyAccount<TAccountTokenProgram0> : TAccountTokenProgram0, TAccountTokenProgram1 extends string ? ReadonlyAccount<TAccountTokenProgram1> : TAccountTokenProgram1, ...TRemainingAccounts]>;
877
+ type CollectCreatorFeesInstructionData = {
878
+ discriminator: number;
879
+ /** Most token 0 to collect; `u64::MAX` collects everything accrued. */
880
+ maximumAmount0: bigint;
881
+ /** Most token 1 to collect; `u64::MAX` collects everything accrued. */
882
+ maximumAmount1: bigint;
883
+ };
884
+ type CollectCreatorFeesInstructionDataArgs = {
885
+ /** Most token 0 to collect; `u64::MAX` collects everything accrued. */
886
+ maximumAmount0: number | bigint;
887
+ /** Most token 1 to collect; `u64::MAX` collects everything accrued. */
888
+ maximumAmount1: number | bigint;
889
+ };
890
+ declare function getCollectCreatorFeesInstructionDataEncoder(): FixedSizeEncoder<CollectCreatorFeesInstructionDataArgs>;
891
+ declare function getCollectCreatorFeesInstructionDataDecoder(): FixedSizeDecoder<CollectCreatorFeesInstructionData>;
892
+ declare function getCollectCreatorFeesInstructionDataCodec(): FixedSizeCodec<CollectCreatorFeesInstructionDataArgs, CollectCreatorFeesInstructionData>;
893
+ type CollectCreatorFeesInput<TAccountCreator extends InstructionSignerInput = InstructionSignerInput, TAccountPool extends InstructionAccountInput = InstructionAccountInput, TAccountVault0 extends InstructionAccountInput = InstructionAccountInput, TAccountVault1 extends InstructionAccountInput = InstructionAccountInput, TAccountRecipientToken0 extends InstructionAccountInput = InstructionAccountInput, TAccountRecipientToken1 extends InstructionAccountInput = InstructionAccountInput, TAccountTokenProgram0 extends InstructionAccountInput = InstructionAccountInput, TAccountTokenProgram1 extends InstructionAccountInput = InstructionAccountInput> = {
894
+ /** The pool's creator. */
895
+ creator: TAccountCreator;
896
+ /** The pool. */
897
+ pool: TAccountPool;
898
+ /** The pool's token 0 vault. */
899
+ vault0: TAccountVault0;
900
+ /** The pool's token 1 vault. */
901
+ vault1: TAccountVault1;
902
+ /** Token 0 account that receives the fees. */
903
+ recipientToken0: TAccountRecipientToken0;
904
+ /** Token 1 account that receives the fees. */
905
+ recipientToken1: TAccountRecipientToken1;
906
+ /** Token program that owns token 0. */
907
+ tokenProgram0: TAccountTokenProgram0;
908
+ /** Token program that owns token 1. */
909
+ tokenProgram1: TAccountTokenProgram1;
910
+ maximumAmount0: CollectCreatorFeesInstructionDataArgs["maximumAmount0"];
911
+ maximumAmount1: CollectCreatorFeesInstructionDataArgs["maximumAmount1"];
912
+ };
913
+ declare function getCollectCreatorFeesInstruction<TAccountCreator extends InstructionSignerInput, TAccountPool extends InstructionAccountInput, TAccountVault0 extends InstructionAccountInput, TAccountVault1 extends InstructionAccountInput, TAccountRecipientToken0 extends InstructionAccountInput, TAccountRecipientToken1 extends InstructionAccountInput, TAccountTokenProgram0 extends InstructionAccountInput, TAccountTokenProgram1 extends InstructionAccountInput, TProgramAddress extends Address = typeof PINA_AMM_PROGRAM_ADDRESS>(input: CollectCreatorFeesInput<TAccountCreator, TAccountPool, TAccountVault0, TAccountVault1, TAccountRecipientToken0, TAccountRecipientToken1, TAccountTokenProgram0, TAccountTokenProgram1>, config?: {
914
+ programAddress?: TProgramAddress;
915
+ }): CollectCreatorFeesInstruction<TProgramAddress, ResolvedInstructionAccountMeta<TAccountCreator, InstructionAccountInputAddress<TAccountCreator>>, ResolvedInstructionAccountMeta<TAccountPool, InstructionAccountInputAddress<TAccountPool>>, ResolvedInstructionAccountMeta<TAccountVault0, InstructionAccountInputAddress<TAccountVault0>>, ResolvedInstructionAccountMeta<TAccountVault1, InstructionAccountInputAddress<TAccountVault1>>, ResolvedInstructionAccountMeta<TAccountRecipientToken0, InstructionAccountInputAddress<TAccountRecipientToken0>>, ResolvedInstructionAccountMeta<TAccountRecipientToken1, InstructionAccountInputAddress<TAccountRecipientToken1>>, ResolvedInstructionAccountMeta<TAccountTokenProgram0, InstructionAccountInputAddress<TAccountTokenProgram0>>, ResolvedInstructionAccountMeta<TAccountTokenProgram1, InstructionAccountInputAddress<TAccountTokenProgram1>>>;
916
+ type ParsedCollectCreatorFeesInstruction<TProgram extends string = typeof PINA_AMM_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
917
+ programAddress: Address<TProgram>;
918
+ accounts: {
919
+ /** The pool's creator. */
920
+ creator: TAccountMetas[0];
921
+ /** The pool. */
922
+ pool: TAccountMetas[1];
923
+ /** The pool's token 0 vault. */
924
+ vault0: TAccountMetas[2];
925
+ /** The pool's token 1 vault. */
926
+ vault1: TAccountMetas[3];
927
+ /** Token 0 account that receives the fees. */
928
+ recipientToken0: TAccountMetas[4];
929
+ /** Token 1 account that receives the fees. */
930
+ recipientToken1: TAccountMetas[5];
931
+ /** Token program that owns token 0. */
932
+ tokenProgram0: TAccountMetas[6];
933
+ /** Token program that owns token 1. */
934
+ tokenProgram1: TAccountMetas[7];
935
+ };
936
+ data: CollectCreatorFeesInstructionData;
937
+ };
938
+ declare function parseCollectCreatorFeesInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedCollectCreatorFeesInstruction<TProgram, TAccountMetas>;
939
+
940
+ /**
941
+ * This code was AUTOGENERATED using the Codama library.
942
+ * Please DO NOT EDIT THIS FILE, instead use visitors
943
+ * to add features, then rerun Codama to update it.
944
+ *
945
+ * @see https://github.com/codama-idl/codama
946
+ */
947
+
948
+ declare const COLLECT_PROTOCOL_FEES_DISCRIMINATOR = 7;
949
+ declare function getCollectProtocolFeesDiscriminatorBytes(): ReadonlyUint8Array;
950
+ type CollectProtocolFeesInstruction<TProgram extends string = typeof PINA_AMM_PROGRAM_ADDRESS, TAccountAuthority extends string | AccountMeta<string> = string, TAccountAmmConfig extends string | AccountMeta<string> = string, TAccountPool extends string | AccountMeta<string> = string, TAccountVault0 extends string | AccountMeta<string> = string, TAccountVault1 extends string | AccountMeta<string> = string, TAccountRecipientToken0 extends string | AccountMeta<string> = string, TAccountRecipientToken1 extends string | AccountMeta<string> = string, TAccountTokenProgram0 extends string | AccountMeta<string> = string, TAccountTokenProgram1 extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[TAccountAuthority extends string ? ReadonlySignerAccount<TAccountAuthority> & AccountSignerMeta<TAccountAuthority> : TAccountAuthority, TAccountAmmConfig extends string ? ReadonlyAccount<TAccountAmmConfig> : TAccountAmmConfig, TAccountPool extends string ? WritableAccount<TAccountPool> : TAccountPool, TAccountVault0 extends string ? WritableAccount<TAccountVault0> : TAccountVault0, TAccountVault1 extends string ? WritableAccount<TAccountVault1> : TAccountVault1, TAccountRecipientToken0 extends string ? WritableAccount<TAccountRecipientToken0> : TAccountRecipientToken0, TAccountRecipientToken1 extends string ? WritableAccount<TAccountRecipientToken1> : TAccountRecipientToken1, TAccountTokenProgram0 extends string ? ReadonlyAccount<TAccountTokenProgram0> : TAccountTokenProgram0, TAccountTokenProgram1 extends string ? ReadonlyAccount<TAccountTokenProgram1> : TAccountTokenProgram1, ...TRemainingAccounts]>;
951
+ type CollectProtocolFeesInstructionData = {
952
+ discriminator: number;
953
+ /** Most token 0 to collect; `u64::MAX` collects everything accrued. */
954
+ maximumAmount0: bigint;
955
+ /** Most token 1 to collect; `u64::MAX` collects everything accrued. */
956
+ maximumAmount1: bigint;
957
+ };
958
+ type CollectProtocolFeesInstructionDataArgs = {
959
+ /** Most token 0 to collect; `u64::MAX` collects everything accrued. */
960
+ maximumAmount0: number | bigint;
961
+ /** Most token 1 to collect; `u64::MAX` collects everything accrued. */
962
+ maximumAmount1: number | bigint;
963
+ };
964
+ declare function getCollectProtocolFeesInstructionDataEncoder(): FixedSizeEncoder<CollectProtocolFeesInstructionDataArgs>;
965
+ declare function getCollectProtocolFeesInstructionDataDecoder(): FixedSizeDecoder<CollectProtocolFeesInstructionData>;
966
+ declare function getCollectProtocolFeesInstructionDataCodec(): FixedSizeCodec<CollectProtocolFeesInstructionDataArgs, CollectProtocolFeesInstructionData>;
967
+ type CollectProtocolFeesInput<TAccountAuthority extends InstructionSignerInput = InstructionSignerInput, TAccountAmmConfig extends InstructionAccountInput = InstructionAccountInput, TAccountPool extends InstructionAccountInput = InstructionAccountInput, TAccountVault0 extends InstructionAccountInput = InstructionAccountInput, TAccountVault1 extends InstructionAccountInput = InstructionAccountInput, TAccountRecipientToken0 extends InstructionAccountInput = InstructionAccountInput, TAccountRecipientToken1 extends InstructionAccountInput = InstructionAccountInput, TAccountTokenProgram0 extends InstructionAccountInput = InstructionAccountInput, TAccountTokenProgram1 extends InstructionAccountInput = InstructionAccountInput> = {
968
+ /** The pool's fee-tier authority. */
969
+ authority: TAccountAuthority;
970
+ /** The pool's fee tier. */
971
+ ammConfig: TAccountAmmConfig;
972
+ /** The pool. */
973
+ pool: TAccountPool;
974
+ /** The pool's token 0 vault. */
975
+ vault0: TAccountVault0;
976
+ /** The pool's token 1 vault. */
977
+ vault1: TAccountVault1;
978
+ /** Token 0 account that receives the fees. */
979
+ recipientToken0: TAccountRecipientToken0;
980
+ /** Token 1 account that receives the fees. */
981
+ recipientToken1: TAccountRecipientToken1;
982
+ /** Token program that owns token 0. */
983
+ tokenProgram0: TAccountTokenProgram0;
984
+ /** Token program that owns token 1. */
985
+ tokenProgram1: TAccountTokenProgram1;
986
+ maximumAmount0: CollectProtocolFeesInstructionDataArgs["maximumAmount0"];
987
+ maximumAmount1: CollectProtocolFeesInstructionDataArgs["maximumAmount1"];
988
+ };
989
+ declare function getCollectProtocolFeesInstruction<TAccountAuthority extends InstructionSignerInput, TAccountAmmConfig extends InstructionAccountInput, TAccountPool extends InstructionAccountInput, TAccountVault0 extends InstructionAccountInput, TAccountVault1 extends InstructionAccountInput, TAccountRecipientToken0 extends InstructionAccountInput, TAccountRecipientToken1 extends InstructionAccountInput, TAccountTokenProgram0 extends InstructionAccountInput, TAccountTokenProgram1 extends InstructionAccountInput, TProgramAddress extends Address = typeof PINA_AMM_PROGRAM_ADDRESS>(input: CollectProtocolFeesInput<TAccountAuthority, TAccountAmmConfig, TAccountPool, TAccountVault0, TAccountVault1, TAccountRecipientToken0, TAccountRecipientToken1, TAccountTokenProgram0, TAccountTokenProgram1>, config?: {
990
+ programAddress?: TProgramAddress;
991
+ }): CollectProtocolFeesInstruction<TProgramAddress, ResolvedInstructionAccountMeta<TAccountAuthority, InstructionAccountInputAddress<TAccountAuthority>>, ResolvedInstructionAccountMeta<TAccountAmmConfig, InstructionAccountInputAddress<TAccountAmmConfig>>, ResolvedInstructionAccountMeta<TAccountPool, InstructionAccountInputAddress<TAccountPool>>, ResolvedInstructionAccountMeta<TAccountVault0, InstructionAccountInputAddress<TAccountVault0>>, ResolvedInstructionAccountMeta<TAccountVault1, InstructionAccountInputAddress<TAccountVault1>>, ResolvedInstructionAccountMeta<TAccountRecipientToken0, InstructionAccountInputAddress<TAccountRecipientToken0>>, ResolvedInstructionAccountMeta<TAccountRecipientToken1, InstructionAccountInputAddress<TAccountRecipientToken1>>, ResolvedInstructionAccountMeta<TAccountTokenProgram0, InstructionAccountInputAddress<TAccountTokenProgram0>>, ResolvedInstructionAccountMeta<TAccountTokenProgram1, InstructionAccountInputAddress<TAccountTokenProgram1>>>;
992
+ type ParsedCollectProtocolFeesInstruction<TProgram extends string = typeof PINA_AMM_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
993
+ programAddress: Address<TProgram>;
994
+ accounts: {
995
+ /** The pool's fee-tier authority. */
996
+ authority: TAccountMetas[0];
997
+ /** The pool's fee tier. */
998
+ ammConfig: TAccountMetas[1];
999
+ /** The pool. */
1000
+ pool: TAccountMetas[2];
1001
+ /** The pool's token 0 vault. */
1002
+ vault0: TAccountMetas[3];
1003
+ /** The pool's token 1 vault. */
1004
+ vault1: TAccountMetas[4];
1005
+ /** Token 0 account that receives the fees. */
1006
+ recipientToken0: TAccountMetas[5];
1007
+ /** Token 1 account that receives the fees. */
1008
+ recipientToken1: TAccountMetas[6];
1009
+ /** Token program that owns token 0. */
1010
+ tokenProgram0: TAccountMetas[7];
1011
+ /** Token program that owns token 1. */
1012
+ tokenProgram1: TAccountMetas[8];
1013
+ };
1014
+ data: CollectProtocolFeesInstructionData;
1015
+ };
1016
+ declare function parseCollectProtocolFeesInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedCollectProtocolFeesInstruction<TProgram, TAccountMetas>;
1017
+
1018
+ /**
1019
+ * This code was AUTOGENERATED using the Codama library.
1020
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1021
+ * to add features, then rerun Codama to update it.
1022
+ *
1023
+ * @see https://github.com/codama-idl/codama
1024
+ */
1025
+
1026
+ declare const CREATE_CONFIG_DISCRIMINATOR = 0;
1027
+ declare function getCreateConfigDiscriminatorBytes(): ReadonlyUint8Array;
1028
+ type CreateConfigInstruction<TProgram extends string = typeof PINA_AMM_PROGRAM_ADDRESS, TAccountPayer extends string | AccountMeta<string> = string, TAccountUpgradeAuthority extends string | AccountMeta<string> = string, TAccountProgramData extends string | AccountMeta<string> = string, TAccountAmmConfig extends string | AccountMeta<string> = string, TAccountSystemProgram extends string | AccountMeta<string> = "11111111111111111111111111111111", TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[TAccountPayer extends string ? WritableSignerAccount<TAccountPayer> & AccountSignerMeta<TAccountPayer> : TAccountPayer, TAccountUpgradeAuthority extends string ? ReadonlySignerAccount<TAccountUpgradeAuthority> & AccountSignerMeta<TAccountUpgradeAuthority> : TAccountUpgradeAuthority, TAccountProgramData extends string ? ReadonlyAccount<TAccountProgramData> : TAccountProgramData, TAccountAmmConfig extends string ? WritableAccount<TAccountAmmConfig> : TAccountAmmConfig, TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram, ...TRemainingAccounts]>;
1029
+ type CreateConfigInstructionData = {
1030
+ discriminator: number;
1031
+ /** Tier index; also the PDA seed. */
1032
+ index: number;
1033
+ /** Swap fee in parts per million. */
1034
+ tradeFeeRate: number;
1035
+ /** Protocol share of the trade fee in parts per million. */
1036
+ protocolFeeRate: number;
1037
+ /** Creator fee in parts per million. */
1038
+ creatorFeeRate: number;
1039
+ /** Signer that may update the tier and collect its protocol fees. */
1040
+ authority: Address;
1041
+ /**
1042
+ * The only signer allowed to create pools in this tier, or the default
1043
+ * address to let anyone create pools.
1044
+ */
1045
+ poolCreatorAuthority: Address;
1046
+ };
1047
+ type CreateConfigInstructionDataArgs = {
1048
+ /** Tier index; also the PDA seed. */
1049
+ index: number;
1050
+ /** Swap fee in parts per million. */
1051
+ tradeFeeRate: number;
1052
+ /** Protocol share of the trade fee in parts per million. */
1053
+ protocolFeeRate: number;
1054
+ /** Creator fee in parts per million. */
1055
+ creatorFeeRate: number;
1056
+ /** Signer that may update the tier and collect its protocol fees. */
1057
+ authority: Address;
1058
+ /**
1059
+ * The only signer allowed to create pools in this tier, or the default
1060
+ * address to let anyone create pools.
1061
+ */
1062
+ poolCreatorAuthority: Address;
1063
+ };
1064
+ declare function getCreateConfigInstructionDataEncoder(): FixedSizeEncoder<CreateConfigInstructionDataArgs>;
1065
+ declare function getCreateConfigInstructionDataDecoder(): FixedSizeDecoder<CreateConfigInstructionData>;
1066
+ declare function getCreateConfigInstructionDataCodec(): FixedSizeCodec<CreateConfigInstructionDataArgs, CreateConfigInstructionData>;
1067
+ type CreateConfigInput<TAccountPayer extends InstructionSignerInput = InstructionSignerInput, TAccountUpgradeAuthority extends InstructionSignerInput = InstructionSignerInput, TAccountProgramData extends InstructionAccountInput = InstructionAccountInput, TAccountAmmConfig extends InstructionAccountInput = InstructionAccountInput, TAccountSystemProgram extends InstructionAccountInput = InstructionAccountInput> = {
1068
+ /** Pays the new tier's rent. */
1069
+ payer: TAccountPayer;
1070
+ /** The program's upgrade authority. */
1071
+ upgradeAuthority: TAccountUpgradeAuthority;
1072
+ /**
1073
+ * The program's program-data account, which records its upgrade
1074
+ * authority.
1075
+ */
1076
+ programData: TAccountProgramData;
1077
+ /** The tier PDA to create: `[b"amm_config", index]`. */
1078
+ ammConfig: TAccountAmmConfig;
1079
+ /** The system program. */
1080
+ systemProgram?: TAccountSystemProgram;
1081
+ index: CreateConfigInstructionDataArgs["index"];
1082
+ tradeFeeRate: CreateConfigInstructionDataArgs["tradeFeeRate"];
1083
+ protocolFeeRate: CreateConfigInstructionDataArgs["protocolFeeRate"];
1084
+ creatorFeeRate: CreateConfigInstructionDataArgs["creatorFeeRate"];
1085
+ authority: CreateConfigInstructionDataArgs["authority"];
1086
+ poolCreatorAuthority: CreateConfigInstructionDataArgs["poolCreatorAuthority"];
1087
+ };
1088
+ declare function getCreateConfigInstruction<TAccountPayer extends InstructionSignerInput, TAccountUpgradeAuthority extends InstructionSignerInput, TAccountProgramData extends InstructionAccountInput, TAccountAmmConfig extends InstructionAccountInput, TAccountSystemProgram extends InstructionAccountInput, TProgramAddress extends Address = typeof PINA_AMM_PROGRAM_ADDRESS>(input: CreateConfigInput<TAccountPayer, TAccountUpgradeAuthority, TAccountProgramData, TAccountAmmConfig, TAccountSystemProgram>, config?: {
1089
+ programAddress?: TProgramAddress;
1090
+ }): CreateConfigInstruction<TProgramAddress, ResolvedInstructionAccountMeta<TAccountPayer, InstructionAccountInputAddress<TAccountPayer>>, ResolvedInstructionAccountMeta<TAccountUpgradeAuthority, InstructionAccountInputAddress<TAccountUpgradeAuthority>>, ResolvedInstructionAccountMeta<TAccountProgramData, InstructionAccountInputAddress<TAccountProgramData>>, ResolvedInstructionAccountMeta<TAccountAmmConfig, InstructionAccountInputAddress<TAccountAmmConfig>>, ResolvedInstructionAccountMeta<TAccountSystemProgram, InstructionAccountInputAddress<TAccountSystemProgram>>>;
1091
+ type ParsedCreateConfigInstruction<TProgram extends string = typeof PINA_AMM_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
1092
+ programAddress: Address<TProgram>;
1093
+ accounts: {
1094
+ /** Pays the new tier's rent. */
1095
+ payer: TAccountMetas[0];
1096
+ /** The program's upgrade authority. */
1097
+ upgradeAuthority: TAccountMetas[1];
1098
+ /**
1099
+ * The program's program-data account, which records its upgrade
1100
+ * authority.
1101
+ */
1102
+ programData: TAccountMetas[2];
1103
+ /** The tier PDA to create: `[b"amm_config", index]`. */
1104
+ ammConfig: TAccountMetas[3];
1105
+ /** The system program. */
1106
+ systemProgram: TAccountMetas[4];
1107
+ };
1108
+ data: CreateConfigInstructionData;
1109
+ };
1110
+ declare function parseCreateConfigInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedCreateConfigInstruction<TProgram, TAccountMetas>;
1111
+
1112
+ /**
1113
+ * This code was AUTOGENERATED using the Codama library.
1114
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1115
+ * to add features, then rerun Codama to update it.
1116
+ *
1117
+ * @see https://github.com/codama-idl/codama
1118
+ */
1119
+
1120
+ declare const CREATE_POOL_DISCRIMINATOR = 2;
1121
+ declare function getCreatePoolDiscriminatorBytes(): ReadonlyUint8Array;
1122
+ type CreatePoolInstruction<TProgram extends string = typeof PINA_AMM_PROGRAM_ADDRESS, TAccountPayer extends string | AccountMeta<string> = string, TAccountDepositor extends string | AccountMeta<string> = string, TAccountPoolCreatorAuthority extends string | AccountMeta<string> = string, TAccountAmmConfig extends string | AccountMeta<string> = string, TAccountMint0 extends string | AccountMeta<string> = string, TAccountMint1 extends string | AccountMeta<string> = string, TAccountPool extends string | AccountMeta<string> = string, TAccountLpMint extends string | AccountMeta<string> = string, TAccountVault0 extends string | AccountMeta<string> = string, TAccountVault1 extends string | AccountMeta<string> = string, TAccountDepositorToken0 extends string | AccountMeta<string> = string, TAccountDepositorToken1 extends string | AccountMeta<string> = string, TAccountLpOwner extends string | AccountMeta<string> = string, TAccountLpOwnerToken extends string | AccountMeta<string> = string, TAccountTokenProgram0 extends string | AccountMeta<string> = string, TAccountTokenProgram1 extends string | AccountMeta<string> = string, TAccountLpTokenProgram extends string | AccountMeta<string> = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", TAccountAssociatedTokenProgram extends string | AccountMeta<string> = "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL", TAccountSystemProgram extends string | AccountMeta<string> = "11111111111111111111111111111111", TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[TAccountPayer extends string ? WritableSignerAccount<TAccountPayer> & AccountSignerMeta<TAccountPayer> : TAccountPayer, TAccountDepositor extends string ? ReadonlySignerAccount<TAccountDepositor> & AccountSignerMeta<TAccountDepositor> : TAccountDepositor, TAccountPoolCreatorAuthority extends string ? ReadonlySignerAccount<TAccountPoolCreatorAuthority> & AccountSignerMeta<TAccountPoolCreatorAuthority> : TAccountPoolCreatorAuthority, TAccountAmmConfig extends string ? ReadonlyAccount<TAccountAmmConfig> : TAccountAmmConfig, TAccountMint0 extends string ? ReadonlyAccount<TAccountMint0> : TAccountMint0, TAccountMint1 extends string ? ReadonlyAccount<TAccountMint1> : TAccountMint1, TAccountPool extends string ? WritableAccount<TAccountPool> : TAccountPool, TAccountLpMint extends string ? WritableAccount<TAccountLpMint> : TAccountLpMint, TAccountVault0 extends string ? WritableAccount<TAccountVault0> : TAccountVault0, TAccountVault1 extends string ? WritableAccount<TAccountVault1> : TAccountVault1, TAccountDepositorToken0 extends string ? WritableAccount<TAccountDepositorToken0> : TAccountDepositorToken0, TAccountDepositorToken1 extends string ? WritableAccount<TAccountDepositorToken1> : TAccountDepositorToken1, TAccountLpOwner extends string ? ReadonlyAccount<TAccountLpOwner> : TAccountLpOwner, TAccountLpOwnerToken extends string ? WritableAccount<TAccountLpOwnerToken> : TAccountLpOwnerToken, TAccountTokenProgram0 extends string ? ReadonlyAccount<TAccountTokenProgram0> : TAccountTokenProgram0, TAccountTokenProgram1 extends string ? ReadonlyAccount<TAccountTokenProgram1> : TAccountTokenProgram1, TAccountLpTokenProgram extends string ? ReadonlyAccount<TAccountLpTokenProgram> : TAccountLpTokenProgram, TAccountAssociatedTokenProgram extends string ? ReadonlyAccount<TAccountAssociatedTokenProgram> : TAccountAssociatedTokenProgram, TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram, ...TRemainingAccounts]>;
1123
+ type CreatePoolInstructionData = {
1124
+ discriminator: number;
1125
+ /** Initial deposit of token 0. */
1126
+ amount0: bigint;
1127
+ /** Initial deposit of token 1. */
1128
+ amount1: bigint;
1129
+ /** Recipient of the pool's creator fees. */
1130
+ creator: Address;
1131
+ /** `CreatorFeeMode` wire value. */
1132
+ creatorFeeMode: number;
1133
+ };
1134
+ type CreatePoolInstructionDataArgs = {
1135
+ /** Initial deposit of token 0. */
1136
+ amount0: number | bigint;
1137
+ /** Initial deposit of token 1. */
1138
+ amount1: number | bigint;
1139
+ /** Recipient of the pool's creator fees. */
1140
+ creator: Address;
1141
+ /** `CreatorFeeMode` wire value. */
1142
+ creatorFeeMode: number;
1143
+ };
1144
+ declare function getCreatePoolInstructionDataEncoder(): FixedSizeEncoder<CreatePoolInstructionDataArgs>;
1145
+ declare function getCreatePoolInstructionDataDecoder(): FixedSizeDecoder<CreatePoolInstructionData>;
1146
+ declare function getCreatePoolInstructionDataCodec(): FixedSizeCodec<CreatePoolInstructionDataArgs, CreatePoolInstructionData>;
1147
+ type CreatePoolAsyncInput<TAccountPayer extends InstructionSignerInput = InstructionSignerInput, TAccountDepositor extends InstructionSignerInput = InstructionSignerInput, TAccountPoolCreatorAuthority extends InstructionSignerInput = InstructionSignerInput, TAccountAmmConfig extends InstructionAccountInput = InstructionAccountInput, TAccountMint0 extends InstructionAccountInput = InstructionAccountInput, TAccountMint1 extends InstructionAccountInput = InstructionAccountInput, TAccountPool extends InstructionAccountInput = InstructionAccountInput, TAccountLpMint extends InstructionAccountInput = InstructionAccountInput, TAccountVault0 extends InstructionAccountInput = InstructionAccountInput, TAccountVault1 extends InstructionAccountInput = InstructionAccountInput, TAccountDepositorToken0 extends InstructionAccountInput = InstructionAccountInput, TAccountDepositorToken1 extends InstructionAccountInput = InstructionAccountInput, TAccountLpOwner extends InstructionAccountInput = InstructionAccountInput, TAccountLpOwnerToken extends InstructionAccountInput = InstructionAccountInput, TAccountTokenProgram0 extends InstructionAccountInput = InstructionAccountInput, TAccountTokenProgram1 extends InstructionAccountInput = InstructionAccountInput, TAccountLpTokenProgram extends InstructionAccountInput = InstructionAccountInput, TAccountAssociatedTokenProgram extends InstructionAccountInput = InstructionAccountInput, TAccountSystemProgram extends InstructionAccountInput = InstructionAccountInput> = {
1148
+ /**
1149
+ * Pays rent for the pool, its vaults, its LP mint, and the LP token
1150
+ * account.
1151
+ */
1152
+ payer: TAccountPayer;
1153
+ /**
1154
+ * Owner of the token accounts the initial deposit comes from. May be the
1155
+ * same account as `payer`.
1156
+ */
1157
+ depositor: TAccountDepositor;
1158
+ /**
1159
+ * Signer that authorizes pool creation. When the tier restricts pool
1160
+ * creation this must be its pool-creator authority; otherwise any signer
1161
+ * works, so pass the payer.
1162
+ */
1163
+ poolCreatorAuthority: TAccountPoolCreatorAuthority;
1164
+ /** The fee tier the pool is created under. */
1165
+ ammConfig: TAccountAmmConfig;
1166
+ /** Token 0 mint: the byte-wise smaller mint address. */
1167
+ mint0: TAccountMint0;
1168
+ /** Token 1 mint: the byte-wise larger mint address. */
1169
+ mint1: TAccountMint1;
1170
+ /** The pool PDA to create: `[b"pool", amm_config, mint_0, mint_1]`. */
1171
+ pool?: TAccountPool;
1172
+ /** The LP mint PDA to create: `[b"pool_lp_mint", pool]`. */
1173
+ lpMint: TAccountLpMint;
1174
+ /** The token 0 vault PDA to create: `[b"pool_vault", pool, mint_0]`. */
1175
+ vault0: TAccountVault0;
1176
+ /** The token 1 vault PDA to create: `[b"pool_vault", pool, mint_1]`. */
1177
+ vault1: TAccountVault1;
1178
+ /** The depositor's token 0 account. */
1179
+ depositorToken0: TAccountDepositorToken0;
1180
+ /** The depositor's token 1 account. */
1181
+ depositorToken1: TAccountDepositorToken1;
1182
+ /** Wallet that receives the initial LP. */
1183
+ lpOwner: TAccountLpOwner;
1184
+ /** `lp_owner`'s associated token account for the LP mint, created here. */
1185
+ lpOwnerToken: TAccountLpOwnerToken;
1186
+ /** Token program that owns `mint_0`. */
1187
+ tokenProgram0: TAccountTokenProgram0;
1188
+ /** Token program that owns `mint_1`. */
1189
+ tokenProgram1: TAccountTokenProgram1;
1190
+ /** SPL Token, which owns every LP mint. */
1191
+ lpTokenProgram?: TAccountLpTokenProgram;
1192
+ /** The associated token account program. */
1193
+ associatedTokenProgram?: TAccountAssociatedTokenProgram;
1194
+ /** The system program. */
1195
+ systemProgram?: TAccountSystemProgram;
1196
+ amount0: CreatePoolInstructionDataArgs["amount0"];
1197
+ amount1: CreatePoolInstructionDataArgs["amount1"];
1198
+ creator: CreatePoolInstructionDataArgs["creator"];
1199
+ creatorFeeMode: CreatePoolInstructionDataArgs["creatorFeeMode"];
1200
+ };
1201
+ declare function getCreatePoolInstructionAsync<TAccountPayer extends InstructionSignerInput, TAccountDepositor extends InstructionSignerInput, TAccountPoolCreatorAuthority extends InstructionSignerInput, TAccountAmmConfig extends InstructionAccountInput, TAccountMint0 extends InstructionAccountInput, TAccountMint1 extends InstructionAccountInput, TAccountPool extends InstructionAccountInput, TAccountLpMint extends InstructionAccountInput, TAccountVault0 extends InstructionAccountInput, TAccountVault1 extends InstructionAccountInput, TAccountDepositorToken0 extends InstructionAccountInput, TAccountDepositorToken1 extends InstructionAccountInput, TAccountLpOwner extends InstructionAccountInput, TAccountLpOwnerToken extends InstructionAccountInput, TAccountTokenProgram0 extends InstructionAccountInput, TAccountTokenProgram1 extends InstructionAccountInput, TAccountLpTokenProgram extends InstructionAccountInput, TAccountAssociatedTokenProgram extends InstructionAccountInput, TAccountSystemProgram extends InstructionAccountInput, TProgramAddress extends Address = typeof PINA_AMM_PROGRAM_ADDRESS>(input: CreatePoolAsyncInput<TAccountPayer, TAccountDepositor, TAccountPoolCreatorAuthority, TAccountAmmConfig, TAccountMint0, TAccountMint1, TAccountPool, TAccountLpMint, TAccountVault0, TAccountVault1, TAccountDepositorToken0, TAccountDepositorToken1, TAccountLpOwner, TAccountLpOwnerToken, TAccountTokenProgram0, TAccountTokenProgram1, TAccountLpTokenProgram, TAccountAssociatedTokenProgram, TAccountSystemProgram>, config?: {
1202
+ programAddress?: TProgramAddress;
1203
+ }): Promise<CreatePoolInstruction<TProgramAddress, ResolvedInstructionAccountMeta<TAccountPayer, InstructionAccountInputAddress<TAccountPayer>>, ResolvedInstructionAccountMeta<TAccountDepositor, InstructionAccountInputAddress<TAccountDepositor>>, ResolvedInstructionAccountMeta<TAccountPoolCreatorAuthority, InstructionAccountInputAddress<TAccountPoolCreatorAuthority>>, ResolvedInstructionAccountMeta<TAccountAmmConfig, InstructionAccountInputAddress<TAccountAmmConfig>>, ResolvedInstructionAccountMeta<TAccountMint0, InstructionAccountInputAddress<TAccountMint0>>, ResolvedInstructionAccountMeta<TAccountMint1, InstructionAccountInputAddress<TAccountMint1>>, ResolvedInstructionAccountMeta<TAccountPool, InstructionAccountInputAddress<TAccountPool>>, ResolvedInstructionAccountMeta<TAccountLpMint, InstructionAccountInputAddress<TAccountLpMint>>, ResolvedInstructionAccountMeta<TAccountVault0, InstructionAccountInputAddress<TAccountVault0>>, ResolvedInstructionAccountMeta<TAccountVault1, InstructionAccountInputAddress<TAccountVault1>>, ResolvedInstructionAccountMeta<TAccountDepositorToken0, InstructionAccountInputAddress<TAccountDepositorToken0>>, ResolvedInstructionAccountMeta<TAccountDepositorToken1, InstructionAccountInputAddress<TAccountDepositorToken1>>, ResolvedInstructionAccountMeta<TAccountLpOwner, InstructionAccountInputAddress<TAccountLpOwner>>, ResolvedInstructionAccountMeta<TAccountLpOwnerToken, InstructionAccountInputAddress<TAccountLpOwnerToken>>, ResolvedInstructionAccountMeta<TAccountTokenProgram0, InstructionAccountInputAddress<TAccountTokenProgram0>>, ResolvedInstructionAccountMeta<TAccountTokenProgram1, InstructionAccountInputAddress<TAccountTokenProgram1>>, ResolvedInstructionAccountMeta<TAccountLpTokenProgram, InstructionAccountInputAddress<TAccountLpTokenProgram>>, ResolvedInstructionAccountMeta<TAccountAssociatedTokenProgram, InstructionAccountInputAddress<TAccountAssociatedTokenProgram>>, ResolvedInstructionAccountMeta<TAccountSystemProgram, InstructionAccountInputAddress<TAccountSystemProgram>>>>;
1204
+ type CreatePoolInput<TAccountPayer extends InstructionSignerInput = InstructionSignerInput, TAccountDepositor extends InstructionSignerInput = InstructionSignerInput, TAccountPoolCreatorAuthority extends InstructionSignerInput = InstructionSignerInput, TAccountAmmConfig extends InstructionAccountInput = InstructionAccountInput, TAccountMint0 extends InstructionAccountInput = InstructionAccountInput, TAccountMint1 extends InstructionAccountInput = InstructionAccountInput, TAccountPool extends InstructionAccountInput = InstructionAccountInput, TAccountLpMint extends InstructionAccountInput = InstructionAccountInput, TAccountVault0 extends InstructionAccountInput = InstructionAccountInput, TAccountVault1 extends InstructionAccountInput = InstructionAccountInput, TAccountDepositorToken0 extends InstructionAccountInput = InstructionAccountInput, TAccountDepositorToken1 extends InstructionAccountInput = InstructionAccountInput, TAccountLpOwner extends InstructionAccountInput = InstructionAccountInput, TAccountLpOwnerToken extends InstructionAccountInput = InstructionAccountInput, TAccountTokenProgram0 extends InstructionAccountInput = InstructionAccountInput, TAccountTokenProgram1 extends InstructionAccountInput = InstructionAccountInput, TAccountLpTokenProgram extends InstructionAccountInput = InstructionAccountInput, TAccountAssociatedTokenProgram extends InstructionAccountInput = InstructionAccountInput, TAccountSystemProgram extends InstructionAccountInput = InstructionAccountInput> = {
1205
+ /**
1206
+ * Pays rent for the pool, its vaults, its LP mint, and the LP token
1207
+ * account.
1208
+ */
1209
+ payer: TAccountPayer;
1210
+ /**
1211
+ * Owner of the token accounts the initial deposit comes from. May be the
1212
+ * same account as `payer`.
1213
+ */
1214
+ depositor: TAccountDepositor;
1215
+ /**
1216
+ * Signer that authorizes pool creation. When the tier restricts pool
1217
+ * creation this must be its pool-creator authority; otherwise any signer
1218
+ * works, so pass the payer.
1219
+ */
1220
+ poolCreatorAuthority: TAccountPoolCreatorAuthority;
1221
+ /** The fee tier the pool is created under. */
1222
+ ammConfig: TAccountAmmConfig;
1223
+ /** Token 0 mint: the byte-wise smaller mint address. */
1224
+ mint0: TAccountMint0;
1225
+ /** Token 1 mint: the byte-wise larger mint address. */
1226
+ mint1: TAccountMint1;
1227
+ /** The pool PDA to create: `[b"pool", amm_config, mint_0, mint_1]`. */
1228
+ pool: TAccountPool;
1229
+ /** The LP mint PDA to create: `[b"pool_lp_mint", pool]`. */
1230
+ lpMint: TAccountLpMint;
1231
+ /** The token 0 vault PDA to create: `[b"pool_vault", pool, mint_0]`. */
1232
+ vault0: TAccountVault0;
1233
+ /** The token 1 vault PDA to create: `[b"pool_vault", pool, mint_1]`. */
1234
+ vault1: TAccountVault1;
1235
+ /** The depositor's token 0 account. */
1236
+ depositorToken0: TAccountDepositorToken0;
1237
+ /** The depositor's token 1 account. */
1238
+ depositorToken1: TAccountDepositorToken1;
1239
+ /** Wallet that receives the initial LP. */
1240
+ lpOwner: TAccountLpOwner;
1241
+ /** `lp_owner`'s associated token account for the LP mint, created here. */
1242
+ lpOwnerToken: TAccountLpOwnerToken;
1243
+ /** Token program that owns `mint_0`. */
1244
+ tokenProgram0: TAccountTokenProgram0;
1245
+ /** Token program that owns `mint_1`. */
1246
+ tokenProgram1: TAccountTokenProgram1;
1247
+ /** SPL Token, which owns every LP mint. */
1248
+ lpTokenProgram?: TAccountLpTokenProgram;
1249
+ /** The associated token account program. */
1250
+ associatedTokenProgram?: TAccountAssociatedTokenProgram;
1251
+ /** The system program. */
1252
+ systemProgram?: TAccountSystemProgram;
1253
+ amount0: CreatePoolInstructionDataArgs["amount0"];
1254
+ amount1: CreatePoolInstructionDataArgs["amount1"];
1255
+ creator: CreatePoolInstructionDataArgs["creator"];
1256
+ creatorFeeMode: CreatePoolInstructionDataArgs["creatorFeeMode"];
1257
+ };
1258
+ declare function getCreatePoolInstruction<TAccountPayer extends InstructionSignerInput, TAccountDepositor extends InstructionSignerInput, TAccountPoolCreatorAuthority extends InstructionSignerInput, TAccountAmmConfig extends InstructionAccountInput, TAccountMint0 extends InstructionAccountInput, TAccountMint1 extends InstructionAccountInput, TAccountPool extends InstructionAccountInput, TAccountLpMint extends InstructionAccountInput, TAccountVault0 extends InstructionAccountInput, TAccountVault1 extends InstructionAccountInput, TAccountDepositorToken0 extends InstructionAccountInput, TAccountDepositorToken1 extends InstructionAccountInput, TAccountLpOwner extends InstructionAccountInput, TAccountLpOwnerToken extends InstructionAccountInput, TAccountTokenProgram0 extends InstructionAccountInput, TAccountTokenProgram1 extends InstructionAccountInput, TAccountLpTokenProgram extends InstructionAccountInput, TAccountAssociatedTokenProgram extends InstructionAccountInput, TAccountSystemProgram extends InstructionAccountInput, TProgramAddress extends Address = typeof PINA_AMM_PROGRAM_ADDRESS>(input: CreatePoolInput<TAccountPayer, TAccountDepositor, TAccountPoolCreatorAuthority, TAccountAmmConfig, TAccountMint0, TAccountMint1, TAccountPool, TAccountLpMint, TAccountVault0, TAccountVault1, TAccountDepositorToken0, TAccountDepositorToken1, TAccountLpOwner, TAccountLpOwnerToken, TAccountTokenProgram0, TAccountTokenProgram1, TAccountLpTokenProgram, TAccountAssociatedTokenProgram, TAccountSystemProgram>, config?: {
1259
+ programAddress?: TProgramAddress;
1260
+ }): CreatePoolInstruction<TProgramAddress, ResolvedInstructionAccountMeta<TAccountPayer, InstructionAccountInputAddress<TAccountPayer>>, ResolvedInstructionAccountMeta<TAccountDepositor, InstructionAccountInputAddress<TAccountDepositor>>, ResolvedInstructionAccountMeta<TAccountPoolCreatorAuthority, InstructionAccountInputAddress<TAccountPoolCreatorAuthority>>, ResolvedInstructionAccountMeta<TAccountAmmConfig, InstructionAccountInputAddress<TAccountAmmConfig>>, ResolvedInstructionAccountMeta<TAccountMint0, InstructionAccountInputAddress<TAccountMint0>>, ResolvedInstructionAccountMeta<TAccountMint1, InstructionAccountInputAddress<TAccountMint1>>, ResolvedInstructionAccountMeta<TAccountPool, InstructionAccountInputAddress<TAccountPool>>, ResolvedInstructionAccountMeta<TAccountLpMint, InstructionAccountInputAddress<TAccountLpMint>>, ResolvedInstructionAccountMeta<TAccountVault0, InstructionAccountInputAddress<TAccountVault0>>, ResolvedInstructionAccountMeta<TAccountVault1, InstructionAccountInputAddress<TAccountVault1>>, ResolvedInstructionAccountMeta<TAccountDepositorToken0, InstructionAccountInputAddress<TAccountDepositorToken0>>, ResolvedInstructionAccountMeta<TAccountDepositorToken1, InstructionAccountInputAddress<TAccountDepositorToken1>>, ResolvedInstructionAccountMeta<TAccountLpOwner, InstructionAccountInputAddress<TAccountLpOwner>>, ResolvedInstructionAccountMeta<TAccountLpOwnerToken, InstructionAccountInputAddress<TAccountLpOwnerToken>>, ResolvedInstructionAccountMeta<TAccountTokenProgram0, InstructionAccountInputAddress<TAccountTokenProgram0>>, ResolvedInstructionAccountMeta<TAccountTokenProgram1, InstructionAccountInputAddress<TAccountTokenProgram1>>, ResolvedInstructionAccountMeta<TAccountLpTokenProgram, InstructionAccountInputAddress<TAccountLpTokenProgram>>, ResolvedInstructionAccountMeta<TAccountAssociatedTokenProgram, InstructionAccountInputAddress<TAccountAssociatedTokenProgram>>, ResolvedInstructionAccountMeta<TAccountSystemProgram, InstructionAccountInputAddress<TAccountSystemProgram>>>;
1261
+ type ParsedCreatePoolInstruction<TProgram extends string = typeof PINA_AMM_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
1262
+ programAddress: Address<TProgram>;
1263
+ accounts: {
1264
+ /**
1265
+ * Pays rent for the pool, its vaults, its LP mint, and the LP token
1266
+ * account.
1267
+ */
1268
+ payer: TAccountMetas[0];
1269
+ /**
1270
+ * Owner of the token accounts the initial deposit comes from. May be the
1271
+ * same account as `payer`.
1272
+ */
1273
+ depositor: TAccountMetas[1];
1274
+ /**
1275
+ * Signer that authorizes pool creation. When the tier restricts pool
1276
+ * creation this must be its pool-creator authority; otherwise any signer
1277
+ * works, so pass the payer.
1278
+ */
1279
+ poolCreatorAuthority: TAccountMetas[2];
1280
+ /** The fee tier the pool is created under. */
1281
+ ammConfig: TAccountMetas[3];
1282
+ /** Token 0 mint: the byte-wise smaller mint address. */
1283
+ mint0: TAccountMetas[4];
1284
+ /** Token 1 mint: the byte-wise larger mint address. */
1285
+ mint1: TAccountMetas[5];
1286
+ /** The pool PDA to create: `[b"pool", amm_config, mint_0, mint_1]`. */
1287
+ pool: TAccountMetas[6];
1288
+ /** The LP mint PDA to create: `[b"pool_lp_mint", pool]`. */
1289
+ lpMint: TAccountMetas[7];
1290
+ /** The token 0 vault PDA to create: `[b"pool_vault", pool, mint_0]`. */
1291
+ vault0: TAccountMetas[8];
1292
+ /** The token 1 vault PDA to create: `[b"pool_vault", pool, mint_1]`. */
1293
+ vault1: TAccountMetas[9];
1294
+ /** The depositor's token 0 account. */
1295
+ depositorToken0: TAccountMetas[10];
1296
+ /** The depositor's token 1 account. */
1297
+ depositorToken1: TAccountMetas[11];
1298
+ /** Wallet that receives the initial LP. */
1299
+ lpOwner: TAccountMetas[12];
1300
+ /** `lp_owner`'s associated token account for the LP mint, created here. */
1301
+ lpOwnerToken: TAccountMetas[13];
1302
+ /** Token program that owns `mint_0`. */
1303
+ tokenProgram0: TAccountMetas[14];
1304
+ /** Token program that owns `mint_1`. */
1305
+ tokenProgram1: TAccountMetas[15];
1306
+ /** SPL Token, which owns every LP mint. */
1307
+ lpTokenProgram: TAccountMetas[16];
1308
+ /** The associated token account program. */
1309
+ associatedTokenProgram: TAccountMetas[17];
1310
+ /** The system program. */
1311
+ systemProgram: TAccountMetas[18];
1312
+ };
1313
+ data: CreatePoolInstructionData;
1314
+ };
1315
+ declare function parseCreatePoolInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedCreatePoolInstruction<TProgram, TAccountMetas>;
1316
+
1317
+ /**
1318
+ * This code was AUTOGENERATED using the Codama library.
1319
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1320
+ * to add features, then rerun Codama to update it.
1321
+ *
1322
+ * @see https://github.com/codama-idl/codama
1323
+ */
1324
+
1325
+ declare const DEPOSIT_DISCRIMINATOR = 3;
1326
+ declare function getDepositDiscriminatorBytes(): ReadonlyUint8Array;
1327
+ type DepositInstruction<TProgram extends string = typeof PINA_AMM_PROGRAM_ADDRESS, TAccountOwner extends string | AccountMeta<string> = string, TAccountPool extends string | AccountMeta<string> = string, TAccountVault0 extends string | AccountMeta<string> = string, TAccountVault1 extends string | AccountMeta<string> = string, TAccountLpMint extends string | AccountMeta<string> = string, TAccountOwnerToken0 extends string | AccountMeta<string> = string, TAccountOwnerToken1 extends string | AccountMeta<string> = string, TAccountOwnerLpToken extends string | AccountMeta<string> = string, TAccountTokenProgram0 extends string | AccountMeta<string> = string, TAccountTokenProgram1 extends string | AccountMeta<string> = string, TAccountLpTokenProgram extends string | AccountMeta<string> = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[TAccountOwner extends string ? ReadonlySignerAccount<TAccountOwner> & AccountSignerMeta<TAccountOwner> : TAccountOwner, TAccountPool extends string ? WritableAccount<TAccountPool> : TAccountPool, TAccountVault0 extends string ? WritableAccount<TAccountVault0> : TAccountVault0, TAccountVault1 extends string ? WritableAccount<TAccountVault1> : TAccountVault1, TAccountLpMint extends string ? WritableAccount<TAccountLpMint> : TAccountLpMint, TAccountOwnerToken0 extends string ? WritableAccount<TAccountOwnerToken0> : TAccountOwnerToken0, TAccountOwnerToken1 extends string ? WritableAccount<TAccountOwnerToken1> : TAccountOwnerToken1, TAccountOwnerLpToken extends string ? WritableAccount<TAccountOwnerLpToken> : TAccountOwnerLpToken, TAccountTokenProgram0 extends string ? ReadonlyAccount<TAccountTokenProgram0> : TAccountTokenProgram0, TAccountTokenProgram1 extends string ? ReadonlyAccount<TAccountTokenProgram1> : TAccountTokenProgram1, TAccountLpTokenProgram extends string ? ReadonlyAccount<TAccountLpTokenProgram> : TAccountLpTokenProgram, ...TRemainingAccounts]>;
1328
+ type DepositInstructionData = {
1329
+ discriminator: number;
1330
+ /** LP to mint. */
1331
+ lpAmount: bigint;
1332
+ /** Most token 0 the depositor will add. */
1333
+ maximumAmount0: bigint;
1334
+ /** Most token 1 the depositor will add. */
1335
+ maximumAmount1: bigint;
1336
+ };
1337
+ type DepositInstructionDataArgs = {
1338
+ /** LP to mint. */
1339
+ lpAmount: number | bigint;
1340
+ /** Most token 0 the depositor will add. */
1341
+ maximumAmount0: number | bigint;
1342
+ /** Most token 1 the depositor will add. */
1343
+ maximumAmount1: number | bigint;
1344
+ };
1345
+ declare function getDepositInstructionDataEncoder(): FixedSizeEncoder<DepositInstructionDataArgs>;
1346
+ declare function getDepositInstructionDataDecoder(): FixedSizeDecoder<DepositInstructionData>;
1347
+ declare function getDepositInstructionDataCodec(): FixedSizeCodec<DepositInstructionDataArgs, DepositInstructionData>;
1348
+ type DepositInput<TAccountOwner extends InstructionSignerInput = InstructionSignerInput, TAccountPool extends InstructionAccountInput = InstructionAccountInput, TAccountVault0 extends InstructionAccountInput = InstructionAccountInput, TAccountVault1 extends InstructionAccountInput = InstructionAccountInput, TAccountLpMint extends InstructionAccountInput = InstructionAccountInput, TAccountOwnerToken0 extends InstructionAccountInput = InstructionAccountInput, TAccountOwnerToken1 extends InstructionAccountInput = InstructionAccountInput, TAccountOwnerLpToken extends InstructionAccountInput = InstructionAccountInput, TAccountTokenProgram0 extends InstructionAccountInput = InstructionAccountInput, TAccountTokenProgram1 extends InstructionAccountInput = InstructionAccountInput, TAccountLpTokenProgram extends InstructionAccountInput = InstructionAccountInput> = {
1349
+ /** The LP owner, who owns every token account below. */
1350
+ owner: TAccountOwner;
1351
+ /** The pool. */
1352
+ pool: TAccountPool;
1353
+ /** The pool's token 0 vault. */
1354
+ vault0: TAccountVault0;
1355
+ /** The pool's token 1 vault. */
1356
+ vault1: TAccountVault1;
1357
+ /** The pool's LP mint. */
1358
+ lpMint: TAccountLpMint;
1359
+ /** The owner's token 0 account. */
1360
+ ownerToken0: TAccountOwnerToken0;
1361
+ /** The owner's token 1 account. */
1362
+ ownerToken1: TAccountOwnerToken1;
1363
+ /** The owner's LP token account. */
1364
+ ownerLpToken: TAccountOwnerLpToken;
1365
+ /** Token program that owns token 0. */
1366
+ tokenProgram0: TAccountTokenProgram0;
1367
+ /** Token program that owns token 1. */
1368
+ tokenProgram1: TAccountTokenProgram1;
1369
+ /** SPL Token, which owns every LP mint. */
1370
+ lpTokenProgram?: TAccountLpTokenProgram;
1371
+ lpAmount: DepositInstructionDataArgs["lpAmount"];
1372
+ maximumAmount0: DepositInstructionDataArgs["maximumAmount0"];
1373
+ maximumAmount1: DepositInstructionDataArgs["maximumAmount1"];
1374
+ };
1375
+ declare function getDepositInstruction<TAccountOwner extends InstructionSignerInput, TAccountPool extends InstructionAccountInput, TAccountVault0 extends InstructionAccountInput, TAccountVault1 extends InstructionAccountInput, TAccountLpMint extends InstructionAccountInput, TAccountOwnerToken0 extends InstructionAccountInput, TAccountOwnerToken1 extends InstructionAccountInput, TAccountOwnerLpToken extends InstructionAccountInput, TAccountTokenProgram0 extends InstructionAccountInput, TAccountTokenProgram1 extends InstructionAccountInput, TAccountLpTokenProgram extends InstructionAccountInput, TProgramAddress extends Address = typeof PINA_AMM_PROGRAM_ADDRESS>(input: DepositInput<TAccountOwner, TAccountPool, TAccountVault0, TAccountVault1, TAccountLpMint, TAccountOwnerToken0, TAccountOwnerToken1, TAccountOwnerLpToken, TAccountTokenProgram0, TAccountTokenProgram1, TAccountLpTokenProgram>, config?: {
1376
+ programAddress?: TProgramAddress;
1377
+ }): DepositInstruction<TProgramAddress, ResolvedInstructionAccountMeta<TAccountOwner, InstructionAccountInputAddress<TAccountOwner>>, ResolvedInstructionAccountMeta<TAccountPool, InstructionAccountInputAddress<TAccountPool>>, ResolvedInstructionAccountMeta<TAccountVault0, InstructionAccountInputAddress<TAccountVault0>>, ResolvedInstructionAccountMeta<TAccountVault1, InstructionAccountInputAddress<TAccountVault1>>, ResolvedInstructionAccountMeta<TAccountLpMint, InstructionAccountInputAddress<TAccountLpMint>>, ResolvedInstructionAccountMeta<TAccountOwnerToken0, InstructionAccountInputAddress<TAccountOwnerToken0>>, ResolvedInstructionAccountMeta<TAccountOwnerToken1, InstructionAccountInputAddress<TAccountOwnerToken1>>, ResolvedInstructionAccountMeta<TAccountOwnerLpToken, InstructionAccountInputAddress<TAccountOwnerLpToken>>, ResolvedInstructionAccountMeta<TAccountTokenProgram0, InstructionAccountInputAddress<TAccountTokenProgram0>>, ResolvedInstructionAccountMeta<TAccountTokenProgram1, InstructionAccountInputAddress<TAccountTokenProgram1>>, ResolvedInstructionAccountMeta<TAccountLpTokenProgram, InstructionAccountInputAddress<TAccountLpTokenProgram>>>;
1378
+ type ParsedDepositInstruction<TProgram extends string = typeof PINA_AMM_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
1379
+ programAddress: Address<TProgram>;
1380
+ accounts: {
1381
+ /** The LP owner, who owns every token account below. */
1382
+ owner: TAccountMetas[0];
1383
+ /** The pool. */
1384
+ pool: TAccountMetas[1];
1385
+ /** The pool's token 0 vault. */
1386
+ vault0: TAccountMetas[2];
1387
+ /** The pool's token 1 vault. */
1388
+ vault1: TAccountMetas[3];
1389
+ /** The pool's LP mint. */
1390
+ lpMint: TAccountMetas[4];
1391
+ /** The owner's token 0 account. */
1392
+ ownerToken0: TAccountMetas[5];
1393
+ /** The owner's token 1 account. */
1394
+ ownerToken1: TAccountMetas[6];
1395
+ /** The owner's LP token account. */
1396
+ ownerLpToken: TAccountMetas[7];
1397
+ /** Token program that owns token 0. */
1398
+ tokenProgram0: TAccountMetas[8];
1399
+ /** Token program that owns token 1. */
1400
+ tokenProgram1: TAccountMetas[9];
1401
+ /** SPL Token, which owns every LP mint. */
1402
+ lpTokenProgram: TAccountMetas[10];
1403
+ };
1404
+ data: DepositInstructionData;
1405
+ };
1406
+ declare function parseDepositInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedDepositInstruction<TProgram, TAccountMetas>;
1407
+
1408
+ /**
1409
+ * This code was AUTOGENERATED using the Codama library.
1410
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1411
+ * to add features, then rerun Codama to update it.
1412
+ *
1413
+ * @see https://github.com/codama-idl/codama
1414
+ */
1415
+
1416
+ declare const SET_POOL_CREATOR_DISCRIMINATOR = 9;
1417
+ declare function getSetPoolCreatorDiscriminatorBytes(): ReadonlyUint8Array;
1418
+ type SetPoolCreatorInstruction<TProgram extends string = typeof PINA_AMM_PROGRAM_ADDRESS, TAccountCreator extends string | AccountMeta<string> = string, TAccountPool extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[TAccountCreator extends string ? ReadonlySignerAccount<TAccountCreator> & AccountSignerMeta<TAccountCreator> : TAccountCreator, TAccountPool extends string ? WritableAccount<TAccountPool> : TAccountPool, ...TRemainingAccounts]>;
1419
+ type SetPoolCreatorInstructionData = {
1420
+ discriminator: number;
1421
+ /** New recipient of the pool's creator fees. */
1422
+ newCreator: Address;
1423
+ };
1424
+ type SetPoolCreatorInstructionDataArgs = {
1425
+ /** New recipient of the pool's creator fees. */
1426
+ newCreator: Address;
1427
+ };
1428
+ declare function getSetPoolCreatorInstructionDataEncoder(): FixedSizeEncoder<SetPoolCreatorInstructionDataArgs>;
1429
+ declare function getSetPoolCreatorInstructionDataDecoder(): FixedSizeDecoder<SetPoolCreatorInstructionData>;
1430
+ declare function getSetPoolCreatorInstructionDataCodec(): FixedSizeCodec<SetPoolCreatorInstructionDataArgs, SetPoolCreatorInstructionData>;
1431
+ type SetPoolCreatorInput<TAccountCreator extends InstructionSignerInput = InstructionSignerInput, TAccountPool extends InstructionAccountInput = InstructionAccountInput> = {
1432
+ /** The pool's current creator. */
1433
+ creator: TAccountCreator;
1434
+ /** The pool. */
1435
+ pool: TAccountPool;
1436
+ newCreator: SetPoolCreatorInstructionDataArgs["newCreator"];
1437
+ };
1438
+ declare function getSetPoolCreatorInstruction<TAccountCreator extends InstructionSignerInput, TAccountPool extends InstructionAccountInput, TProgramAddress extends Address = typeof PINA_AMM_PROGRAM_ADDRESS>(input: SetPoolCreatorInput<TAccountCreator, TAccountPool>, config?: {
1439
+ programAddress?: TProgramAddress;
1440
+ }): SetPoolCreatorInstruction<TProgramAddress, ResolvedInstructionAccountMeta<TAccountCreator, InstructionAccountInputAddress<TAccountCreator>>, ResolvedInstructionAccountMeta<TAccountPool, InstructionAccountInputAddress<TAccountPool>>>;
1441
+ type ParsedSetPoolCreatorInstruction<TProgram extends string = typeof PINA_AMM_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
1442
+ programAddress: Address<TProgram>;
1443
+ accounts: {
1444
+ /** The pool's current creator. */
1445
+ creator: TAccountMetas[0];
1446
+ /** The pool. */
1447
+ pool: TAccountMetas[1];
1448
+ };
1449
+ data: SetPoolCreatorInstructionData;
1450
+ };
1451
+ declare function parseSetPoolCreatorInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedSetPoolCreatorInstruction<TProgram, TAccountMetas>;
1452
+
1453
+ /**
1454
+ * This code was AUTOGENERATED using the Codama library.
1455
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1456
+ * to add features, then rerun Codama to update it.
1457
+ *
1458
+ * @see https://github.com/codama-idl/codama
1459
+ */
1460
+
1461
+ declare const SWAP_EXACT_IN_DISCRIMINATOR = 5;
1462
+ declare function getSwapExactInDiscriminatorBytes(): ReadonlyUint8Array;
1463
+ type SwapExactInInstruction<TProgram extends string = typeof PINA_AMM_PROGRAM_ADDRESS, TAccountTrader extends string | AccountMeta<string> = string, TAccountPool extends string | AccountMeta<string> = string, TAccountInputToken extends string | AccountMeta<string> = string, TAccountOutputToken extends string | AccountMeta<string> = string, TAccountInputVault extends string | AccountMeta<string> = string, TAccountOutputVault extends string | AccountMeta<string> = string, TAccountInputTokenProgram extends string | AccountMeta<string> = string, TAccountOutputTokenProgram extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[TAccountTrader extends string ? ReadonlySignerAccount<TAccountTrader> & AccountSignerMeta<TAccountTrader> : TAccountTrader, TAccountPool extends string ? WritableAccount<TAccountPool> : TAccountPool, TAccountInputToken extends string ? WritableAccount<TAccountInputToken> : TAccountInputToken, TAccountOutputToken extends string ? WritableAccount<TAccountOutputToken> : TAccountOutputToken, TAccountInputVault extends string ? WritableAccount<TAccountInputVault> : TAccountInputVault, TAccountOutputVault extends string ? WritableAccount<TAccountOutputVault> : TAccountOutputVault, TAccountInputTokenProgram extends string ? ReadonlyAccount<TAccountInputTokenProgram> : TAccountInputTokenProgram, TAccountOutputTokenProgram extends string ? ReadonlyAccount<TAccountOutputTokenProgram> : TAccountOutputTokenProgram, ...TRemainingAccounts]>;
1464
+ type SwapExactInInstructionData = {
1465
+ discriminator: number;
1466
+ /** Exact input the trader sells. */
1467
+ amountIn: bigint;
1468
+ /** Least output the trader will accept. */
1469
+ minimumAmountOut: bigint;
1470
+ };
1471
+ type SwapExactInInstructionDataArgs = {
1472
+ /** Exact input the trader sells. */
1473
+ amountIn: number | bigint;
1474
+ /** Least output the trader will accept. */
1475
+ minimumAmountOut: number | bigint;
1476
+ };
1477
+ declare function getSwapExactInInstructionDataEncoder(): FixedSizeEncoder<SwapExactInInstructionDataArgs>;
1478
+ declare function getSwapExactInInstructionDataDecoder(): FixedSizeDecoder<SwapExactInInstructionData>;
1479
+ declare function getSwapExactInInstructionDataCodec(): FixedSizeCodec<SwapExactInInstructionDataArgs, SwapExactInInstructionData>;
1480
+ type SwapExactInInput<TAccountTrader extends InstructionSignerInput = InstructionSignerInput, TAccountPool extends InstructionAccountInput = InstructionAccountInput, TAccountInputToken extends InstructionAccountInput = InstructionAccountInput, TAccountOutputToken extends InstructionAccountInput = InstructionAccountInput, TAccountInputVault extends InstructionAccountInput = InstructionAccountInput, TAccountOutputVault extends InstructionAccountInput = InstructionAccountInput, TAccountInputTokenProgram extends InstructionAccountInput = InstructionAccountInput, TAccountOutputTokenProgram extends InstructionAccountInput = InstructionAccountInput> = {
1481
+ /** The trader, who owns `input_token`. */
1482
+ trader: TAccountTrader;
1483
+ /** The pool to trade against. */
1484
+ pool: TAccountPool;
1485
+ /** The trader's account for the token being sold. */
1486
+ inputToken: TAccountInputToken;
1487
+ /** The account that receives the token being bought. */
1488
+ outputToken: TAccountOutputToken;
1489
+ /** The pool's vault for the token being sold. */
1490
+ inputVault: TAccountInputVault;
1491
+ /** The pool's vault for the token being bought. */
1492
+ outputVault: TAccountOutputVault;
1493
+ /** Token program that owns the sold token. */
1494
+ inputTokenProgram: TAccountInputTokenProgram;
1495
+ /** Token program that owns the bought token. */
1496
+ outputTokenProgram: TAccountOutputTokenProgram;
1497
+ amountIn: SwapExactInInstructionDataArgs["amountIn"];
1498
+ minimumAmountOut: SwapExactInInstructionDataArgs["minimumAmountOut"];
1499
+ };
1500
+ declare function getSwapExactInInstruction<TAccountTrader extends InstructionSignerInput, TAccountPool extends InstructionAccountInput, TAccountInputToken extends InstructionAccountInput, TAccountOutputToken extends InstructionAccountInput, TAccountInputVault extends InstructionAccountInput, TAccountOutputVault extends InstructionAccountInput, TAccountInputTokenProgram extends InstructionAccountInput, TAccountOutputTokenProgram extends InstructionAccountInput, TProgramAddress extends Address = typeof PINA_AMM_PROGRAM_ADDRESS>(input: SwapExactInInput<TAccountTrader, TAccountPool, TAccountInputToken, TAccountOutputToken, TAccountInputVault, TAccountOutputVault, TAccountInputTokenProgram, TAccountOutputTokenProgram>, config?: {
1501
+ programAddress?: TProgramAddress;
1502
+ }): SwapExactInInstruction<TProgramAddress, ResolvedInstructionAccountMeta<TAccountTrader, InstructionAccountInputAddress<TAccountTrader>>, ResolvedInstructionAccountMeta<TAccountPool, InstructionAccountInputAddress<TAccountPool>>, ResolvedInstructionAccountMeta<TAccountInputToken, InstructionAccountInputAddress<TAccountInputToken>>, ResolvedInstructionAccountMeta<TAccountOutputToken, InstructionAccountInputAddress<TAccountOutputToken>>, ResolvedInstructionAccountMeta<TAccountInputVault, InstructionAccountInputAddress<TAccountInputVault>>, ResolvedInstructionAccountMeta<TAccountOutputVault, InstructionAccountInputAddress<TAccountOutputVault>>, ResolvedInstructionAccountMeta<TAccountInputTokenProgram, InstructionAccountInputAddress<TAccountInputTokenProgram>>, ResolvedInstructionAccountMeta<TAccountOutputTokenProgram, InstructionAccountInputAddress<TAccountOutputTokenProgram>>>;
1503
+ type ParsedSwapExactInInstruction<TProgram extends string = typeof PINA_AMM_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
1504
+ programAddress: Address<TProgram>;
1505
+ accounts: {
1506
+ /** The trader, who owns `input_token`. */
1507
+ trader: TAccountMetas[0];
1508
+ /** The pool to trade against. */
1509
+ pool: TAccountMetas[1];
1510
+ /** The trader's account for the token being sold. */
1511
+ inputToken: TAccountMetas[2];
1512
+ /** The account that receives the token being bought. */
1513
+ outputToken: TAccountMetas[3];
1514
+ /** The pool's vault for the token being sold. */
1515
+ inputVault: TAccountMetas[4];
1516
+ /** The pool's vault for the token being bought. */
1517
+ outputVault: TAccountMetas[5];
1518
+ /** Token program that owns the sold token. */
1519
+ inputTokenProgram: TAccountMetas[6];
1520
+ /** Token program that owns the bought token. */
1521
+ outputTokenProgram: TAccountMetas[7];
1522
+ };
1523
+ data: SwapExactInInstructionData;
1524
+ };
1525
+ declare function parseSwapExactInInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedSwapExactInInstruction<TProgram, TAccountMetas>;
1526
+
1527
+ /**
1528
+ * This code was AUTOGENERATED using the Codama library.
1529
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1530
+ * to add features, then rerun Codama to update it.
1531
+ *
1532
+ * @see https://github.com/codama-idl/codama
1533
+ */
1534
+
1535
+ declare const SWAP_EXACT_OUT_DISCRIMINATOR = 6;
1536
+ declare function getSwapExactOutDiscriminatorBytes(): ReadonlyUint8Array;
1537
+ type SwapExactOutInstruction<TProgram extends string = typeof PINA_AMM_PROGRAM_ADDRESS, TAccountTrader extends string | AccountMeta<string> = string, TAccountPool extends string | AccountMeta<string> = string, TAccountInputToken extends string | AccountMeta<string> = string, TAccountOutputToken extends string | AccountMeta<string> = string, TAccountInputVault extends string | AccountMeta<string> = string, TAccountOutputVault extends string | AccountMeta<string> = string, TAccountInputTokenProgram extends string | AccountMeta<string> = string, TAccountOutputTokenProgram extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[TAccountTrader extends string ? ReadonlySignerAccount<TAccountTrader> & AccountSignerMeta<TAccountTrader> : TAccountTrader, TAccountPool extends string ? WritableAccount<TAccountPool> : TAccountPool, TAccountInputToken extends string ? WritableAccount<TAccountInputToken> : TAccountInputToken, TAccountOutputToken extends string ? WritableAccount<TAccountOutputToken> : TAccountOutputToken, TAccountInputVault extends string ? WritableAccount<TAccountInputVault> : TAccountInputVault, TAccountOutputVault extends string ? WritableAccount<TAccountOutputVault> : TAccountOutputVault, TAccountInputTokenProgram extends string ? ReadonlyAccount<TAccountInputTokenProgram> : TAccountInputTokenProgram, TAccountOutputTokenProgram extends string ? ReadonlyAccount<TAccountOutputTokenProgram> : TAccountOutputTokenProgram, ...TRemainingAccounts]>;
1538
+ type SwapExactOutInstructionData = {
1539
+ discriminator: number;
1540
+ /** Exact output the trader buys. */
1541
+ amountOut: bigint;
1542
+ /** Most input the trader will pay. */
1543
+ maximumAmountIn: bigint;
1544
+ };
1545
+ type SwapExactOutInstructionDataArgs = {
1546
+ /** Exact output the trader buys. */
1547
+ amountOut: number | bigint;
1548
+ /** Most input the trader will pay. */
1549
+ maximumAmountIn: number | bigint;
1550
+ };
1551
+ declare function getSwapExactOutInstructionDataEncoder(): FixedSizeEncoder<SwapExactOutInstructionDataArgs>;
1552
+ declare function getSwapExactOutInstructionDataDecoder(): FixedSizeDecoder<SwapExactOutInstructionData>;
1553
+ declare function getSwapExactOutInstructionDataCodec(): FixedSizeCodec<SwapExactOutInstructionDataArgs, SwapExactOutInstructionData>;
1554
+ type SwapExactOutInput<TAccountTrader extends InstructionSignerInput = InstructionSignerInput, TAccountPool extends InstructionAccountInput = InstructionAccountInput, TAccountInputToken extends InstructionAccountInput = InstructionAccountInput, TAccountOutputToken extends InstructionAccountInput = InstructionAccountInput, TAccountInputVault extends InstructionAccountInput = InstructionAccountInput, TAccountOutputVault extends InstructionAccountInput = InstructionAccountInput, TAccountInputTokenProgram extends InstructionAccountInput = InstructionAccountInput, TAccountOutputTokenProgram extends InstructionAccountInput = InstructionAccountInput> = {
1555
+ /** The trader, who owns `input_token`. */
1556
+ trader: TAccountTrader;
1557
+ /** The pool to trade against. */
1558
+ pool: TAccountPool;
1559
+ /** The trader's account for the token being sold. */
1560
+ inputToken: TAccountInputToken;
1561
+ /** The account that receives the token being bought. */
1562
+ outputToken: TAccountOutputToken;
1563
+ /** The pool's vault for the token being sold. */
1564
+ inputVault: TAccountInputVault;
1565
+ /** The pool's vault for the token being bought. */
1566
+ outputVault: TAccountOutputVault;
1567
+ /** Token program that owns the sold token. */
1568
+ inputTokenProgram: TAccountInputTokenProgram;
1569
+ /** Token program that owns the bought token. */
1570
+ outputTokenProgram: TAccountOutputTokenProgram;
1571
+ amountOut: SwapExactOutInstructionDataArgs["amountOut"];
1572
+ maximumAmountIn: SwapExactOutInstructionDataArgs["maximumAmountIn"];
1573
+ };
1574
+ declare function getSwapExactOutInstruction<TAccountTrader extends InstructionSignerInput, TAccountPool extends InstructionAccountInput, TAccountInputToken extends InstructionAccountInput, TAccountOutputToken extends InstructionAccountInput, TAccountInputVault extends InstructionAccountInput, TAccountOutputVault extends InstructionAccountInput, TAccountInputTokenProgram extends InstructionAccountInput, TAccountOutputTokenProgram extends InstructionAccountInput, TProgramAddress extends Address = typeof PINA_AMM_PROGRAM_ADDRESS>(input: SwapExactOutInput<TAccountTrader, TAccountPool, TAccountInputToken, TAccountOutputToken, TAccountInputVault, TAccountOutputVault, TAccountInputTokenProgram, TAccountOutputTokenProgram>, config?: {
1575
+ programAddress?: TProgramAddress;
1576
+ }): SwapExactOutInstruction<TProgramAddress, ResolvedInstructionAccountMeta<TAccountTrader, InstructionAccountInputAddress<TAccountTrader>>, ResolvedInstructionAccountMeta<TAccountPool, InstructionAccountInputAddress<TAccountPool>>, ResolvedInstructionAccountMeta<TAccountInputToken, InstructionAccountInputAddress<TAccountInputToken>>, ResolvedInstructionAccountMeta<TAccountOutputToken, InstructionAccountInputAddress<TAccountOutputToken>>, ResolvedInstructionAccountMeta<TAccountInputVault, InstructionAccountInputAddress<TAccountInputVault>>, ResolvedInstructionAccountMeta<TAccountOutputVault, InstructionAccountInputAddress<TAccountOutputVault>>, ResolvedInstructionAccountMeta<TAccountInputTokenProgram, InstructionAccountInputAddress<TAccountInputTokenProgram>>, ResolvedInstructionAccountMeta<TAccountOutputTokenProgram, InstructionAccountInputAddress<TAccountOutputTokenProgram>>>;
1577
+ type ParsedSwapExactOutInstruction<TProgram extends string = typeof PINA_AMM_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
1578
+ programAddress: Address<TProgram>;
1579
+ accounts: {
1580
+ /** The trader, who owns `input_token`. */
1581
+ trader: TAccountMetas[0];
1582
+ /** The pool to trade against. */
1583
+ pool: TAccountMetas[1];
1584
+ /** The trader's account for the token being sold. */
1585
+ inputToken: TAccountMetas[2];
1586
+ /** The account that receives the token being bought. */
1587
+ outputToken: TAccountMetas[3];
1588
+ /** The pool's vault for the token being sold. */
1589
+ inputVault: TAccountMetas[4];
1590
+ /** The pool's vault for the token being bought. */
1591
+ outputVault: TAccountMetas[5];
1592
+ /** Token program that owns the sold token. */
1593
+ inputTokenProgram: TAccountMetas[6];
1594
+ /** Token program that owns the bought token. */
1595
+ outputTokenProgram: TAccountMetas[7];
1596
+ };
1597
+ data: SwapExactOutInstructionData;
1598
+ };
1599
+ declare function parseSwapExactOutInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedSwapExactOutInstruction<TProgram, TAccountMetas>;
1600
+
1601
+ /**
1602
+ * This code was AUTOGENERATED using the Codama library.
1603
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1604
+ * to add features, then rerun Codama to update it.
1605
+ *
1606
+ * @see https://github.com/codama-idl/codama
1607
+ */
1608
+
1609
+ declare const UPDATE_CONFIG_DISCRIMINATOR = 1;
1610
+ declare function getUpdateConfigDiscriminatorBytes(): ReadonlyUint8Array;
1611
+ type UpdateConfigInstruction<TProgram extends string = typeof PINA_AMM_PROGRAM_ADDRESS, TAccountAuthority extends string | AccountMeta<string> = string, TAccountAmmConfig extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[TAccountAuthority extends string ? ReadonlySignerAccount<TAccountAuthority> & AccountSignerMeta<TAccountAuthority> : TAccountAuthority, TAccountAmmConfig extends string ? WritableAccount<TAccountAmmConfig> : TAccountAmmConfig, ...TRemainingAccounts]>;
1612
+ type UpdateConfigInstructionData = {
1613
+ discriminator: number;
1614
+ /** New tier authority. Pass the current authority to keep it. */
1615
+ newAuthority: Address;
1616
+ /** Swap fee future pools snapshot, in parts per million. */
1617
+ tradeFeeRate: number;
1618
+ /** Protocol share future pools snapshot, in parts per million. */
1619
+ protocolFeeRate: number;
1620
+ /** Creator fee future pools snapshot, in parts per million. */
1621
+ creatorFeeRate: number;
1622
+ };
1623
+ type UpdateConfigInstructionDataArgs = {
1624
+ /** New tier authority. Pass the current authority to keep it. */
1625
+ newAuthority: Address;
1626
+ /** Swap fee future pools snapshot, in parts per million. */
1627
+ tradeFeeRate: number;
1628
+ /** Protocol share future pools snapshot, in parts per million. */
1629
+ protocolFeeRate: number;
1630
+ /** Creator fee future pools snapshot, in parts per million. */
1631
+ creatorFeeRate: number;
1632
+ };
1633
+ declare function getUpdateConfigInstructionDataEncoder(): FixedSizeEncoder<UpdateConfigInstructionDataArgs>;
1634
+ declare function getUpdateConfigInstructionDataDecoder(): FixedSizeDecoder<UpdateConfigInstructionData>;
1635
+ declare function getUpdateConfigInstructionDataCodec(): FixedSizeCodec<UpdateConfigInstructionDataArgs, UpdateConfigInstructionData>;
1636
+ type UpdateConfigInput<TAccountAuthority extends InstructionSignerInput = InstructionSignerInput, TAccountAmmConfig extends InstructionAccountInput = InstructionAccountInput> = {
1637
+ /** The tier's current authority. */
1638
+ authority: TAccountAuthority;
1639
+ /** The tier to update. */
1640
+ ammConfig: TAccountAmmConfig;
1641
+ newAuthority: UpdateConfigInstructionDataArgs["newAuthority"];
1642
+ tradeFeeRate: UpdateConfigInstructionDataArgs["tradeFeeRate"];
1643
+ protocolFeeRate: UpdateConfigInstructionDataArgs["protocolFeeRate"];
1644
+ creatorFeeRate: UpdateConfigInstructionDataArgs["creatorFeeRate"];
1645
+ };
1646
+ declare function getUpdateConfigInstruction<TAccountAuthority extends InstructionSignerInput, TAccountAmmConfig extends InstructionAccountInput, TProgramAddress extends Address = typeof PINA_AMM_PROGRAM_ADDRESS>(input: UpdateConfigInput<TAccountAuthority, TAccountAmmConfig>, config?: {
1647
+ programAddress?: TProgramAddress;
1648
+ }): UpdateConfigInstruction<TProgramAddress, ResolvedInstructionAccountMeta<TAccountAuthority, InstructionAccountInputAddress<TAccountAuthority>>, ResolvedInstructionAccountMeta<TAccountAmmConfig, InstructionAccountInputAddress<TAccountAmmConfig>>>;
1649
+ type ParsedUpdateConfigInstruction<TProgram extends string = typeof PINA_AMM_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
1650
+ programAddress: Address<TProgram>;
1651
+ accounts: {
1652
+ /** The tier's current authority. */
1653
+ authority: TAccountMetas[0];
1654
+ /** The tier to update. */
1655
+ ammConfig: TAccountMetas[1];
1656
+ };
1657
+ data: UpdateConfigInstructionData;
1658
+ };
1659
+ declare function parseUpdateConfigInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedUpdateConfigInstruction<TProgram, TAccountMetas>;
1660
+
1661
+ /**
1662
+ * This code was AUTOGENERATED using the Codama library.
1663
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1664
+ * to add features, then rerun Codama to update it.
1665
+ *
1666
+ * @see https://github.com/codama-idl/codama
1667
+ */
1668
+
1669
+ declare const WITHDRAW_DISCRIMINATOR = 4;
1670
+ declare function getWithdrawDiscriminatorBytes(): ReadonlyUint8Array;
1671
+ type WithdrawInstruction<TProgram extends string = typeof PINA_AMM_PROGRAM_ADDRESS, TAccountOwner extends string | AccountMeta<string> = string, TAccountPool extends string | AccountMeta<string> = string, TAccountVault0 extends string | AccountMeta<string> = string, TAccountVault1 extends string | AccountMeta<string> = string, TAccountLpMint extends string | AccountMeta<string> = string, TAccountOwnerToken0 extends string | AccountMeta<string> = string, TAccountOwnerToken1 extends string | AccountMeta<string> = string, TAccountOwnerLpToken extends string | AccountMeta<string> = string, TAccountTokenProgram0 extends string | AccountMeta<string> = string, TAccountTokenProgram1 extends string | AccountMeta<string> = string, TAccountLpTokenProgram extends string | AccountMeta<string> = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[TAccountOwner extends string ? ReadonlySignerAccount<TAccountOwner> & AccountSignerMeta<TAccountOwner> : TAccountOwner, TAccountPool extends string ? WritableAccount<TAccountPool> : TAccountPool, TAccountVault0 extends string ? WritableAccount<TAccountVault0> : TAccountVault0, TAccountVault1 extends string ? WritableAccount<TAccountVault1> : TAccountVault1, TAccountLpMint extends string ? WritableAccount<TAccountLpMint> : TAccountLpMint, TAccountOwnerToken0 extends string ? WritableAccount<TAccountOwnerToken0> : TAccountOwnerToken0, TAccountOwnerToken1 extends string ? WritableAccount<TAccountOwnerToken1> : TAccountOwnerToken1, TAccountOwnerLpToken extends string ? WritableAccount<TAccountOwnerLpToken> : TAccountOwnerLpToken, TAccountTokenProgram0 extends string ? ReadonlyAccount<TAccountTokenProgram0> : TAccountTokenProgram0, TAccountTokenProgram1 extends string ? ReadonlyAccount<TAccountTokenProgram1> : TAccountTokenProgram1, TAccountLpTokenProgram extends string ? ReadonlyAccount<TAccountLpTokenProgram> : TAccountLpTokenProgram, ...TRemainingAccounts]>;
1672
+ type WithdrawInstructionData = {
1673
+ discriminator: number;
1674
+ /** LP to burn. */
1675
+ lpAmount: bigint;
1676
+ /** Least token 0 the owner will accept. */
1677
+ minimumAmount0: bigint;
1678
+ /** Least token 1 the owner will accept. */
1679
+ minimumAmount1: bigint;
1680
+ };
1681
+ type WithdrawInstructionDataArgs = {
1682
+ /** LP to burn. */
1683
+ lpAmount: number | bigint;
1684
+ /** Least token 0 the owner will accept. */
1685
+ minimumAmount0: number | bigint;
1686
+ /** Least token 1 the owner will accept. */
1687
+ minimumAmount1: number | bigint;
1688
+ };
1689
+ declare function getWithdrawInstructionDataEncoder(): FixedSizeEncoder<WithdrawInstructionDataArgs>;
1690
+ declare function getWithdrawInstructionDataDecoder(): FixedSizeDecoder<WithdrawInstructionData>;
1691
+ declare function getWithdrawInstructionDataCodec(): FixedSizeCodec<WithdrawInstructionDataArgs, WithdrawInstructionData>;
1692
+ type WithdrawInput<TAccountOwner extends InstructionSignerInput = InstructionSignerInput, TAccountPool extends InstructionAccountInput = InstructionAccountInput, TAccountVault0 extends InstructionAccountInput = InstructionAccountInput, TAccountVault1 extends InstructionAccountInput = InstructionAccountInput, TAccountLpMint extends InstructionAccountInput = InstructionAccountInput, TAccountOwnerToken0 extends InstructionAccountInput = InstructionAccountInput, TAccountOwnerToken1 extends InstructionAccountInput = InstructionAccountInput, TAccountOwnerLpToken extends InstructionAccountInput = InstructionAccountInput, TAccountTokenProgram0 extends InstructionAccountInput = InstructionAccountInput, TAccountTokenProgram1 extends InstructionAccountInput = InstructionAccountInput, TAccountLpTokenProgram extends InstructionAccountInput = InstructionAccountInput> = {
1693
+ /** The LP owner, who owns every token account below. */
1694
+ owner: TAccountOwner;
1695
+ /** The pool. */
1696
+ pool: TAccountPool;
1697
+ /** The pool's token 0 vault. */
1698
+ vault0: TAccountVault0;
1699
+ /** The pool's token 1 vault. */
1700
+ vault1: TAccountVault1;
1701
+ /** The pool's LP mint. */
1702
+ lpMint: TAccountLpMint;
1703
+ /** The owner's token 0 account. */
1704
+ ownerToken0: TAccountOwnerToken0;
1705
+ /** The owner's token 1 account. */
1706
+ ownerToken1: TAccountOwnerToken1;
1707
+ /** The owner's LP token account. */
1708
+ ownerLpToken: TAccountOwnerLpToken;
1709
+ /** Token program that owns token 0. */
1710
+ tokenProgram0: TAccountTokenProgram0;
1711
+ /** Token program that owns token 1. */
1712
+ tokenProgram1: TAccountTokenProgram1;
1713
+ /** SPL Token, which owns every LP mint. */
1714
+ lpTokenProgram?: TAccountLpTokenProgram;
1715
+ lpAmount: WithdrawInstructionDataArgs["lpAmount"];
1716
+ minimumAmount0: WithdrawInstructionDataArgs["minimumAmount0"];
1717
+ minimumAmount1: WithdrawInstructionDataArgs["minimumAmount1"];
1718
+ };
1719
+ declare function getWithdrawInstruction<TAccountOwner extends InstructionSignerInput, TAccountPool extends InstructionAccountInput, TAccountVault0 extends InstructionAccountInput, TAccountVault1 extends InstructionAccountInput, TAccountLpMint extends InstructionAccountInput, TAccountOwnerToken0 extends InstructionAccountInput, TAccountOwnerToken1 extends InstructionAccountInput, TAccountOwnerLpToken extends InstructionAccountInput, TAccountTokenProgram0 extends InstructionAccountInput, TAccountTokenProgram1 extends InstructionAccountInput, TAccountLpTokenProgram extends InstructionAccountInput, TProgramAddress extends Address = typeof PINA_AMM_PROGRAM_ADDRESS>(input: WithdrawInput<TAccountOwner, TAccountPool, TAccountVault0, TAccountVault1, TAccountLpMint, TAccountOwnerToken0, TAccountOwnerToken1, TAccountOwnerLpToken, TAccountTokenProgram0, TAccountTokenProgram1, TAccountLpTokenProgram>, config?: {
1720
+ programAddress?: TProgramAddress;
1721
+ }): WithdrawInstruction<TProgramAddress, ResolvedInstructionAccountMeta<TAccountOwner, InstructionAccountInputAddress<TAccountOwner>>, ResolvedInstructionAccountMeta<TAccountPool, InstructionAccountInputAddress<TAccountPool>>, ResolvedInstructionAccountMeta<TAccountVault0, InstructionAccountInputAddress<TAccountVault0>>, ResolvedInstructionAccountMeta<TAccountVault1, InstructionAccountInputAddress<TAccountVault1>>, ResolvedInstructionAccountMeta<TAccountLpMint, InstructionAccountInputAddress<TAccountLpMint>>, ResolvedInstructionAccountMeta<TAccountOwnerToken0, InstructionAccountInputAddress<TAccountOwnerToken0>>, ResolvedInstructionAccountMeta<TAccountOwnerToken1, InstructionAccountInputAddress<TAccountOwnerToken1>>, ResolvedInstructionAccountMeta<TAccountOwnerLpToken, InstructionAccountInputAddress<TAccountOwnerLpToken>>, ResolvedInstructionAccountMeta<TAccountTokenProgram0, InstructionAccountInputAddress<TAccountTokenProgram0>>, ResolvedInstructionAccountMeta<TAccountTokenProgram1, InstructionAccountInputAddress<TAccountTokenProgram1>>, ResolvedInstructionAccountMeta<TAccountLpTokenProgram, InstructionAccountInputAddress<TAccountLpTokenProgram>>>;
1722
+ type ParsedWithdrawInstruction<TProgram extends string = typeof PINA_AMM_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
1723
+ programAddress: Address<TProgram>;
1724
+ accounts: {
1725
+ /** The LP owner, who owns every token account below. */
1726
+ owner: TAccountMetas[0];
1727
+ /** The pool. */
1728
+ pool: TAccountMetas[1];
1729
+ /** The pool's token 0 vault. */
1730
+ vault0: TAccountMetas[2];
1731
+ /** The pool's token 1 vault. */
1732
+ vault1: TAccountMetas[3];
1733
+ /** The pool's LP mint. */
1734
+ lpMint: TAccountMetas[4];
1735
+ /** The owner's token 0 account. */
1736
+ ownerToken0: TAccountMetas[5];
1737
+ /** The owner's token 1 account. */
1738
+ ownerToken1: TAccountMetas[6];
1739
+ /** The owner's LP token account. */
1740
+ ownerLpToken: TAccountMetas[7];
1741
+ /** Token program that owns token 0. */
1742
+ tokenProgram0: TAccountMetas[8];
1743
+ /** Token program that owns token 1. */
1744
+ tokenProgram1: TAccountMetas[9];
1745
+ /** SPL Token, which owns every LP mint. */
1746
+ lpTokenProgram: TAccountMetas[10];
1747
+ };
1748
+ data: WithdrawInstructionData;
1749
+ };
1750
+ declare function parseWithdrawInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedWithdrawInstruction<TProgram, TAccountMetas>;
1751
+
1752
+ export { AMM_CONFIG_DISCRIMINATOR, AMM_CONFIG_DISCRIMINATOR2, AMM_CONFIG_MIGRATION_VERSION, type AmmConfig, type AmmConfigArgs, type AmmConfigSeeds, COLLECT_CREATOR_FEES_DISCRIMINATOR, COLLECT_PROTOCOL_FEES_DISCRIMINATOR, CREATE_CONFIG_DISCRIMINATOR, CREATE_POOL_DISCRIMINATOR, type CollectCreatorFeesInput, type CollectCreatorFeesInstruction, type CollectCreatorFeesInstructionData, type CollectCreatorFeesInstructionDataArgs, type CollectProtocolFeesInput, type CollectProtocolFeesInstruction, type CollectProtocolFeesInstructionData, type CollectProtocolFeesInstructionDataArgs, type CreateConfigInput, type CreateConfigInstruction, type CreateConfigInstructionData, type CreateConfigInstructionDataArgs, type CreatePoolAsyncInput, type CreatePoolInput, type CreatePoolInstruction, type CreatePoolInstructionData, type CreatePoolInstructionDataArgs, DEPOSIT_DISCRIMINATOR, type DecodedFeesCollectedEvent, type DecodedLiquidityChangedEvent, type DecodedPinaAmmEvent, type DecodedPoolCreatedEvent, type DecodedSwappedEvent, type DepositInput, type DepositInstruction, type DepositInstructionData, type DepositInstructionDataArgs, FEES_COLLECTED_EVENT_DISCRIMINATOR, FEES_COLLECTED_EVENT_DISCRIMINATOR2, type FeesCollectedEvent, type FeesCollectedEventArgs, LIQUIDITY_CHANGED_EVENT_DISCRIMINATOR, LIQUIDITY_CHANGED_EVENT_DISCRIMINATOR2, type LiquidityChangedEvent, type LiquidityChangedEventArgs, MIGRATE_DISCRIMINATOR, type MigrateInput, type MigrateInstruction, PINA_AMM_ERROR__INSUFFICIENT_INITIAL_LIQUIDITY, PINA_AMM_ERROR__INSUFFICIENT_LIQUIDITY, PINA_AMM_ERROR__INVALID_CREATOR_FEE_MODE, PINA_AMM_ERROR__INVALID_FEE_RATES, PINA_AMM_ERROR__INVALID_MINT_ORDER, PINA_AMM_ERROR__INVALID_PROGRAM_DATA, PINA_AMM_ERROR__INVARIANT_VIOLATION, PINA_AMM_ERROR__MATH_OVERFLOW, PINA_AMM_ERROR__POOL_ACCOUNT_MISMATCH, PINA_AMM_ERROR__POOL_CREATOR_NOT_AUTHORIZED, PINA_AMM_ERROR__SLIPPAGE_EXCEEDED, PINA_AMM_ERROR__UNAUTHORIZED, PINA_AMM_ERROR__UNSUPPORTED_MINT, PINA_AMM_ERROR__VAULT_ACCOUNTING_MISMATCH, PINA_AMM_ERROR__ZERO_AMOUNT, PINA_AMM_EVENT_SOURCE_ADDRESS, PINA_AMM_PROGRAM_ADDRESS, POOL_CREATED_EVENT_DISCRIMINATOR, POOL_CREATED_EVENT_DISCRIMINATOR2, POOL_DISCRIMINATOR, POOL_DISCRIMINATOR2, POOL_MIGRATION_VERSION, type ParsedCollectCreatorFeesInstruction, type ParsedCollectProtocolFeesInstruction, type ParsedCreateConfigInstruction, type ParsedCreatePoolInstruction, type ParsedDepositInstruction, type ParsedPinaAmmInstruction, type ParsedSetPoolCreatorInstruction, type ParsedSwapExactInInstruction, type ParsedSwapExactOutInstruction, type ParsedUpdateConfigInstruction, type ParsedWithdrawInstruction, PinaAmmAccount, type PinaAmmError, PinaAmmEvent, PinaAmmInstruction, type PinaAmmPlugin, type PinaAmmPluginAccounts, type PinaAmmPluginInstructions, type PinaAmmPluginPdas, type PinaAmmPluginRequirements, type Pool, type PoolArgs, type PoolCreatedEvent, type PoolCreatedEventArgs, type PoolLpMintSeeds, type PoolSeeds, type PoolVaultSeeds, SET_POOL_CREATOR_DISCRIMINATOR, SWAPPED_EVENT_DISCRIMINATOR, SWAPPED_EVENT_DISCRIMINATOR2, SWAP_EXACT_IN_DISCRIMINATOR, SWAP_EXACT_OUT_DISCRIMINATOR, type SetPoolCreatorInput, type SetPoolCreatorInstruction, type SetPoolCreatorInstructionData, type SetPoolCreatorInstructionDataArgs, type SwapExactInInput, type SwapExactInInstruction, type SwapExactInInstructionData, type SwapExactInInstructionDataArgs, type SwapExactOutInput, type SwapExactOutInstruction, type SwapExactOutInstructionData, type SwapExactOutInstructionDataArgs, type SwappedEvent, type SwappedEventArgs, UPDATE_CONFIG_DISCRIMINATOR, type UpdateConfigInput, type UpdateConfigInstruction, type UpdateConfigInstructionData, type UpdateConfigInstructionDataArgs, WITHDRAW_DISCRIMINATOR, type WithdrawInput, type WithdrawInstruction, type WithdrawInstructionData, type WithdrawInstructionDataArgs, ammConfigNeedsMigration, decodeAmmConfig, decodeFeesCollectedEvent, decodeLiquidityChangedEvent, decodePool, decodePoolCreatedEvent, decodeSwappedEvent, fetchAllAmmConfig, fetchAllMaybeAmmConfig, fetchAllMaybePool, fetchAllPool, fetchAmmConfig, fetchAmmConfigFromSeeds, fetchMaybeAmmConfig, fetchMaybeAmmConfigFromSeeds, fetchMaybePool, fetchMaybePoolFromSeeds, fetchPool, fetchPoolFromSeeds, findAmmConfigPda, findPoolLpMintPda, findPoolPda, findPoolVaultPda, getAmmConfigCodec, getAmmConfigDecoder, getAmmConfigDiscriminator2Bytes, getAmmConfigDiscriminatorBytes, getAmmConfigEncoder, getCollectCreatorFeesDiscriminatorBytes, getCollectCreatorFeesInstruction, getCollectCreatorFeesInstructionDataCodec, getCollectCreatorFeesInstructionDataDecoder, getCollectCreatorFeesInstructionDataEncoder, getCollectProtocolFeesDiscriminatorBytes, getCollectProtocolFeesInstruction, getCollectProtocolFeesInstructionDataCodec, getCollectProtocolFeesInstructionDataDecoder, getCollectProtocolFeesInstructionDataEncoder, getCreateConfigDiscriminatorBytes, getCreateConfigInstruction, getCreateConfigInstructionDataCodec, getCreateConfigInstructionDataDecoder, getCreateConfigInstructionDataEncoder, getCreatePoolDiscriminatorBytes, getCreatePoolInstruction, getCreatePoolInstructionAsync, getCreatePoolInstructionDataCodec, getCreatePoolInstructionDataDecoder, getCreatePoolInstructionDataEncoder, getDepositDiscriminatorBytes, getDepositInstruction, getDepositInstructionDataCodec, getDepositInstructionDataDecoder, getDepositInstructionDataEncoder, getFeesCollectedEventCodec, getFeesCollectedEventDecoder, getFeesCollectedEventDiscriminator2Bytes, getFeesCollectedEventDiscriminatorBytes, getFeesCollectedEventEncoder, getLiquidityChangedEventCodec, getLiquidityChangedEventDecoder, getLiquidityChangedEventDiscriminator2Bytes, getLiquidityChangedEventDiscriminatorBytes, getLiquidityChangedEventEncoder, getMigrateDiscriminatorBytes, getMigrateInstruction, getPinaAmmErrorMessage, getPoolCodec, getPoolCreatedEventCodec, getPoolCreatedEventDecoder, getPoolCreatedEventDiscriminator2Bytes, getPoolCreatedEventDiscriminatorBytes, getPoolCreatedEventEncoder, getPoolDecoder, getPoolDiscriminator2Bytes, getPoolDiscriminatorBytes, getPoolEncoder, getSetPoolCreatorDiscriminatorBytes, getSetPoolCreatorInstruction, getSetPoolCreatorInstructionDataCodec, getSetPoolCreatorInstructionDataDecoder, getSetPoolCreatorInstructionDataEncoder, getSwapExactInDiscriminatorBytes, getSwapExactInInstruction, getSwapExactInInstructionDataCodec, getSwapExactInInstructionDataDecoder, getSwapExactInInstructionDataEncoder, getSwapExactOutDiscriminatorBytes, getSwapExactOutInstruction, getSwapExactOutInstructionDataCodec, getSwapExactOutInstructionDataDecoder, getSwapExactOutInstructionDataEncoder, getSwappedEventCodec, getSwappedEventDecoder, getSwappedEventDiscriminator2Bytes, getSwappedEventDiscriminatorBytes, getSwappedEventEncoder, getUpdateConfigDiscriminatorBytes, getUpdateConfigInstruction, getUpdateConfigInstructionDataCodec, getUpdateConfigInstructionDataDecoder, getUpdateConfigInstructionDataEncoder, getWithdrawDiscriminatorBytes, getWithdrawInstruction, getWithdrawInstructionDataCodec, getWithdrawInstructionDataDecoder, getWithdrawInstructionDataEncoder, identifyPinaAmmAccount, identifyPinaAmmEvent, identifyPinaAmmInstruction, isPinaAmmError, parseCollectCreatorFeesInstruction, parseCollectProtocolFeesInstruction, parseCreateConfigInstruction, parseCreatePoolInstruction, parseDepositInstruction, parseFeesCollectedEvent, parseFeesCollectedEventFromLog, parseLiquidityChangedEvent, parseLiquidityChangedEventFromLog, parsePinaAmmEventsFromLogs, parsePinaAmmInstruction, parsePoolCreatedEvent, parsePoolCreatedEventFromLog, parseSetPoolCreatorInstruction, parseSwapExactInInstruction, parseSwapExactOutInstruction, parseSwappedEvent, parseSwappedEventFromLog, parseUpdateConfigInstruction, parseWithdrawInstruction, pinaAmmProgram, poolNeedsMigration };