@pina-rs/amm 0.0.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -2
- package/dist/index.cjs +1744 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +2192 -0
- package/dist/index.d.ts +2192 -0
- package/dist/index.js +1507 -0
- package/dist/index.js.map +1 -0
- package/package.json +55 -5
- package/src/generated/accounts/ammConfig.ts +197 -0
- package/src/generated/accounts/index.ts +10 -0
- package/src/generated/accounts/pool.ts +274 -0
- package/src/generated/errors/index.ts +9 -0
- package/src/generated/errors/pinaAmm.ts +66 -0
- package/src/generated/events/configCreated.ts +80 -0
- package/src/generated/events/configUpdated.ts +64 -0
- package/src/generated/events/feesCollected.ts +64 -0
- package/src/generated/events/index.ts +18 -0
- package/src/generated/events/liquidityChanged.ts +72 -0
- package/src/generated/events/logs.ts +732 -0
- package/src/generated/events/poolCreated.ts +80 -0
- package/src/generated/events/poolCreatorChanged.ts +56 -0
- package/src/generated/events/poolSynced.ts +78 -0
- package/src/generated/events/poolSyncedV0.ts +44 -0
- package/src/generated/events/swapped.ts +100 -0
- package/src/generated/index.ts +14 -0
- package/src/generated/instructions/collectCreatorFees.ts +119 -0
- package/src/generated/instructions/collectProtocolFees.ts +123 -0
- package/src/generated/instructions/createConfig.ts +142 -0
- package/src/generated/instructions/createPool.ts +291 -0
- package/src/generated/instructions/deposit.ts +139 -0
- package/src/generated/instructions/index.ts +20 -0
- package/src/generated/instructions/migrate.ts +155 -0
- package/src/generated/instructions/setPoolCreator.ts +90 -0
- package/src/generated/instructions/swapExactIn.ts +119 -0
- package/src/generated/instructions/swapExactOut.ts +119 -0
- package/src/generated/instructions/syncPool.ts +93 -0
- package/src/generated/instructions/updateConfig.ts +105 -0
- package/src/generated/instructions/withdraw.ts +139 -0
- package/src/generated/pdas/ammConfig.ts +18 -0
- package/src/generated/pdas/index.ts +12 -0
- package/src/generated/pdas/pool.ts +20 -0
- package/src/generated/pdas/poolLpMint.ts +18 -0
- package/src/generated/pdas/poolVault.ts +19 -0
- package/src/generated/pinaPodCodecs.ts +232 -0
- package/src/generated/programs/index.ts +9 -0
- package/src/generated/programs/pinaAmm.ts +124 -0
- package/src/index.ts +11 -0
- package/CHANGELOG.md +0 -5
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,2192 @@
|
|
|
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 = 1;
|
|
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
|
+
* Low 128 bits of the Q64.64 price-time integral. Combine with
|
|
253
|
+
* `price_0_cumulative_high_last` as `low + high * 2^128`. Every swap, deposit,
|
|
254
|
+
* withdrawal, and `SyncPool` advances it with `reserve_0_last` and
|
|
255
|
+
* `reserve_1_last` before changing the reserves.
|
|
256
|
+
*/
|
|
257
|
+
price0CumulativeLast: bigint;
|
|
258
|
+
/**
|
|
259
|
+
* High 128 bits of the Q64.64 price-time integral. Together the limbs
|
|
260
|
+
* retain every bit for all supported reserve ratios and timestamp windows.
|
|
261
|
+
*/
|
|
262
|
+
price0CumulativeHighLast: bigint;
|
|
263
|
+
/** Unix second of the last accumulator advance; zero before the first. */
|
|
264
|
+
lastUpdateTimestamp: bigint;
|
|
265
|
+
/**
|
|
266
|
+
* Token 0 reserve at the end of the last instruction that changed or
|
|
267
|
+
* observed the reserves: `CreatePool`, a swap, a deposit, a withdrawal,
|
|
268
|
+
* or `SyncPool`. It prices the accumulator's next interval and nothing
|
|
269
|
+
* else: trades and liquidity always price from the live vault balances.
|
|
270
|
+
*/
|
|
271
|
+
reserve0Last: bigint;
|
|
272
|
+
/**
|
|
273
|
+
* Token 1 reserve at the end of the last instruction that changed or
|
|
274
|
+
* observed the reserves: `CreatePool`, a swap, a deposit, a withdrawal,
|
|
275
|
+
* or `SyncPool`. It prices the accumulator's next interval and nothing
|
|
276
|
+
* else: trades and liquidity always price from the live vault balances.
|
|
277
|
+
*/
|
|
278
|
+
reserve1Last: bigint;
|
|
279
|
+
};
|
|
280
|
+
type PoolArgs = {
|
|
281
|
+
/** Fee tier this pool was created under. */
|
|
282
|
+
ammConfig: Address;
|
|
283
|
+
/** Recipient of this pool's creator fees. */
|
|
284
|
+
creator: Address;
|
|
285
|
+
/** Smaller mint of the pair. */
|
|
286
|
+
mint0: Address;
|
|
287
|
+
/** Larger mint of the pair. */
|
|
288
|
+
mint1: Address;
|
|
289
|
+
/** Pool-owned token account holding token 0. */
|
|
290
|
+
vault0: Address;
|
|
291
|
+
/** Pool-owned token account holding token 1. */
|
|
292
|
+
vault1: Address;
|
|
293
|
+
/** LP mint whose mint authority is this pool. */
|
|
294
|
+
lpMint: Address;
|
|
295
|
+
/**
|
|
296
|
+
* Economic LP supply, including `MINIMUM_LIQUIDITY` and any LP burned
|
|
297
|
+
* outside the program. Only deposits and withdrawals change it, so LP
|
|
298
|
+
* burned directly through the token program stays locked forever.
|
|
299
|
+
*/
|
|
300
|
+
lpSupply: number | bigint;
|
|
301
|
+
/** Accrued, unpaid protocol fees held in vault 0. */
|
|
302
|
+
protocolFees0: number | bigint;
|
|
303
|
+
/** Accrued, unpaid protocol fees held in vault 1. */
|
|
304
|
+
protocolFees1: number | bigint;
|
|
305
|
+
/** Accrued, unpaid creator fees held in vault 0. */
|
|
306
|
+
creatorFees0: number | bigint;
|
|
307
|
+
/** Accrued, unpaid creator fees held in vault 1. */
|
|
308
|
+
creatorFees1: number | bigint;
|
|
309
|
+
/** Trade fee rate snapshotted from the tier, in parts per million. */
|
|
310
|
+
tradeFeeRate: number;
|
|
311
|
+
/**
|
|
312
|
+
* Protocol share of the trade fee snapshotted from the tier, in parts per
|
|
313
|
+
* million.
|
|
314
|
+
*/
|
|
315
|
+
protocolFeeRate: number;
|
|
316
|
+
/** Creator fee rate snapshotted from the tier, in parts per million. */
|
|
317
|
+
creatorFeeRate: number;
|
|
318
|
+
/** `CreatorFeeMode` wire value. */
|
|
319
|
+
creatorFeeMode: number;
|
|
320
|
+
/** Canonical bump of this pool's PDA. */
|
|
321
|
+
bump: number;
|
|
322
|
+
/**
|
|
323
|
+
* Low 128 bits of the Q64.64 price-time integral. Combine with
|
|
324
|
+
* `price_0_cumulative_high_last` as `low + high * 2^128`. Every swap, deposit,
|
|
325
|
+
* withdrawal, and `SyncPool` advances it with `reserve_0_last` and
|
|
326
|
+
* `reserve_1_last` before changing the reserves.
|
|
327
|
+
*/
|
|
328
|
+
price0CumulativeLast: number | bigint;
|
|
329
|
+
/**
|
|
330
|
+
* High 128 bits of the Q64.64 price-time integral. Together the limbs
|
|
331
|
+
* retain every bit for all supported reserve ratios and timestamp windows.
|
|
332
|
+
*/
|
|
333
|
+
price0CumulativeHighLast: number | bigint;
|
|
334
|
+
/** Unix second of the last accumulator advance; zero before the first. */
|
|
335
|
+
lastUpdateTimestamp: number | bigint;
|
|
336
|
+
/**
|
|
337
|
+
* Token 0 reserve at the end of the last instruction that changed or
|
|
338
|
+
* observed the reserves: `CreatePool`, a swap, a deposit, a withdrawal,
|
|
339
|
+
* or `SyncPool`. It prices the accumulator's next interval and nothing
|
|
340
|
+
* else: trades and liquidity always price from the live vault balances.
|
|
341
|
+
*/
|
|
342
|
+
reserve0Last: number | bigint;
|
|
343
|
+
/**
|
|
344
|
+
* Token 1 reserve at the end of the last instruction that changed or
|
|
345
|
+
* observed the reserves: `CreatePool`, a swap, a deposit, a withdrawal,
|
|
346
|
+
* or `SyncPool`. It prices the accumulator's next interval and nothing
|
|
347
|
+
* else: trades and liquidity always price from the live vault balances.
|
|
348
|
+
*/
|
|
349
|
+
reserve1Last: number | bigint;
|
|
350
|
+
};
|
|
351
|
+
/** Gets the encoder for {@link PoolArgs} account data. */
|
|
352
|
+
declare function getPoolEncoder(): FixedSizeEncoder<PoolArgs>;
|
|
353
|
+
/** Gets the decoder for {@link Pool} account data. */
|
|
354
|
+
declare function getPoolDecoder(): FixedSizeDecoder<Pool>;
|
|
355
|
+
/** Gets the codec for {@link Pool} account data. */
|
|
356
|
+
declare function getPoolCodec(): FixedSizeCodec<PoolArgs, Pool>;
|
|
357
|
+
declare function decodePool<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<Pool, TAddress>;
|
|
358
|
+
declare function decodePool<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<Pool, TAddress>;
|
|
359
|
+
declare function fetchPool<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<Pool, TAddress>>;
|
|
360
|
+
declare function fetchMaybePool<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<Pool, TAddress>>;
|
|
361
|
+
declare function fetchAllPool(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<Pool>[]>;
|
|
362
|
+
declare function fetchAllMaybePool(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<Pool>[]>;
|
|
363
|
+
declare function fetchPoolFromSeeds(rpc: Parameters<typeof fetchEncodedAccount>[0], seeds: PoolSeeds, config?: FetchAccountConfig & {
|
|
364
|
+
programAddress?: Address;
|
|
365
|
+
}): Promise<Account<Pool>>;
|
|
366
|
+
declare function fetchMaybePoolFromSeeds(rpc: Parameters<typeof fetchEncodedAccount>[0], seeds: PoolSeeds, config?: FetchAccountConfig & {
|
|
367
|
+
programAddress?: Address;
|
|
368
|
+
}): Promise<MaybeAccount<Pool>>;
|
|
369
|
+
/** The account schema version this client was generated from. */
|
|
370
|
+
declare const POOL_MIGRATION_VERSION = 1;
|
|
371
|
+
/**
|
|
372
|
+
* Cheap envelope check for a fetched `Pool` account: `true` only when the
|
|
373
|
+
* bytes name this account's discriminator and a migration version older than
|
|
374
|
+
* this client's schema. Those are exactly the accounts
|
|
375
|
+
* {@link getMigrateInstruction} can bring current; every other mismatch is
|
|
376
|
+
* reported by the decoder when the account is decoded.
|
|
377
|
+
*
|
|
378
|
+
* ```ts
|
|
379
|
+
* const account = await fetchEncodedAccount(rpc, address);
|
|
380
|
+
* if (account.exists && poolNeedsMigration(account.data)) {
|
|
381
|
+
* // Migrate first, then retry the instruction that failed.
|
|
382
|
+
* await send(getMigrateInstruction({ pool: address, payer }));
|
|
383
|
+
* }
|
|
384
|
+
* ```
|
|
385
|
+
*/
|
|
386
|
+
declare function poolNeedsMigration(data: ReadonlyUint8Array): boolean;
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
390
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
391
|
+
* to add features, then rerun Codama to update it.
|
|
392
|
+
*
|
|
393
|
+
* @see https://github.com/codama-idl/codama
|
|
394
|
+
*/
|
|
395
|
+
|
|
396
|
+
/** Fee rates are out of range: trade plus creator fee above 10% or protocol share above 100%. */
|
|
397
|
+
declare const PINA_AMM_ERROR__INVALID_FEE_RATES = 0;
|
|
398
|
+
/** The signer is not the authority this instruction requires. */
|
|
399
|
+
declare const PINA_AMM_ERROR__UNAUTHORIZED = 1;
|
|
400
|
+
/** The program-data account is not this program's, or the program is not upgradeable. */
|
|
401
|
+
declare const PINA_AMM_ERROR__INVALID_PROGRAM_DATA = 2;
|
|
402
|
+
/** Pool mints must be distinct and passed in ascending byte order. */
|
|
403
|
+
declare const PINA_AMM_ERROR__INVALID_MINT_ORDER = 3;
|
|
404
|
+
/** The mint's token program or Token-2022 extensions are not supported. */
|
|
405
|
+
declare const PINA_AMM_ERROR__UNSUPPORTED_MINT = 4;
|
|
406
|
+
/** A vault, LP mint, or fee tier account does not belong to this pool. */
|
|
407
|
+
declare const PINA_AMM_ERROR__POOL_ACCOUNT_MISMATCH = 5;
|
|
408
|
+
/** The creator fee mode must be 0 (input token), 1 (token 0), or 2 (token 1). */
|
|
409
|
+
declare const PINA_AMM_ERROR__INVALID_CREATOR_FEE_MODE = 6;
|
|
410
|
+
/** The initial deposit must mint more LP than the permanently locked minimum. */
|
|
411
|
+
declare const PINA_AMM_ERROR__INSUFFICIENT_INITIAL_LIQUIDITY = 7;
|
|
412
|
+
/** An amount is zero or the trade rounds down to nothing. */
|
|
413
|
+
declare const PINA_AMM_ERROR__ZERO_AMOUNT = 8;
|
|
414
|
+
/** The result is worse than the caller's slippage limit. */
|
|
415
|
+
declare const PINA_AMM_ERROR__SLIPPAGE_EXCEEDED = 9;
|
|
416
|
+
/** The pool cannot pay this amount from its reserves. */
|
|
417
|
+
declare const PINA_AMM_ERROR__INSUFFICIENT_LIQUIDITY = 10;
|
|
418
|
+
/** An intermediate value overflowed or did not fit its type. */
|
|
419
|
+
declare const PINA_AMM_ERROR__MATH_OVERFLOW = 11;
|
|
420
|
+
/** The trade would decrease the pool's constant product. */
|
|
421
|
+
declare const PINA_AMM_ERROR__INVARIANT_VIOLATION = 12;
|
|
422
|
+
/** A vault holds less than the fees accrued against it. */
|
|
423
|
+
declare const PINA_AMM_ERROR__VAULT_ACCOUNTING_MISMATCH = 13;
|
|
424
|
+
/** This fee tier only lets its pool-creator authority create pools. */
|
|
425
|
+
declare const PINA_AMM_ERROR__POOL_CREATOR_NOT_AUTHORIZED = 14;
|
|
426
|
+
/** The pool creator may not be the default address, which can never sign or collect. */
|
|
427
|
+
declare const PINA_AMM_ERROR__DEFAULT_CREATOR = 15;
|
|
428
|
+
type PinaAmmError = typeof PINA_AMM_ERROR__DEFAULT_CREATOR | 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;
|
|
429
|
+
declare function getPinaAmmErrorMessage(code: PinaAmmError): string;
|
|
430
|
+
declare function isPinaAmmError<TProgramErrorCode extends PinaAmmError>(error: unknown, transactionMessage: {
|
|
431
|
+
instructions: Record<number, {
|
|
432
|
+
programAddress: Address;
|
|
433
|
+
}>;
|
|
434
|
+
}, code?: TProgramErrorCode): error is SolanaError<typeof SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM> & Readonly<{
|
|
435
|
+
context: Readonly<{
|
|
436
|
+
code: TProgramErrorCode;
|
|
437
|
+
}>;
|
|
438
|
+
}>;
|
|
439
|
+
|
|
440
|
+
/**
|
|
441
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
442
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
443
|
+
* to add features, then rerun Codama to update it.
|
|
444
|
+
*
|
|
445
|
+
* @see https://github.com/codama-idl/codama
|
|
446
|
+
*/
|
|
447
|
+
|
|
448
|
+
declare const POOL_CREATED_EVENT_DISCRIMINATOR = 1;
|
|
449
|
+
declare function getPoolCreatedEventDiscriminatorBytes(): ReadonlyUint8Array;
|
|
450
|
+
declare const POOL_CREATED_EVENT_DISCRIMINATOR2 = 0;
|
|
451
|
+
declare function getPoolCreatedEventDiscriminator2Bytes(): ReadonlyUint8Array;
|
|
452
|
+
/** Emitted by `CreatePool`. */
|
|
453
|
+
type PoolCreatedEvent = {
|
|
454
|
+
discriminator: number;
|
|
455
|
+
migrationVersion: number;
|
|
456
|
+
/** The new pool. */
|
|
457
|
+
pool: Address;
|
|
458
|
+
/** Fee tier the pool was created under. */
|
|
459
|
+
ammConfig: Address;
|
|
460
|
+
/** Recipient of the pool's creator fees. */
|
|
461
|
+
creator: Address;
|
|
462
|
+
/** Smaller mint of the pair. */
|
|
463
|
+
mint0: Address;
|
|
464
|
+
/** Larger mint of the pair. */
|
|
465
|
+
mint1: Address;
|
|
466
|
+
/** The pool's LP mint. */
|
|
467
|
+
lpMint: Address;
|
|
468
|
+
/** Initial reserve of token 0. */
|
|
469
|
+
amount0: bigint;
|
|
470
|
+
/** Initial reserve of token 1. */
|
|
471
|
+
amount1: bigint;
|
|
472
|
+
/** Initial economic LP supply, including the locked minimum. */
|
|
473
|
+
lpSupply: bigint;
|
|
474
|
+
};
|
|
475
|
+
type PoolCreatedEventArgs = {
|
|
476
|
+
/** The new pool. */
|
|
477
|
+
pool: Address;
|
|
478
|
+
/** Fee tier the pool was created under. */
|
|
479
|
+
ammConfig: Address;
|
|
480
|
+
/** Recipient of the pool's creator fees. */
|
|
481
|
+
creator: Address;
|
|
482
|
+
/** Smaller mint of the pair. */
|
|
483
|
+
mint0: Address;
|
|
484
|
+
/** Larger mint of the pair. */
|
|
485
|
+
mint1: Address;
|
|
486
|
+
/** The pool's LP mint. */
|
|
487
|
+
lpMint: Address;
|
|
488
|
+
/** Initial reserve of token 0. */
|
|
489
|
+
amount0: number | bigint;
|
|
490
|
+
/** Initial reserve of token 1. */
|
|
491
|
+
amount1: number | bigint;
|
|
492
|
+
/** Initial economic LP supply, including the locked minimum. */
|
|
493
|
+
lpSupply: number | bigint;
|
|
494
|
+
};
|
|
495
|
+
/** Gets the encoder for {@link PoolCreatedEventArgs} event data. */
|
|
496
|
+
declare function getPoolCreatedEventEncoder(): FixedSizeEncoder<PoolCreatedEventArgs>;
|
|
497
|
+
/** Gets the decoder for {@link PoolCreatedEvent} event data. */
|
|
498
|
+
declare function getPoolCreatedEventDecoder(): FixedSizeDecoder<PoolCreatedEvent>;
|
|
499
|
+
/** Gets the codec for {@link PoolCreatedEvent} event data. */
|
|
500
|
+
declare function getPoolCreatedEventCodec(): FixedSizeCodec<PoolCreatedEventArgs, PoolCreatedEvent>;
|
|
501
|
+
/** Parses the provided bytes into {@link PoolCreatedEvent} event data. */
|
|
502
|
+
declare function parsePoolCreatedEvent(data: ReadonlyUint8Array | Uint8Array): PoolCreatedEvent;
|
|
503
|
+
|
|
504
|
+
/**
|
|
505
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
506
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
507
|
+
* to add features, then rerun Codama to update it.
|
|
508
|
+
*
|
|
509
|
+
* @see https://github.com/codama-idl/codama
|
|
510
|
+
*/
|
|
511
|
+
|
|
512
|
+
declare const SWAPPED_EVENT_DISCRIMINATOR = 2;
|
|
513
|
+
declare function getSwappedEventDiscriminatorBytes(): ReadonlyUint8Array;
|
|
514
|
+
declare const SWAPPED_EVENT_DISCRIMINATOR2 = 0;
|
|
515
|
+
declare function getSwappedEventDiscriminator2Bytes(): ReadonlyUint8Array;
|
|
516
|
+
/** Emitted by `SwapExactIn` and `SwapExactOut`. */
|
|
517
|
+
type SwappedEvent = {
|
|
518
|
+
discriminator: number;
|
|
519
|
+
migrationVersion: number;
|
|
520
|
+
/** The pool traded against. */
|
|
521
|
+
pool: Address;
|
|
522
|
+
/** The trader who signed. */
|
|
523
|
+
trader: Address;
|
|
524
|
+
/** `1` when the trader sold token 0 for token 1, `0` for the reverse. */
|
|
525
|
+
zeroForOne: number;
|
|
526
|
+
/** Tokens the trader paid. */
|
|
527
|
+
amountIn: bigint;
|
|
528
|
+
/** Tokens the trader received. */
|
|
529
|
+
amountOut: bigint;
|
|
530
|
+
/** Trade fee in the input token, including the protocol share. */
|
|
531
|
+
tradeFee: bigint;
|
|
532
|
+
/** Protocol share of the trade fee, in the input token. */
|
|
533
|
+
protocolFee: bigint;
|
|
534
|
+
/**
|
|
535
|
+
* Creator fee. It is in the input token when `creator_fee_on_input` is
|
|
536
|
+
* set and in the output token otherwise.
|
|
537
|
+
*/
|
|
538
|
+
creatorFee: bigint;
|
|
539
|
+
/**
|
|
540
|
+
* `1` when `creator_fee` is denominated in the input token, `0` when it is
|
|
541
|
+
* in the output token.
|
|
542
|
+
*/
|
|
543
|
+
creatorFeeOnInput: number;
|
|
544
|
+
/** Token 0 reserve after the swap. */
|
|
545
|
+
reserve0: bigint;
|
|
546
|
+
/** Token 1 reserve after the swap. */
|
|
547
|
+
reserve1: bigint;
|
|
548
|
+
};
|
|
549
|
+
type SwappedEventArgs = {
|
|
550
|
+
/** The pool traded against. */
|
|
551
|
+
pool: Address;
|
|
552
|
+
/** The trader who signed. */
|
|
553
|
+
trader: Address;
|
|
554
|
+
/** `1` when the trader sold token 0 for token 1, `0` for the reverse. */
|
|
555
|
+
zeroForOne: number;
|
|
556
|
+
/** Tokens the trader paid. */
|
|
557
|
+
amountIn: number | bigint;
|
|
558
|
+
/** Tokens the trader received. */
|
|
559
|
+
amountOut: number | bigint;
|
|
560
|
+
/** Trade fee in the input token, including the protocol share. */
|
|
561
|
+
tradeFee: number | bigint;
|
|
562
|
+
/** Protocol share of the trade fee, in the input token. */
|
|
563
|
+
protocolFee: number | bigint;
|
|
564
|
+
/**
|
|
565
|
+
* Creator fee. It is in the input token when `creator_fee_on_input` is
|
|
566
|
+
* set and in the output token otherwise.
|
|
567
|
+
*/
|
|
568
|
+
creatorFee: number | bigint;
|
|
569
|
+
/**
|
|
570
|
+
* `1` when `creator_fee` is denominated in the input token, `0` when it is
|
|
571
|
+
* in the output token.
|
|
572
|
+
*/
|
|
573
|
+
creatorFeeOnInput: number;
|
|
574
|
+
/** Token 0 reserve after the swap. */
|
|
575
|
+
reserve0: number | bigint;
|
|
576
|
+
/** Token 1 reserve after the swap. */
|
|
577
|
+
reserve1: number | bigint;
|
|
578
|
+
};
|
|
579
|
+
/** Gets the encoder for {@link SwappedEventArgs} event data. */
|
|
580
|
+
declare function getSwappedEventEncoder(): FixedSizeEncoder<SwappedEventArgs>;
|
|
581
|
+
/** Gets the decoder for {@link SwappedEvent} event data. */
|
|
582
|
+
declare function getSwappedEventDecoder(): FixedSizeDecoder<SwappedEvent>;
|
|
583
|
+
/** Gets the codec for {@link SwappedEvent} event data. */
|
|
584
|
+
declare function getSwappedEventCodec(): FixedSizeCodec<SwappedEventArgs, SwappedEvent>;
|
|
585
|
+
/** Parses the provided bytes into {@link SwappedEvent} event data. */
|
|
586
|
+
declare function parseSwappedEvent(data: ReadonlyUint8Array | Uint8Array): SwappedEvent;
|
|
587
|
+
|
|
588
|
+
/**
|
|
589
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
590
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
591
|
+
* to add features, then rerun Codama to update it.
|
|
592
|
+
*
|
|
593
|
+
* @see https://github.com/codama-idl/codama
|
|
594
|
+
*/
|
|
595
|
+
|
|
596
|
+
declare const LIQUIDITY_CHANGED_EVENT_DISCRIMINATOR = 3;
|
|
597
|
+
declare function getLiquidityChangedEventDiscriminatorBytes(): ReadonlyUint8Array;
|
|
598
|
+
declare const LIQUIDITY_CHANGED_EVENT_DISCRIMINATOR2 = 0;
|
|
599
|
+
declare function getLiquidityChangedEventDiscriminator2Bytes(): ReadonlyUint8Array;
|
|
600
|
+
/** Emitted by `Deposit` and `Withdraw`. */
|
|
601
|
+
type LiquidityChangedEvent = {
|
|
602
|
+
discriminator: number;
|
|
603
|
+
migrationVersion: number;
|
|
604
|
+
/** The pool whose liquidity changed. */
|
|
605
|
+
pool: Address;
|
|
606
|
+
/** The LP owner who signed. */
|
|
607
|
+
owner: Address;
|
|
608
|
+
/** `1` for a deposit and `0` for a withdrawal. */
|
|
609
|
+
isDeposit: number;
|
|
610
|
+
/** LP minted or burned. */
|
|
611
|
+
lpAmount: bigint;
|
|
612
|
+
/** Token 0 added or removed. */
|
|
613
|
+
amount0: bigint;
|
|
614
|
+
/** Token 1 added or removed. */
|
|
615
|
+
amount1: bigint;
|
|
616
|
+
/** Economic LP supply after the change. */
|
|
617
|
+
lpSupply: bigint;
|
|
618
|
+
};
|
|
619
|
+
type LiquidityChangedEventArgs = {
|
|
620
|
+
/** The pool whose liquidity changed. */
|
|
621
|
+
pool: Address;
|
|
622
|
+
/** The LP owner who signed. */
|
|
623
|
+
owner: Address;
|
|
624
|
+
/** `1` for a deposit and `0` for a withdrawal. */
|
|
625
|
+
isDeposit: number;
|
|
626
|
+
/** LP minted or burned. */
|
|
627
|
+
lpAmount: number | bigint;
|
|
628
|
+
/** Token 0 added or removed. */
|
|
629
|
+
amount0: number | bigint;
|
|
630
|
+
/** Token 1 added or removed. */
|
|
631
|
+
amount1: number | bigint;
|
|
632
|
+
/** Economic LP supply after the change. */
|
|
633
|
+
lpSupply: number | bigint;
|
|
634
|
+
};
|
|
635
|
+
/** Gets the encoder for {@link LiquidityChangedEventArgs} event data. */
|
|
636
|
+
declare function getLiquidityChangedEventEncoder(): FixedSizeEncoder<LiquidityChangedEventArgs>;
|
|
637
|
+
/** Gets the decoder for {@link LiquidityChangedEvent} event data. */
|
|
638
|
+
declare function getLiquidityChangedEventDecoder(): FixedSizeDecoder<LiquidityChangedEvent>;
|
|
639
|
+
/** Gets the codec for {@link LiquidityChangedEvent} event data. */
|
|
640
|
+
declare function getLiquidityChangedEventCodec(): FixedSizeCodec<LiquidityChangedEventArgs, LiquidityChangedEvent>;
|
|
641
|
+
/** Parses the provided bytes into {@link LiquidityChangedEvent} event data. */
|
|
642
|
+
declare function parseLiquidityChangedEvent(data: ReadonlyUint8Array | Uint8Array): LiquidityChangedEvent;
|
|
643
|
+
|
|
644
|
+
/**
|
|
645
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
646
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
647
|
+
* to add features, then rerun Codama to update it.
|
|
648
|
+
*
|
|
649
|
+
* @see https://github.com/codama-idl/codama
|
|
650
|
+
*/
|
|
651
|
+
|
|
652
|
+
declare const FEES_COLLECTED_EVENT_DISCRIMINATOR = 4;
|
|
653
|
+
declare function getFeesCollectedEventDiscriminatorBytes(): ReadonlyUint8Array;
|
|
654
|
+
declare const FEES_COLLECTED_EVENT_DISCRIMINATOR2 = 0;
|
|
655
|
+
declare function getFeesCollectedEventDiscriminator2Bytes(): ReadonlyUint8Array;
|
|
656
|
+
/** Emitted by `CollectProtocolFees` and `CollectCreatorFees`. */
|
|
657
|
+
type FeesCollectedEvent = {
|
|
658
|
+
discriminator: number;
|
|
659
|
+
migrationVersion: number;
|
|
660
|
+
/** The pool the fees were accrued in. */
|
|
661
|
+
pool: Address;
|
|
662
|
+
/** The signer who collected them. */
|
|
663
|
+
collector: Address;
|
|
664
|
+
/** `1` for protocol fees and `0` for creator fees. */
|
|
665
|
+
isProtocol: number;
|
|
666
|
+
/** Token 0 paid out. */
|
|
667
|
+
amount0: bigint;
|
|
668
|
+
/** Token 1 paid out. */
|
|
669
|
+
amount1: bigint;
|
|
670
|
+
};
|
|
671
|
+
type FeesCollectedEventArgs = {
|
|
672
|
+
/** The pool the fees were accrued in. */
|
|
673
|
+
pool: Address;
|
|
674
|
+
/** The signer who collected them. */
|
|
675
|
+
collector: Address;
|
|
676
|
+
/** `1` for protocol fees and `0` for creator fees. */
|
|
677
|
+
isProtocol: number;
|
|
678
|
+
/** Token 0 paid out. */
|
|
679
|
+
amount0: number | bigint;
|
|
680
|
+
/** Token 1 paid out. */
|
|
681
|
+
amount1: number | bigint;
|
|
682
|
+
};
|
|
683
|
+
/** Gets the encoder for {@link FeesCollectedEventArgs} event data. */
|
|
684
|
+
declare function getFeesCollectedEventEncoder(): FixedSizeEncoder<FeesCollectedEventArgs>;
|
|
685
|
+
/** Gets the decoder for {@link FeesCollectedEvent} event data. */
|
|
686
|
+
declare function getFeesCollectedEventDecoder(): FixedSizeDecoder<FeesCollectedEvent>;
|
|
687
|
+
/** Gets the codec for {@link FeesCollectedEvent} event data. */
|
|
688
|
+
declare function getFeesCollectedEventCodec(): FixedSizeCodec<FeesCollectedEventArgs, FeesCollectedEvent>;
|
|
689
|
+
/** Parses the provided bytes into {@link FeesCollectedEvent} event data. */
|
|
690
|
+
declare function parseFeesCollectedEvent(data: ReadonlyUint8Array | Uint8Array): FeesCollectedEvent;
|
|
691
|
+
|
|
692
|
+
/**
|
|
693
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
694
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
695
|
+
* to add features, then rerun Codama to update it.
|
|
696
|
+
*
|
|
697
|
+
* @see https://github.com/codama-idl/codama
|
|
698
|
+
*/
|
|
699
|
+
|
|
700
|
+
declare const POOL_SYNCED_EVENT_DISCRIMINATOR = 5;
|
|
701
|
+
declare function getPoolSyncedEventDiscriminatorBytes(): ReadonlyUint8Array;
|
|
702
|
+
declare const POOL_SYNCED_EVENT_DISCRIMINATOR2 = 1;
|
|
703
|
+
declare function getPoolSyncedEventDiscriminator2Bytes(): ReadonlyUint8Array;
|
|
704
|
+
/**
|
|
705
|
+
* Emitted by `SyncPool`. Swaps, deposits, and withdrawals advance the same
|
|
706
|
+
* accumulator and report their effect through `Swapped` and
|
|
707
|
+
* `LiquidityChanged`.
|
|
708
|
+
*/
|
|
709
|
+
type PoolSyncedEvent = {
|
|
710
|
+
discriminator: number;
|
|
711
|
+
migrationVersion: number;
|
|
712
|
+
/** The pool whose accumulator advanced. */
|
|
713
|
+
pool: Address;
|
|
714
|
+
/** Token 0 reserve recorded at the advance; it prices the next interval. */
|
|
715
|
+
reserve0: bigint;
|
|
716
|
+
/** Token 1 reserve recorded at the advance; it prices the next interval. */
|
|
717
|
+
reserve1: bigint;
|
|
718
|
+
/**
|
|
719
|
+
* Low 128 bits of the Q64.64 price-time integral after the advance.
|
|
720
|
+
* Combine with `price_0_cumulative_high_last` as `low + high * 2^128`.
|
|
721
|
+
*/
|
|
722
|
+
price0CumulativeLast: bigint;
|
|
723
|
+
/** High 128 bits of the Q64.64 price-time integral after the advance. */
|
|
724
|
+
price0CumulativeHighLast: bigint;
|
|
725
|
+
/** Unix second of the advance. */
|
|
726
|
+
lastUpdateTimestamp: bigint;
|
|
727
|
+
};
|
|
728
|
+
type PoolSyncedEventArgs = {
|
|
729
|
+
/** The pool whose accumulator advanced. */
|
|
730
|
+
pool: Address;
|
|
731
|
+
/** Token 0 reserve recorded at the advance; it prices the next interval. */
|
|
732
|
+
reserve0: number | bigint;
|
|
733
|
+
/** Token 1 reserve recorded at the advance; it prices the next interval. */
|
|
734
|
+
reserve1: number | bigint;
|
|
735
|
+
/**
|
|
736
|
+
* Low 128 bits of the Q64.64 price-time integral after the advance.
|
|
737
|
+
* Combine with `price_0_cumulative_high_last` as `low + high * 2^128`.
|
|
738
|
+
*/
|
|
739
|
+
price0CumulativeLast: number | bigint;
|
|
740
|
+
/** High 128 bits of the Q64.64 price-time integral after the advance. */
|
|
741
|
+
price0CumulativeHighLast: number | bigint;
|
|
742
|
+
/** Unix second of the advance. */
|
|
743
|
+
lastUpdateTimestamp: number | bigint;
|
|
744
|
+
};
|
|
745
|
+
/** Gets the encoder for {@link PoolSyncedEventArgs} event data. */
|
|
746
|
+
declare function getPoolSyncedEventEncoder(): FixedSizeEncoder<PoolSyncedEventArgs>;
|
|
747
|
+
/** Gets the decoder for {@link PoolSyncedEvent} event data. */
|
|
748
|
+
declare function getPoolSyncedEventDecoder(): FixedSizeDecoder<PoolSyncedEvent>;
|
|
749
|
+
/** Gets the codec for {@link PoolSyncedEvent} event data. */
|
|
750
|
+
declare function getPoolSyncedEventCodec(): FixedSizeCodec<PoolSyncedEventArgs, PoolSyncedEvent>;
|
|
751
|
+
/** Parses the provided bytes into {@link PoolSyncedEvent} event data. */
|
|
752
|
+
declare function parsePoolSyncedEvent(data: ReadonlyUint8Array | Uint8Array): PoolSyncedEvent;
|
|
753
|
+
|
|
754
|
+
/**
|
|
755
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
756
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
757
|
+
* to add features, then rerun Codama to update it.
|
|
758
|
+
*
|
|
759
|
+
* @see https://github.com/codama-idl/codama
|
|
760
|
+
*/
|
|
761
|
+
|
|
762
|
+
declare const POOL_SYNCED_V0_EVENT_DISCRIMINATOR = 5;
|
|
763
|
+
declare function getPoolSyncedV0EventDiscriminatorBytes(): ReadonlyUint8Array;
|
|
764
|
+
declare const POOL_SYNCED_V0_EVENT_DISCRIMINATOR2 = 0;
|
|
765
|
+
declare function getPoolSyncedV0EventDiscriminator2Bytes(): ReadonlyUint8Array;
|
|
766
|
+
/** Version 0 of `PoolSynced`, as emitted before its current layout. Log records carrying this version decode with this event. */
|
|
767
|
+
type PoolSyncedV0Event = {
|
|
768
|
+
discriminator: number;
|
|
769
|
+
migrationVersion: number;
|
|
770
|
+
pool: Address;
|
|
771
|
+
reserve0: bigint;
|
|
772
|
+
reserve1: bigint;
|
|
773
|
+
price0CumulativeLast: bigint;
|
|
774
|
+
lastUpdateTimestamp: bigint;
|
|
775
|
+
};
|
|
776
|
+
type PoolSyncedV0EventArgs = {
|
|
777
|
+
pool: Address;
|
|
778
|
+
reserve0: number | bigint;
|
|
779
|
+
reserve1: number | bigint;
|
|
780
|
+
price0CumulativeLast: number | bigint;
|
|
781
|
+
lastUpdateTimestamp: number | bigint;
|
|
782
|
+
};
|
|
783
|
+
/** Gets the encoder for {@link PoolSyncedV0EventArgs} event data. */
|
|
784
|
+
declare function getPoolSyncedV0EventEncoder(): FixedSizeEncoder<PoolSyncedV0EventArgs>;
|
|
785
|
+
/** Gets the decoder for {@link PoolSyncedV0Event} event data. */
|
|
786
|
+
declare function getPoolSyncedV0EventDecoder(): FixedSizeDecoder<PoolSyncedV0Event>;
|
|
787
|
+
/** Gets the codec for {@link PoolSyncedV0Event} event data. */
|
|
788
|
+
declare function getPoolSyncedV0EventCodec(): FixedSizeCodec<PoolSyncedV0EventArgs, PoolSyncedV0Event>;
|
|
789
|
+
/** Parses the provided bytes into {@link PoolSyncedV0Event} event data. */
|
|
790
|
+
declare function parsePoolSyncedV0Event(data: ReadonlyUint8Array | Uint8Array): PoolSyncedV0Event;
|
|
791
|
+
|
|
792
|
+
/**
|
|
793
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
794
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
795
|
+
* to add features, then rerun Codama to update it.
|
|
796
|
+
*
|
|
797
|
+
* @see https://github.com/codama-idl/codama
|
|
798
|
+
*/
|
|
799
|
+
|
|
800
|
+
declare const CONFIG_CREATED_EVENT_DISCRIMINATOR = 8;
|
|
801
|
+
declare function getConfigCreatedEventDiscriminatorBytes(): ReadonlyUint8Array;
|
|
802
|
+
declare const CONFIG_CREATED_EVENT_DISCRIMINATOR2 = 0;
|
|
803
|
+
declare function getConfigCreatedEventDiscriminator2Bytes(): ReadonlyUint8Array;
|
|
804
|
+
/** Emitted by `CreateConfig`. */
|
|
805
|
+
type ConfigCreatedEvent = {
|
|
806
|
+
discriminator: number;
|
|
807
|
+
migrationVersion: number;
|
|
808
|
+
/** The new tier. */
|
|
809
|
+
ammConfig: Address;
|
|
810
|
+
/** Signer that may update the tier and collect its protocol fees. */
|
|
811
|
+
authority: Address;
|
|
812
|
+
/**
|
|
813
|
+
* The only signer allowed to create pools under the tier, or the
|
|
814
|
+
* default address when pool creation is open to anyone. Fixed for the
|
|
815
|
+
* life of the tier.
|
|
816
|
+
*/
|
|
817
|
+
poolCreatorAuthority: Address;
|
|
818
|
+
/** Trade fee pools snapshot, in parts per million. */
|
|
819
|
+
tradeFeeRate: number;
|
|
820
|
+
/** Protocol share of the trade fee pools snapshot, in parts per million. */
|
|
821
|
+
protocolFeeRate: number;
|
|
822
|
+
/** Creator fee pools snapshot, in parts per million. */
|
|
823
|
+
creatorFeeRate: number;
|
|
824
|
+
/** Tier index used as the PDA seed. */
|
|
825
|
+
index: number;
|
|
826
|
+
};
|
|
827
|
+
type ConfigCreatedEventArgs = {
|
|
828
|
+
/** The new tier. */
|
|
829
|
+
ammConfig: Address;
|
|
830
|
+
/** Signer that may update the tier and collect its protocol fees. */
|
|
831
|
+
authority: Address;
|
|
832
|
+
/**
|
|
833
|
+
* The only signer allowed to create pools under the tier, or the
|
|
834
|
+
* default address when pool creation is open to anyone. Fixed for the
|
|
835
|
+
* life of the tier.
|
|
836
|
+
*/
|
|
837
|
+
poolCreatorAuthority: Address;
|
|
838
|
+
/** Trade fee pools snapshot, in parts per million. */
|
|
839
|
+
tradeFeeRate: number;
|
|
840
|
+
/** Protocol share of the trade fee pools snapshot, in parts per million. */
|
|
841
|
+
protocolFeeRate: number;
|
|
842
|
+
/** Creator fee pools snapshot, in parts per million. */
|
|
843
|
+
creatorFeeRate: number;
|
|
844
|
+
/** Tier index used as the PDA seed. */
|
|
845
|
+
index: number;
|
|
846
|
+
};
|
|
847
|
+
/** Gets the encoder for {@link ConfigCreatedEventArgs} event data. */
|
|
848
|
+
declare function getConfigCreatedEventEncoder(): FixedSizeEncoder<ConfigCreatedEventArgs>;
|
|
849
|
+
/** Gets the decoder for {@link ConfigCreatedEvent} event data. */
|
|
850
|
+
declare function getConfigCreatedEventDecoder(): FixedSizeDecoder<ConfigCreatedEvent>;
|
|
851
|
+
/** Gets the codec for {@link ConfigCreatedEvent} event data. */
|
|
852
|
+
declare function getConfigCreatedEventCodec(): FixedSizeCodec<ConfigCreatedEventArgs, ConfigCreatedEvent>;
|
|
853
|
+
/** Parses the provided bytes into {@link ConfigCreatedEvent} event data. */
|
|
854
|
+
declare function parseConfigCreatedEvent(data: ReadonlyUint8Array | Uint8Array): ConfigCreatedEvent;
|
|
855
|
+
|
|
856
|
+
/**
|
|
857
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
858
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
859
|
+
* to add features, then rerun Codama to update it.
|
|
860
|
+
*
|
|
861
|
+
* @see https://github.com/codama-idl/codama
|
|
862
|
+
*/
|
|
863
|
+
|
|
864
|
+
declare const CONFIG_UPDATED_EVENT_DISCRIMINATOR = 6;
|
|
865
|
+
declare function getConfigUpdatedEventDiscriminatorBytes(): ReadonlyUint8Array;
|
|
866
|
+
declare const CONFIG_UPDATED_EVENT_DISCRIMINATOR2 = 0;
|
|
867
|
+
declare function getConfigUpdatedEventDiscriminator2Bytes(): ReadonlyUint8Array;
|
|
868
|
+
/** Emitted by `UpdateConfig`. */
|
|
869
|
+
type ConfigUpdatedEvent = {
|
|
870
|
+
discriminator: number;
|
|
871
|
+
migrationVersion: number;
|
|
872
|
+
/** The tier that was updated. */
|
|
873
|
+
ammConfig: Address;
|
|
874
|
+
/** The tier's new authority. */
|
|
875
|
+
newAuthority: Address;
|
|
876
|
+
/** Trade fee future pools snapshot, in parts per million. */
|
|
877
|
+
tradeFeeRate: number;
|
|
878
|
+
/** Protocol share future pools snapshot, in parts per million. */
|
|
879
|
+
protocolFeeRate: number;
|
|
880
|
+
/** Creator fee future pools snapshot, in parts per million. */
|
|
881
|
+
creatorFeeRate: number;
|
|
882
|
+
};
|
|
883
|
+
type ConfigUpdatedEventArgs = {
|
|
884
|
+
/** The tier that was updated. */
|
|
885
|
+
ammConfig: Address;
|
|
886
|
+
/** The tier's new authority. */
|
|
887
|
+
newAuthority: Address;
|
|
888
|
+
/** Trade fee future pools snapshot, in parts per million. */
|
|
889
|
+
tradeFeeRate: number;
|
|
890
|
+
/** Protocol share future pools snapshot, in parts per million. */
|
|
891
|
+
protocolFeeRate: number;
|
|
892
|
+
/** Creator fee future pools snapshot, in parts per million. */
|
|
893
|
+
creatorFeeRate: number;
|
|
894
|
+
};
|
|
895
|
+
/** Gets the encoder for {@link ConfigUpdatedEventArgs} event data. */
|
|
896
|
+
declare function getConfigUpdatedEventEncoder(): FixedSizeEncoder<ConfigUpdatedEventArgs>;
|
|
897
|
+
/** Gets the decoder for {@link ConfigUpdatedEvent} event data. */
|
|
898
|
+
declare function getConfigUpdatedEventDecoder(): FixedSizeDecoder<ConfigUpdatedEvent>;
|
|
899
|
+
/** Gets the codec for {@link ConfigUpdatedEvent} event data. */
|
|
900
|
+
declare function getConfigUpdatedEventCodec(): FixedSizeCodec<ConfigUpdatedEventArgs, ConfigUpdatedEvent>;
|
|
901
|
+
/** Parses the provided bytes into {@link ConfigUpdatedEvent} event data. */
|
|
902
|
+
declare function parseConfigUpdatedEvent(data: ReadonlyUint8Array | Uint8Array): ConfigUpdatedEvent;
|
|
903
|
+
|
|
904
|
+
/**
|
|
905
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
906
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
907
|
+
* to add features, then rerun Codama to update it.
|
|
908
|
+
*
|
|
909
|
+
* @see https://github.com/codama-idl/codama
|
|
910
|
+
*/
|
|
911
|
+
|
|
912
|
+
declare const POOL_CREATOR_CHANGED_EVENT_DISCRIMINATOR = 7;
|
|
913
|
+
declare function getPoolCreatorChangedEventDiscriminatorBytes(): ReadonlyUint8Array;
|
|
914
|
+
declare const POOL_CREATOR_CHANGED_EVENT_DISCRIMINATOR2 = 0;
|
|
915
|
+
declare function getPoolCreatorChangedEventDiscriminator2Bytes(): ReadonlyUint8Array;
|
|
916
|
+
/** Emitted by `SetPoolCreator`. */
|
|
917
|
+
type PoolCreatorChangedEvent = {
|
|
918
|
+
discriminator: number;
|
|
919
|
+
migrationVersion: number;
|
|
920
|
+
/** The pool whose creator-fee rights moved. */
|
|
921
|
+
pool: Address;
|
|
922
|
+
/** The previous creator. */
|
|
923
|
+
previousCreator: Address;
|
|
924
|
+
/** The new creator. */
|
|
925
|
+
newCreator: Address;
|
|
926
|
+
};
|
|
927
|
+
type PoolCreatorChangedEventArgs = {
|
|
928
|
+
/** The pool whose creator-fee rights moved. */
|
|
929
|
+
pool: Address;
|
|
930
|
+
/** The previous creator. */
|
|
931
|
+
previousCreator: Address;
|
|
932
|
+
/** The new creator. */
|
|
933
|
+
newCreator: Address;
|
|
934
|
+
};
|
|
935
|
+
/** Gets the encoder for {@link PoolCreatorChangedEventArgs} event data. */
|
|
936
|
+
declare function getPoolCreatorChangedEventEncoder(): FixedSizeEncoder<PoolCreatorChangedEventArgs>;
|
|
937
|
+
/** Gets the decoder for {@link PoolCreatorChangedEvent} event data. */
|
|
938
|
+
declare function getPoolCreatorChangedEventDecoder(): FixedSizeDecoder<PoolCreatorChangedEvent>;
|
|
939
|
+
/** Gets the codec for {@link PoolCreatorChangedEvent} event data. */
|
|
940
|
+
declare function getPoolCreatorChangedEventCodec(): FixedSizeCodec<PoolCreatorChangedEventArgs, PoolCreatorChangedEvent>;
|
|
941
|
+
/** Parses the provided bytes into {@link PoolCreatorChangedEvent} event data. */
|
|
942
|
+
declare function parsePoolCreatorChangedEvent(data: ReadonlyUint8Array | Uint8Array): PoolCreatorChangedEvent;
|
|
943
|
+
|
|
944
|
+
/**
|
|
945
|
+
* This code was AUTOGENERATED using the Codama library and Pina's migration
|
|
946
|
+
* manifest. Please DO NOT EDIT THIS FILE, instead rerun client generation.
|
|
947
|
+
*
|
|
948
|
+
* Event log read path: decode `Program data:` log lines into typed events.
|
|
949
|
+
* A migration-aware event is decoded with the layout of the version that
|
|
950
|
+
* emitted it: each earlier version is its own `<Event>V<n>` event, and a
|
|
951
|
+
* version no event here describes fails instead of being misread.
|
|
952
|
+
*/
|
|
953
|
+
|
|
954
|
+
/**
|
|
955
|
+
* Decode one `poolCreated` record: only records carrying this event's migration version decode.
|
|
956
|
+
*/
|
|
957
|
+
declare function decodePoolCreatedEvent(data: ReadonlyUint8Array | Uint8Array): DecodedPoolCreatedEvent;
|
|
958
|
+
/** One log entry that named this event. */
|
|
959
|
+
type DecodedPoolCreatedEvent = {
|
|
960
|
+
name: "poolCreated";
|
|
961
|
+
data: PoolCreatedEvent;
|
|
962
|
+
};
|
|
963
|
+
/**
|
|
964
|
+
* Decode a `Program data:` log line, or return `null` when the line is not
|
|
965
|
+
* this event.
|
|
966
|
+
*/
|
|
967
|
+
declare function parsePoolCreatedEventFromLog(log: string): DecodedPoolCreatedEvent | null;
|
|
968
|
+
/**
|
|
969
|
+
* Decode one `swapped` record: only records carrying this event's migration version decode.
|
|
970
|
+
*/
|
|
971
|
+
declare function decodeSwappedEvent(data: ReadonlyUint8Array | Uint8Array): DecodedSwappedEvent;
|
|
972
|
+
/** One log entry that named this event. */
|
|
973
|
+
type DecodedSwappedEvent = {
|
|
974
|
+
name: "swapped";
|
|
975
|
+
data: SwappedEvent;
|
|
976
|
+
};
|
|
977
|
+
/**
|
|
978
|
+
* Decode a `Program data:` log line, or return `null` when the line is not
|
|
979
|
+
* this event.
|
|
980
|
+
*/
|
|
981
|
+
declare function parseSwappedEventFromLog(log: string): DecodedSwappedEvent | null;
|
|
982
|
+
/**
|
|
983
|
+
* Decode one `liquidityChanged` record: only records carrying this event's migration version decode.
|
|
984
|
+
*/
|
|
985
|
+
declare function decodeLiquidityChangedEvent(data: ReadonlyUint8Array | Uint8Array): DecodedLiquidityChangedEvent;
|
|
986
|
+
/** One log entry that named this event. */
|
|
987
|
+
type DecodedLiquidityChangedEvent = {
|
|
988
|
+
name: "liquidityChanged";
|
|
989
|
+
data: LiquidityChangedEvent;
|
|
990
|
+
};
|
|
991
|
+
/**
|
|
992
|
+
* Decode a `Program data:` log line, or return `null` when the line is not
|
|
993
|
+
* this event.
|
|
994
|
+
*/
|
|
995
|
+
declare function parseLiquidityChangedEventFromLog(log: string): DecodedLiquidityChangedEvent | null;
|
|
996
|
+
/**
|
|
997
|
+
* Decode one `feesCollected` record: only records carrying this event's migration version decode.
|
|
998
|
+
*/
|
|
999
|
+
declare function decodeFeesCollectedEvent(data: ReadonlyUint8Array | Uint8Array): DecodedFeesCollectedEvent;
|
|
1000
|
+
/** One log entry that named this event. */
|
|
1001
|
+
type DecodedFeesCollectedEvent = {
|
|
1002
|
+
name: "feesCollected";
|
|
1003
|
+
data: FeesCollectedEvent;
|
|
1004
|
+
};
|
|
1005
|
+
/**
|
|
1006
|
+
* Decode a `Program data:` log line, or return `null` when the line is not
|
|
1007
|
+
* this event.
|
|
1008
|
+
*/
|
|
1009
|
+
declare function parseFeesCollectedEventFromLog(log: string): DecodedFeesCollectedEvent | null;
|
|
1010
|
+
/**
|
|
1011
|
+
* Decode one `poolSynced` record: only records carrying this event's migration version decode.
|
|
1012
|
+
*/
|
|
1013
|
+
declare function decodePoolSyncedEvent(data: ReadonlyUint8Array | Uint8Array): DecodedPoolSyncedEvent;
|
|
1014
|
+
/** One log entry that named this event. */
|
|
1015
|
+
type DecodedPoolSyncedEvent = {
|
|
1016
|
+
name: "poolSynced";
|
|
1017
|
+
data: PoolSyncedEvent;
|
|
1018
|
+
};
|
|
1019
|
+
/**
|
|
1020
|
+
* Decode a `Program data:` log line, or return `null` when the line is not
|
|
1021
|
+
* this event.
|
|
1022
|
+
*/
|
|
1023
|
+
declare function parsePoolSyncedEventFromLog(log: string): DecodedPoolSyncedEvent | null;
|
|
1024
|
+
/**
|
|
1025
|
+
* Decode one `poolSyncedV0` record: only records carrying this event's migration version decode.
|
|
1026
|
+
*/
|
|
1027
|
+
declare function decodePoolSyncedV0Event(data: ReadonlyUint8Array | Uint8Array): DecodedPoolSyncedV0Event;
|
|
1028
|
+
/** One log entry that named this event. */
|
|
1029
|
+
type DecodedPoolSyncedV0Event = {
|
|
1030
|
+
name: "poolSyncedV0";
|
|
1031
|
+
data: PoolSyncedV0Event;
|
|
1032
|
+
};
|
|
1033
|
+
/**
|
|
1034
|
+
* Decode a `Program data:` log line, or return `null` when the line is not
|
|
1035
|
+
* this event.
|
|
1036
|
+
*/
|
|
1037
|
+
declare function parsePoolSyncedV0EventFromLog(log: string): DecodedPoolSyncedV0Event | null;
|
|
1038
|
+
/**
|
|
1039
|
+
* Decode one `configCreated` record: only records carrying this event's migration version decode.
|
|
1040
|
+
*/
|
|
1041
|
+
declare function decodeConfigCreatedEvent(data: ReadonlyUint8Array | Uint8Array): DecodedConfigCreatedEvent;
|
|
1042
|
+
/** One log entry that named this event. */
|
|
1043
|
+
type DecodedConfigCreatedEvent = {
|
|
1044
|
+
name: "configCreated";
|
|
1045
|
+
data: ConfigCreatedEvent;
|
|
1046
|
+
};
|
|
1047
|
+
/**
|
|
1048
|
+
* Decode a `Program data:` log line, or return `null` when the line is not
|
|
1049
|
+
* this event.
|
|
1050
|
+
*/
|
|
1051
|
+
declare function parseConfigCreatedEventFromLog(log: string): DecodedConfigCreatedEvent | null;
|
|
1052
|
+
/**
|
|
1053
|
+
* Decode one `configUpdated` record: only records carrying this event's migration version decode.
|
|
1054
|
+
*/
|
|
1055
|
+
declare function decodeConfigUpdatedEvent(data: ReadonlyUint8Array | Uint8Array): DecodedConfigUpdatedEvent;
|
|
1056
|
+
/** One log entry that named this event. */
|
|
1057
|
+
type DecodedConfigUpdatedEvent = {
|
|
1058
|
+
name: "configUpdated";
|
|
1059
|
+
data: ConfigUpdatedEvent;
|
|
1060
|
+
};
|
|
1061
|
+
/**
|
|
1062
|
+
* Decode a `Program data:` log line, or return `null` when the line is not
|
|
1063
|
+
* this event.
|
|
1064
|
+
*/
|
|
1065
|
+
declare function parseConfigUpdatedEventFromLog(log: string): DecodedConfigUpdatedEvent | null;
|
|
1066
|
+
/**
|
|
1067
|
+
* Decode one `poolCreatorChanged` record: only records carrying this event's migration version decode.
|
|
1068
|
+
*/
|
|
1069
|
+
declare function decodePoolCreatorChangedEvent(data: ReadonlyUint8Array | Uint8Array): DecodedPoolCreatorChangedEvent;
|
|
1070
|
+
/** One log entry that named this event. */
|
|
1071
|
+
type DecodedPoolCreatorChangedEvent = {
|
|
1072
|
+
name: "poolCreatorChanged";
|
|
1073
|
+
data: PoolCreatorChangedEvent;
|
|
1074
|
+
};
|
|
1075
|
+
/**
|
|
1076
|
+
* Decode a `Program data:` log line, or return `null` when the line is not
|
|
1077
|
+
* this event.
|
|
1078
|
+
*/
|
|
1079
|
+
declare function parsePoolCreatorChangedEventFromLog(log: string): DecodedPoolCreatorChangedEvent | null;
|
|
1080
|
+
/** Every event this program can emit, as decoded from a log line. */
|
|
1081
|
+
type DecodedPinaAmmEvent = DecodedPoolCreatedEvent | DecodedSwappedEvent | DecodedLiquidityChangedEvent | DecodedFeesCollectedEvent | DecodedPoolSyncedEvent | DecodedPoolSyncedV0Event | DecodedConfigCreatedEvent | DecodedConfigUpdatedEvent | DecodedPoolCreatorChangedEvent;
|
|
1082
|
+
/** The program whose invocation frames emit the events decoded here. */
|
|
1083
|
+
declare const PINA_AMM_EVENT_SOURCE_ADDRESS = "pAMMzVPRwtrxQs2CjLTUUpfCAp9XdvVmwwVhpAuCobi";
|
|
1084
|
+
/**
|
|
1085
|
+
* Decode every `Program data:` line this program emitted in a transaction's
|
|
1086
|
+
* logs.
|
|
1087
|
+
*
|
|
1088
|
+
* `logs` must be the complete, ordered log messages of one transaction. The
|
|
1089
|
+
* parser follows the runtime's `Program <address> invoke [n]` and
|
|
1090
|
+
* `Program <address> success` / `failed` frames and decodes a data line only
|
|
1091
|
+
* while `programAddress` is the innermost invoked program. Any program can
|
|
1092
|
+
* write a `Program data:` line with this program's discriminator, so data
|
|
1093
|
+
* lines from other programs (including ones this program invokes through CPI)
|
|
1094
|
+
* and lines outside any frame are skipped rather than trusted.
|
|
1095
|
+
*
|
|
1096
|
+
* Unrelated lines are skipped. A line this program emitted that names an event
|
|
1097
|
+
* but carries a version no generated event describes throws instead of being
|
|
1098
|
+
* silently dropped. The per-event `parse*FromLog` helpers decode one line
|
|
1099
|
+
* without this attribution and are only safe for data already known to come
|
|
1100
|
+
* from this program.
|
|
1101
|
+
*/
|
|
1102
|
+
declare function parsePinaAmmEventsFromLogs(logs: readonly string[], programAddress?: string): DecodedPinaAmmEvent[];
|
|
1103
|
+
|
|
1104
|
+
/**
|
|
1105
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
1106
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
1107
|
+
* to add features, then rerun Codama to update it.
|
|
1108
|
+
*
|
|
1109
|
+
* @see https://github.com/codama-idl/codama
|
|
1110
|
+
*/
|
|
1111
|
+
|
|
1112
|
+
declare const PINA_AMM_PROGRAM_ADDRESS: Address<"pAMMzVPRwtrxQs2CjLTUUpfCAp9XdvVmwwVhpAuCobi">;
|
|
1113
|
+
declare enum PinaAmmAccount {
|
|
1114
|
+
AmmConfig = 0,
|
|
1115
|
+
Pool = 1
|
|
1116
|
+
}
|
|
1117
|
+
declare function identifyPinaAmmAccount(account: {
|
|
1118
|
+
data: ReadonlyUint8Array;
|
|
1119
|
+
} | ReadonlyUint8Array): PinaAmmAccount;
|
|
1120
|
+
declare enum PinaAmmEvent {
|
|
1121
|
+
PoolCreated = 0,
|
|
1122
|
+
Swapped = 1,
|
|
1123
|
+
LiquidityChanged = 2,
|
|
1124
|
+
FeesCollected = 3,
|
|
1125
|
+
PoolSynced = 4,
|
|
1126
|
+
PoolSyncedV0 = 5,
|
|
1127
|
+
ConfigCreated = 6,
|
|
1128
|
+
ConfigUpdated = 7,
|
|
1129
|
+
PoolCreatorChanged = 8
|
|
1130
|
+
}
|
|
1131
|
+
declare function identifyPinaAmmEvent(event: {
|
|
1132
|
+
data: ReadonlyUint8Array;
|
|
1133
|
+
} | ReadonlyUint8Array): PinaAmmEvent;
|
|
1134
|
+
declare enum PinaAmmInstruction {
|
|
1135
|
+
CreateConfig = 0,
|
|
1136
|
+
UpdateConfig = 1,
|
|
1137
|
+
CreatePool = 2,
|
|
1138
|
+
Deposit = 3,
|
|
1139
|
+
Withdraw = 4,
|
|
1140
|
+
SwapExactIn = 5,
|
|
1141
|
+
SwapExactOut = 6,
|
|
1142
|
+
CollectProtocolFees = 7,
|
|
1143
|
+
CollectCreatorFees = 8,
|
|
1144
|
+
SetPoolCreator = 9,
|
|
1145
|
+
SyncPool = 10
|
|
1146
|
+
}
|
|
1147
|
+
declare function identifyPinaAmmInstruction(instruction: {
|
|
1148
|
+
data: ReadonlyUint8Array;
|
|
1149
|
+
} | ReadonlyUint8Array): PinaAmmInstruction;
|
|
1150
|
+
type ParsedPinaAmmInstruction<TProgram extends string = 'pAMMzVPRwtrxQs2CjLTUUpfCAp9XdvVmwwVhpAuCobi'> = {
|
|
1151
|
+
instructionType: PinaAmmInstruction.CreateConfig;
|
|
1152
|
+
} & ParsedCreateConfigInstruction<TProgram> | {
|
|
1153
|
+
instructionType: PinaAmmInstruction.UpdateConfig;
|
|
1154
|
+
} & ParsedUpdateConfigInstruction<TProgram> | {
|
|
1155
|
+
instructionType: PinaAmmInstruction.CreatePool;
|
|
1156
|
+
} & ParsedCreatePoolInstruction<TProgram> | {
|
|
1157
|
+
instructionType: PinaAmmInstruction.Deposit;
|
|
1158
|
+
} & ParsedDepositInstruction<TProgram> | {
|
|
1159
|
+
instructionType: PinaAmmInstruction.Withdraw;
|
|
1160
|
+
} & ParsedWithdrawInstruction<TProgram> | {
|
|
1161
|
+
instructionType: PinaAmmInstruction.SwapExactIn;
|
|
1162
|
+
} & ParsedSwapExactInInstruction<TProgram> | {
|
|
1163
|
+
instructionType: PinaAmmInstruction.SwapExactOut;
|
|
1164
|
+
} & ParsedSwapExactOutInstruction<TProgram> | {
|
|
1165
|
+
instructionType: PinaAmmInstruction.CollectProtocolFees;
|
|
1166
|
+
} & ParsedCollectProtocolFeesInstruction<TProgram> | {
|
|
1167
|
+
instructionType: PinaAmmInstruction.CollectCreatorFees;
|
|
1168
|
+
} & ParsedCollectCreatorFeesInstruction<TProgram> | {
|
|
1169
|
+
instructionType: PinaAmmInstruction.SetPoolCreator;
|
|
1170
|
+
} & ParsedSetPoolCreatorInstruction<TProgram> | {
|
|
1171
|
+
instructionType: PinaAmmInstruction.SyncPool;
|
|
1172
|
+
} & ParsedSyncPoolInstruction<TProgram>;
|
|
1173
|
+
declare function parsePinaAmmInstruction<TProgram extends string>(instruction: Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array>): ParsedPinaAmmInstruction<TProgram>;
|
|
1174
|
+
type PinaAmmPlugin = {
|
|
1175
|
+
accounts: PinaAmmPluginAccounts;
|
|
1176
|
+
instructions: PinaAmmPluginInstructions;
|
|
1177
|
+
pdas: PinaAmmPluginPdas;
|
|
1178
|
+
identifyAccount: typeof identifyPinaAmmAccount;
|
|
1179
|
+
identifyInstruction: typeof identifyPinaAmmInstruction;
|
|
1180
|
+
parseInstruction: typeof parsePinaAmmInstruction;
|
|
1181
|
+
};
|
|
1182
|
+
type PinaAmmPluginAccounts = {
|
|
1183
|
+
ammConfig: ReturnType<typeof getAmmConfigCodec> & SelfFetchFunctions<AmmConfigArgs, AmmConfig>;
|
|
1184
|
+
pool: ReturnType<typeof getPoolCodec> & SelfFetchFunctions<PoolArgs, Pool>;
|
|
1185
|
+
};
|
|
1186
|
+
type PinaAmmPluginInstructions = {
|
|
1187
|
+
createConfig: (input: CreateConfigInput) => ReturnType<typeof getCreateConfigInstruction> & SelfPlanAndSendFunctions;
|
|
1188
|
+
updateConfig: (input: UpdateConfigInput) => ReturnType<typeof getUpdateConfigInstruction> & SelfPlanAndSendFunctions;
|
|
1189
|
+
createPool: (input: CreatePoolAsyncInput) => ReturnType<typeof getCreatePoolInstructionAsync> & SelfPlanAndSendFunctions;
|
|
1190
|
+
deposit: (input: DepositInput) => ReturnType<typeof getDepositInstruction> & SelfPlanAndSendFunctions;
|
|
1191
|
+
withdraw: (input: WithdrawInput) => ReturnType<typeof getWithdrawInstruction> & SelfPlanAndSendFunctions;
|
|
1192
|
+
swapExactIn: (input: SwapExactInInput) => ReturnType<typeof getSwapExactInInstruction> & SelfPlanAndSendFunctions;
|
|
1193
|
+
swapExactOut: (input: SwapExactOutInput) => ReturnType<typeof getSwapExactOutInstruction> & SelfPlanAndSendFunctions;
|
|
1194
|
+
collectProtocolFees: (input: CollectProtocolFeesInput) => ReturnType<typeof getCollectProtocolFeesInstruction> & SelfPlanAndSendFunctions;
|
|
1195
|
+
collectCreatorFees: (input: CollectCreatorFeesInput) => ReturnType<typeof getCollectCreatorFeesInstruction> & SelfPlanAndSendFunctions;
|
|
1196
|
+
setPoolCreator: (input: SetPoolCreatorInput) => ReturnType<typeof getSetPoolCreatorInstruction> & SelfPlanAndSendFunctions;
|
|
1197
|
+
syncPool: (input: SyncPoolInput) => ReturnType<typeof getSyncPoolInstruction> & SelfPlanAndSendFunctions;
|
|
1198
|
+
};
|
|
1199
|
+
type PinaAmmPluginPdas = {
|
|
1200
|
+
ammConfig: typeof findAmmConfigPda;
|
|
1201
|
+
pool: typeof findPoolPda;
|
|
1202
|
+
poolVault: typeof findPoolVaultPda;
|
|
1203
|
+
poolLpMint: typeof findPoolLpMintPda;
|
|
1204
|
+
};
|
|
1205
|
+
type PinaAmmPluginRequirements = ClientWithRpc<GetAccountInfoApi & GetMultipleAccountsApi> & ClientWithTransactionPlanning & ClientWithTransactionSending;
|
|
1206
|
+
declare function pinaAmmProgram(): <T extends PinaAmmPluginRequirements>(client: T) => ExtendedClient<T, {
|
|
1207
|
+
pinaAmm: PinaAmmPlugin;
|
|
1208
|
+
}>;
|
|
1209
|
+
|
|
1210
|
+
/**
|
|
1211
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
1212
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
1213
|
+
* to add features, then rerun Codama to update it.
|
|
1214
|
+
*
|
|
1215
|
+
* @see https://github.com/codama-idl/codama
|
|
1216
|
+
*
|
|
1217
|
+
* The framework-owned `Migrate` instruction: it runs the program's on-demand
|
|
1218
|
+
* account migrations on their own, so the payer authorizes exactly the
|
|
1219
|
+
* migration cost and the business instruction that follows sees current
|
|
1220
|
+
* data. The intended flow around any instruction that failed with a
|
|
1221
|
+
* migration version mismatch is catch -> migrate -> retry.
|
|
1222
|
+
*/
|
|
1223
|
+
|
|
1224
|
+
/** Discriminator reserved by Pina for the framework `Migrate` instruction. */
|
|
1225
|
+
declare const MIGRATE_DISCRIMINATOR = 255;
|
|
1226
|
+
declare function getMigrateDiscriminatorBytes(): ReadonlyUint8Array;
|
|
1227
|
+
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<[
|
|
1228
|
+
TAccountPayer extends string ? WritableSignerAccount<TAccountPayer> & AccountSignerMeta<TAccountPayer> : TAccountPayer,
|
|
1229
|
+
TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
|
|
1230
|
+
TAccountAmmConfig extends string ? WritableAccount<TAccountAmmConfig> : TAccountAmmConfig,
|
|
1231
|
+
TAccountPool extends string ? WritableAccount<TAccountPool> : TAccountPool,
|
|
1232
|
+
...TRemainingAccounts
|
|
1233
|
+
]>;
|
|
1234
|
+
type MigrateInput<TAccountPayer extends string = string, TAccountSystemProgram extends string = string, TAccountAmmConfig extends string = string, TAccountPool extends string = string> = {
|
|
1235
|
+
payer?: TransactionSigner<TAccountPayer>;
|
|
1236
|
+
systemProgram?: Address<TAccountSystemProgram>;
|
|
1237
|
+
ammConfig?: Address<TAccountAmmConfig>;
|
|
1238
|
+
pool?: Address<TAccountPool>;
|
|
1239
|
+
};
|
|
1240
|
+
/**
|
|
1241
|
+
* Composes the reserved `Migrate` instruction.
|
|
1242
|
+
*
|
|
1243
|
+
* Every migratable account is optional: omitted slots are filled with the
|
|
1244
|
+
* program-address placeholder and trailing omitted slots are dropped, so a
|
|
1245
|
+
* client sends only the accounts it needs to migrate. The `payer` funds rent
|
|
1246
|
+
* deficits and must be a writable signer; omit it when no migration needs
|
|
1247
|
+
* funding. `systemProgram` defaults to the system program, the only account
|
|
1248
|
+
* the program accepts in that slot. The program caps the whole
|
|
1249
|
+
* instruction's rent transfers at a program-chosen lamport budget.
|
|
1250
|
+
*/
|
|
1251
|
+
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?: {
|
|
1252
|
+
programAddress?: TProgramAddress;
|
|
1253
|
+
}): MigrateInstruction<TProgramAddress, TAccountPayer, TAccountSystemProgram, TAccountAmmConfig, TAccountPool>;
|
|
1254
|
+
|
|
1255
|
+
/**
|
|
1256
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
1257
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
1258
|
+
* to add features, then rerun Codama to update it.
|
|
1259
|
+
*
|
|
1260
|
+
* @see https://github.com/codama-idl/codama
|
|
1261
|
+
*/
|
|
1262
|
+
|
|
1263
|
+
declare const COLLECT_CREATOR_FEES_DISCRIMINATOR = 8;
|
|
1264
|
+
declare function getCollectCreatorFeesDiscriminatorBytes(): ReadonlyUint8Array;
|
|
1265
|
+
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]>;
|
|
1266
|
+
type CollectCreatorFeesInstructionData = {
|
|
1267
|
+
discriminator: number;
|
|
1268
|
+
/** Most token 0 to collect; `u64::MAX` collects everything accrued. */
|
|
1269
|
+
maximumAmount0: bigint;
|
|
1270
|
+
/** Most token 1 to collect; `u64::MAX` collects everything accrued. */
|
|
1271
|
+
maximumAmount1: bigint;
|
|
1272
|
+
};
|
|
1273
|
+
type CollectCreatorFeesInstructionDataArgs = {
|
|
1274
|
+
/** Most token 0 to collect; `u64::MAX` collects everything accrued. */
|
|
1275
|
+
maximumAmount0: number | bigint;
|
|
1276
|
+
/** Most token 1 to collect; `u64::MAX` collects everything accrued. */
|
|
1277
|
+
maximumAmount1: number | bigint;
|
|
1278
|
+
};
|
|
1279
|
+
declare function getCollectCreatorFeesInstructionDataEncoder(): FixedSizeEncoder<CollectCreatorFeesInstructionDataArgs>;
|
|
1280
|
+
declare function getCollectCreatorFeesInstructionDataDecoder(): FixedSizeDecoder<CollectCreatorFeesInstructionData>;
|
|
1281
|
+
declare function getCollectCreatorFeesInstructionDataCodec(): FixedSizeCodec<CollectCreatorFeesInstructionDataArgs, CollectCreatorFeesInstructionData>;
|
|
1282
|
+
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> = {
|
|
1283
|
+
/** The pool's creator. */
|
|
1284
|
+
creator: TAccountCreator;
|
|
1285
|
+
/** The pool. */
|
|
1286
|
+
pool: TAccountPool;
|
|
1287
|
+
/** The pool's token 0 vault. */
|
|
1288
|
+
vault0: TAccountVault0;
|
|
1289
|
+
/** The pool's token 1 vault. */
|
|
1290
|
+
vault1: TAccountVault1;
|
|
1291
|
+
/** Token 0 account that receives the fees. */
|
|
1292
|
+
recipientToken0: TAccountRecipientToken0;
|
|
1293
|
+
/** Token 1 account that receives the fees. */
|
|
1294
|
+
recipientToken1: TAccountRecipientToken1;
|
|
1295
|
+
/** Token program that owns token 0. */
|
|
1296
|
+
tokenProgram0: TAccountTokenProgram0;
|
|
1297
|
+
/** Token program that owns token 1. */
|
|
1298
|
+
tokenProgram1: TAccountTokenProgram1;
|
|
1299
|
+
maximumAmount0: CollectCreatorFeesInstructionDataArgs["maximumAmount0"];
|
|
1300
|
+
maximumAmount1: CollectCreatorFeesInstructionDataArgs["maximumAmount1"];
|
|
1301
|
+
};
|
|
1302
|
+
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?: {
|
|
1303
|
+
programAddress?: TProgramAddress;
|
|
1304
|
+
}): 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>>>;
|
|
1305
|
+
type ParsedCollectCreatorFeesInstruction<TProgram extends string = typeof PINA_AMM_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
|
|
1306
|
+
programAddress: Address<TProgram>;
|
|
1307
|
+
accounts: {
|
|
1308
|
+
/** The pool's creator. */
|
|
1309
|
+
creator: TAccountMetas[0];
|
|
1310
|
+
/** The pool. */
|
|
1311
|
+
pool: TAccountMetas[1];
|
|
1312
|
+
/** The pool's token 0 vault. */
|
|
1313
|
+
vault0: TAccountMetas[2];
|
|
1314
|
+
/** The pool's token 1 vault. */
|
|
1315
|
+
vault1: TAccountMetas[3];
|
|
1316
|
+
/** Token 0 account that receives the fees. */
|
|
1317
|
+
recipientToken0: TAccountMetas[4];
|
|
1318
|
+
/** Token 1 account that receives the fees. */
|
|
1319
|
+
recipientToken1: TAccountMetas[5];
|
|
1320
|
+
/** Token program that owns token 0. */
|
|
1321
|
+
tokenProgram0: TAccountMetas[6];
|
|
1322
|
+
/** Token program that owns token 1. */
|
|
1323
|
+
tokenProgram1: TAccountMetas[7];
|
|
1324
|
+
};
|
|
1325
|
+
data: CollectCreatorFeesInstructionData;
|
|
1326
|
+
};
|
|
1327
|
+
declare function parseCollectCreatorFeesInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedCollectCreatorFeesInstruction<TProgram, TAccountMetas>;
|
|
1328
|
+
|
|
1329
|
+
/**
|
|
1330
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
1331
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
1332
|
+
* to add features, then rerun Codama to update it.
|
|
1333
|
+
*
|
|
1334
|
+
* @see https://github.com/codama-idl/codama
|
|
1335
|
+
*/
|
|
1336
|
+
|
|
1337
|
+
declare const COLLECT_PROTOCOL_FEES_DISCRIMINATOR = 7;
|
|
1338
|
+
declare function getCollectProtocolFeesDiscriminatorBytes(): ReadonlyUint8Array;
|
|
1339
|
+
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]>;
|
|
1340
|
+
type CollectProtocolFeesInstructionData = {
|
|
1341
|
+
discriminator: number;
|
|
1342
|
+
/** Most token 0 to collect; `u64::MAX` collects everything accrued. */
|
|
1343
|
+
maximumAmount0: bigint;
|
|
1344
|
+
/** Most token 1 to collect; `u64::MAX` collects everything accrued. */
|
|
1345
|
+
maximumAmount1: bigint;
|
|
1346
|
+
};
|
|
1347
|
+
type CollectProtocolFeesInstructionDataArgs = {
|
|
1348
|
+
/** Most token 0 to collect; `u64::MAX` collects everything accrued. */
|
|
1349
|
+
maximumAmount0: number | bigint;
|
|
1350
|
+
/** Most token 1 to collect; `u64::MAX` collects everything accrued. */
|
|
1351
|
+
maximumAmount1: number | bigint;
|
|
1352
|
+
};
|
|
1353
|
+
declare function getCollectProtocolFeesInstructionDataEncoder(): FixedSizeEncoder<CollectProtocolFeesInstructionDataArgs>;
|
|
1354
|
+
declare function getCollectProtocolFeesInstructionDataDecoder(): FixedSizeDecoder<CollectProtocolFeesInstructionData>;
|
|
1355
|
+
declare function getCollectProtocolFeesInstructionDataCodec(): FixedSizeCodec<CollectProtocolFeesInstructionDataArgs, CollectProtocolFeesInstructionData>;
|
|
1356
|
+
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> = {
|
|
1357
|
+
/** The pool's fee-tier authority. */
|
|
1358
|
+
authority: TAccountAuthority;
|
|
1359
|
+
/** The pool's fee tier. */
|
|
1360
|
+
ammConfig: TAccountAmmConfig;
|
|
1361
|
+
/** The pool. */
|
|
1362
|
+
pool: TAccountPool;
|
|
1363
|
+
/** The pool's token 0 vault. */
|
|
1364
|
+
vault0: TAccountVault0;
|
|
1365
|
+
/** The pool's token 1 vault. */
|
|
1366
|
+
vault1: TAccountVault1;
|
|
1367
|
+
/** Token 0 account that receives the fees. */
|
|
1368
|
+
recipientToken0: TAccountRecipientToken0;
|
|
1369
|
+
/** Token 1 account that receives the fees. */
|
|
1370
|
+
recipientToken1: TAccountRecipientToken1;
|
|
1371
|
+
/** Token program that owns token 0. */
|
|
1372
|
+
tokenProgram0: TAccountTokenProgram0;
|
|
1373
|
+
/** Token program that owns token 1. */
|
|
1374
|
+
tokenProgram1: TAccountTokenProgram1;
|
|
1375
|
+
maximumAmount0: CollectProtocolFeesInstructionDataArgs["maximumAmount0"];
|
|
1376
|
+
maximumAmount1: CollectProtocolFeesInstructionDataArgs["maximumAmount1"];
|
|
1377
|
+
};
|
|
1378
|
+
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?: {
|
|
1379
|
+
programAddress?: TProgramAddress;
|
|
1380
|
+
}): 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>>>;
|
|
1381
|
+
type ParsedCollectProtocolFeesInstruction<TProgram extends string = typeof PINA_AMM_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
|
|
1382
|
+
programAddress: Address<TProgram>;
|
|
1383
|
+
accounts: {
|
|
1384
|
+
/** The pool's fee-tier authority. */
|
|
1385
|
+
authority: TAccountMetas[0];
|
|
1386
|
+
/** The pool's fee tier. */
|
|
1387
|
+
ammConfig: TAccountMetas[1];
|
|
1388
|
+
/** The pool. */
|
|
1389
|
+
pool: TAccountMetas[2];
|
|
1390
|
+
/** The pool's token 0 vault. */
|
|
1391
|
+
vault0: TAccountMetas[3];
|
|
1392
|
+
/** The pool's token 1 vault. */
|
|
1393
|
+
vault1: TAccountMetas[4];
|
|
1394
|
+
/** Token 0 account that receives the fees. */
|
|
1395
|
+
recipientToken0: TAccountMetas[5];
|
|
1396
|
+
/** Token 1 account that receives the fees. */
|
|
1397
|
+
recipientToken1: TAccountMetas[6];
|
|
1398
|
+
/** Token program that owns token 0. */
|
|
1399
|
+
tokenProgram0: TAccountMetas[7];
|
|
1400
|
+
/** Token program that owns token 1. */
|
|
1401
|
+
tokenProgram1: TAccountMetas[8];
|
|
1402
|
+
};
|
|
1403
|
+
data: CollectProtocolFeesInstructionData;
|
|
1404
|
+
};
|
|
1405
|
+
declare function parseCollectProtocolFeesInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedCollectProtocolFeesInstruction<TProgram, TAccountMetas>;
|
|
1406
|
+
|
|
1407
|
+
/**
|
|
1408
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
1409
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
1410
|
+
* to add features, then rerun Codama to update it.
|
|
1411
|
+
*
|
|
1412
|
+
* @see https://github.com/codama-idl/codama
|
|
1413
|
+
*/
|
|
1414
|
+
|
|
1415
|
+
declare const CREATE_CONFIG_DISCRIMINATOR = 0;
|
|
1416
|
+
declare function getCreateConfigDiscriminatorBytes(): ReadonlyUint8Array;
|
|
1417
|
+
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]>;
|
|
1418
|
+
type CreateConfigInstructionData = {
|
|
1419
|
+
discriminator: number;
|
|
1420
|
+
/** Tier index; also the PDA seed. */
|
|
1421
|
+
index: number;
|
|
1422
|
+
/** Swap fee in parts per million. */
|
|
1423
|
+
tradeFeeRate: number;
|
|
1424
|
+
/** Protocol share of the trade fee in parts per million. */
|
|
1425
|
+
protocolFeeRate: number;
|
|
1426
|
+
/** Creator fee in parts per million. */
|
|
1427
|
+
creatorFeeRate: number;
|
|
1428
|
+
/** Signer that may update the tier and collect its protocol fees. */
|
|
1429
|
+
authority: Address;
|
|
1430
|
+
/**
|
|
1431
|
+
* The only signer allowed to create pools in this tier, or the default
|
|
1432
|
+
* address to let anyone create pools.
|
|
1433
|
+
*/
|
|
1434
|
+
poolCreatorAuthority: Address;
|
|
1435
|
+
};
|
|
1436
|
+
type CreateConfigInstructionDataArgs = {
|
|
1437
|
+
/** Tier index; also the PDA seed. */
|
|
1438
|
+
index: number;
|
|
1439
|
+
/** Swap fee in parts per million. */
|
|
1440
|
+
tradeFeeRate: number;
|
|
1441
|
+
/** Protocol share of the trade fee in parts per million. */
|
|
1442
|
+
protocolFeeRate: number;
|
|
1443
|
+
/** Creator fee in parts per million. */
|
|
1444
|
+
creatorFeeRate: number;
|
|
1445
|
+
/** Signer that may update the tier and collect its protocol fees. */
|
|
1446
|
+
authority: Address;
|
|
1447
|
+
/**
|
|
1448
|
+
* The only signer allowed to create pools in this tier, or the default
|
|
1449
|
+
* address to let anyone create pools.
|
|
1450
|
+
*/
|
|
1451
|
+
poolCreatorAuthority: Address;
|
|
1452
|
+
};
|
|
1453
|
+
declare function getCreateConfigInstructionDataEncoder(): FixedSizeEncoder<CreateConfigInstructionDataArgs>;
|
|
1454
|
+
declare function getCreateConfigInstructionDataDecoder(): FixedSizeDecoder<CreateConfigInstructionData>;
|
|
1455
|
+
declare function getCreateConfigInstructionDataCodec(): FixedSizeCodec<CreateConfigInstructionDataArgs, CreateConfigInstructionData>;
|
|
1456
|
+
type CreateConfigInput<TAccountPayer extends InstructionSignerInput = InstructionSignerInput, TAccountUpgradeAuthority extends InstructionSignerInput = InstructionSignerInput, TAccountProgramData extends InstructionAccountInput = InstructionAccountInput, TAccountAmmConfig extends InstructionAccountInput = InstructionAccountInput, TAccountSystemProgram extends InstructionAccountInput = InstructionAccountInput> = {
|
|
1457
|
+
/** Pays the new tier's rent. */
|
|
1458
|
+
payer: TAccountPayer;
|
|
1459
|
+
/** The program's upgrade authority. */
|
|
1460
|
+
upgradeAuthority: TAccountUpgradeAuthority;
|
|
1461
|
+
/**
|
|
1462
|
+
* The program's program-data account, which records its upgrade
|
|
1463
|
+
* authority.
|
|
1464
|
+
*/
|
|
1465
|
+
programData: TAccountProgramData;
|
|
1466
|
+
/** The tier PDA to create: `[b"amm_config", index]`. */
|
|
1467
|
+
ammConfig: TAccountAmmConfig;
|
|
1468
|
+
/** The system program. */
|
|
1469
|
+
systemProgram?: TAccountSystemProgram;
|
|
1470
|
+
index: CreateConfigInstructionDataArgs["index"];
|
|
1471
|
+
tradeFeeRate: CreateConfigInstructionDataArgs["tradeFeeRate"];
|
|
1472
|
+
protocolFeeRate: CreateConfigInstructionDataArgs["protocolFeeRate"];
|
|
1473
|
+
creatorFeeRate: CreateConfigInstructionDataArgs["creatorFeeRate"];
|
|
1474
|
+
authority: CreateConfigInstructionDataArgs["authority"];
|
|
1475
|
+
poolCreatorAuthority: CreateConfigInstructionDataArgs["poolCreatorAuthority"];
|
|
1476
|
+
};
|
|
1477
|
+
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?: {
|
|
1478
|
+
programAddress?: TProgramAddress;
|
|
1479
|
+
}): CreateConfigInstruction<TProgramAddress, ResolvedInstructionAccountMeta<TAccountPayer, InstructionAccountInputAddress<TAccountPayer>>, ResolvedInstructionAccountMeta<TAccountUpgradeAuthority, InstructionAccountInputAddress<TAccountUpgradeAuthority>>, ResolvedInstructionAccountMeta<TAccountProgramData, InstructionAccountInputAddress<TAccountProgramData>>, ResolvedInstructionAccountMeta<TAccountAmmConfig, InstructionAccountInputAddress<TAccountAmmConfig>>, ResolvedInstructionAccountMeta<TAccountSystemProgram, InstructionAccountInputAddress<TAccountSystemProgram>>>;
|
|
1480
|
+
type ParsedCreateConfigInstruction<TProgram extends string = typeof PINA_AMM_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
|
|
1481
|
+
programAddress: Address<TProgram>;
|
|
1482
|
+
accounts: {
|
|
1483
|
+
/** Pays the new tier's rent. */
|
|
1484
|
+
payer: TAccountMetas[0];
|
|
1485
|
+
/** The program's upgrade authority. */
|
|
1486
|
+
upgradeAuthority: TAccountMetas[1];
|
|
1487
|
+
/**
|
|
1488
|
+
* The program's program-data account, which records its upgrade
|
|
1489
|
+
* authority.
|
|
1490
|
+
*/
|
|
1491
|
+
programData: TAccountMetas[2];
|
|
1492
|
+
/** The tier PDA to create: `[b"amm_config", index]`. */
|
|
1493
|
+
ammConfig: TAccountMetas[3];
|
|
1494
|
+
/** The system program. */
|
|
1495
|
+
systemProgram: TAccountMetas[4];
|
|
1496
|
+
};
|
|
1497
|
+
data: CreateConfigInstructionData;
|
|
1498
|
+
};
|
|
1499
|
+
declare function parseCreateConfigInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedCreateConfigInstruction<TProgram, TAccountMetas>;
|
|
1500
|
+
|
|
1501
|
+
/**
|
|
1502
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
1503
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
1504
|
+
* to add features, then rerun Codama to update it.
|
|
1505
|
+
*
|
|
1506
|
+
* @see https://github.com/codama-idl/codama
|
|
1507
|
+
*/
|
|
1508
|
+
|
|
1509
|
+
declare const CREATE_POOL_DISCRIMINATOR = 2;
|
|
1510
|
+
declare function getCreatePoolDiscriminatorBytes(): ReadonlyUint8Array;
|
|
1511
|
+
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]>;
|
|
1512
|
+
type CreatePoolInstructionData = {
|
|
1513
|
+
discriminator: number;
|
|
1514
|
+
/** Initial deposit of token 0. */
|
|
1515
|
+
amount0: bigint;
|
|
1516
|
+
/** Initial deposit of token 1. */
|
|
1517
|
+
amount1: bigint;
|
|
1518
|
+
/** Recipient of the pool's creator fees. */
|
|
1519
|
+
creator: Address;
|
|
1520
|
+
/** `CreatorFeeMode` wire value. */
|
|
1521
|
+
creatorFeeMode: number;
|
|
1522
|
+
};
|
|
1523
|
+
type CreatePoolInstructionDataArgs = {
|
|
1524
|
+
/** Initial deposit of token 0. */
|
|
1525
|
+
amount0: number | bigint;
|
|
1526
|
+
/** Initial deposit of token 1. */
|
|
1527
|
+
amount1: number | bigint;
|
|
1528
|
+
/** Recipient of the pool's creator fees. */
|
|
1529
|
+
creator: Address;
|
|
1530
|
+
/** `CreatorFeeMode` wire value. */
|
|
1531
|
+
creatorFeeMode: number;
|
|
1532
|
+
};
|
|
1533
|
+
declare function getCreatePoolInstructionDataEncoder(): FixedSizeEncoder<CreatePoolInstructionDataArgs>;
|
|
1534
|
+
declare function getCreatePoolInstructionDataDecoder(): FixedSizeDecoder<CreatePoolInstructionData>;
|
|
1535
|
+
declare function getCreatePoolInstructionDataCodec(): FixedSizeCodec<CreatePoolInstructionDataArgs, CreatePoolInstructionData>;
|
|
1536
|
+
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> = {
|
|
1537
|
+
/**
|
|
1538
|
+
* Pays rent for the pool, its vaults, its LP mint, and the LP token
|
|
1539
|
+
* account.
|
|
1540
|
+
*/
|
|
1541
|
+
payer: TAccountPayer;
|
|
1542
|
+
/**
|
|
1543
|
+
* Owner of the token accounts the initial deposit comes from. May be the
|
|
1544
|
+
* same account as `payer`.
|
|
1545
|
+
*/
|
|
1546
|
+
depositor: TAccountDepositor;
|
|
1547
|
+
/**
|
|
1548
|
+
* Signer that authorizes pool creation. When the tier restricts pool
|
|
1549
|
+
* creation this must be its pool-creator authority; otherwise any signer
|
|
1550
|
+
* works, so pass the payer.
|
|
1551
|
+
*/
|
|
1552
|
+
poolCreatorAuthority: TAccountPoolCreatorAuthority;
|
|
1553
|
+
/** The fee tier the pool is created under. */
|
|
1554
|
+
ammConfig: TAccountAmmConfig;
|
|
1555
|
+
/** Token 0 mint: the byte-wise smaller mint address. */
|
|
1556
|
+
mint0: TAccountMint0;
|
|
1557
|
+
/** Token 1 mint: the byte-wise larger mint address. */
|
|
1558
|
+
mint1: TAccountMint1;
|
|
1559
|
+
/** The pool PDA to create: `[b"pool", amm_config, mint_0, mint_1]`. */
|
|
1560
|
+
pool?: TAccountPool;
|
|
1561
|
+
/** The LP mint PDA to create: `[b"pool_lp_mint", pool]`. */
|
|
1562
|
+
lpMint: TAccountLpMint;
|
|
1563
|
+
/** The token 0 vault PDA to create: `[b"pool_vault", pool, mint_0]`. */
|
|
1564
|
+
vault0: TAccountVault0;
|
|
1565
|
+
/** The token 1 vault PDA to create: `[b"pool_vault", pool, mint_1]`. */
|
|
1566
|
+
vault1: TAccountVault1;
|
|
1567
|
+
/** The depositor's token 0 account. */
|
|
1568
|
+
depositorToken0: TAccountDepositorToken0;
|
|
1569
|
+
/** The depositor's token 1 account. */
|
|
1570
|
+
depositorToken1: TAccountDepositorToken1;
|
|
1571
|
+
/** Wallet that receives the initial LP. */
|
|
1572
|
+
lpOwner: TAccountLpOwner;
|
|
1573
|
+
/** `lp_owner`'s associated token account for the LP mint, created here. */
|
|
1574
|
+
lpOwnerToken: TAccountLpOwnerToken;
|
|
1575
|
+
/** Token program that owns `mint_0`. */
|
|
1576
|
+
tokenProgram0: TAccountTokenProgram0;
|
|
1577
|
+
/** Token program that owns `mint_1`. */
|
|
1578
|
+
tokenProgram1: TAccountTokenProgram1;
|
|
1579
|
+
/** SPL Token, which owns every LP mint. */
|
|
1580
|
+
lpTokenProgram?: TAccountLpTokenProgram;
|
|
1581
|
+
/** The associated token account program. */
|
|
1582
|
+
associatedTokenProgram?: TAccountAssociatedTokenProgram;
|
|
1583
|
+
/** The system program. */
|
|
1584
|
+
systemProgram?: TAccountSystemProgram;
|
|
1585
|
+
amount0: CreatePoolInstructionDataArgs["amount0"];
|
|
1586
|
+
amount1: CreatePoolInstructionDataArgs["amount1"];
|
|
1587
|
+
creator: CreatePoolInstructionDataArgs["creator"];
|
|
1588
|
+
creatorFeeMode: CreatePoolInstructionDataArgs["creatorFeeMode"];
|
|
1589
|
+
};
|
|
1590
|
+
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?: {
|
|
1591
|
+
programAddress?: TProgramAddress;
|
|
1592
|
+
}): 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>>>>;
|
|
1593
|
+
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> = {
|
|
1594
|
+
/**
|
|
1595
|
+
* Pays rent for the pool, its vaults, its LP mint, and the LP token
|
|
1596
|
+
* account.
|
|
1597
|
+
*/
|
|
1598
|
+
payer: TAccountPayer;
|
|
1599
|
+
/**
|
|
1600
|
+
* Owner of the token accounts the initial deposit comes from. May be the
|
|
1601
|
+
* same account as `payer`.
|
|
1602
|
+
*/
|
|
1603
|
+
depositor: TAccountDepositor;
|
|
1604
|
+
/**
|
|
1605
|
+
* Signer that authorizes pool creation. When the tier restricts pool
|
|
1606
|
+
* creation this must be its pool-creator authority; otherwise any signer
|
|
1607
|
+
* works, so pass the payer.
|
|
1608
|
+
*/
|
|
1609
|
+
poolCreatorAuthority: TAccountPoolCreatorAuthority;
|
|
1610
|
+
/** The fee tier the pool is created under. */
|
|
1611
|
+
ammConfig: TAccountAmmConfig;
|
|
1612
|
+
/** Token 0 mint: the byte-wise smaller mint address. */
|
|
1613
|
+
mint0: TAccountMint0;
|
|
1614
|
+
/** Token 1 mint: the byte-wise larger mint address. */
|
|
1615
|
+
mint1: TAccountMint1;
|
|
1616
|
+
/** The pool PDA to create: `[b"pool", amm_config, mint_0, mint_1]`. */
|
|
1617
|
+
pool: TAccountPool;
|
|
1618
|
+
/** The LP mint PDA to create: `[b"pool_lp_mint", pool]`. */
|
|
1619
|
+
lpMint: TAccountLpMint;
|
|
1620
|
+
/** The token 0 vault PDA to create: `[b"pool_vault", pool, mint_0]`. */
|
|
1621
|
+
vault0: TAccountVault0;
|
|
1622
|
+
/** The token 1 vault PDA to create: `[b"pool_vault", pool, mint_1]`. */
|
|
1623
|
+
vault1: TAccountVault1;
|
|
1624
|
+
/** The depositor's token 0 account. */
|
|
1625
|
+
depositorToken0: TAccountDepositorToken0;
|
|
1626
|
+
/** The depositor's token 1 account. */
|
|
1627
|
+
depositorToken1: TAccountDepositorToken1;
|
|
1628
|
+
/** Wallet that receives the initial LP. */
|
|
1629
|
+
lpOwner: TAccountLpOwner;
|
|
1630
|
+
/** `lp_owner`'s associated token account for the LP mint, created here. */
|
|
1631
|
+
lpOwnerToken: TAccountLpOwnerToken;
|
|
1632
|
+
/** Token program that owns `mint_0`. */
|
|
1633
|
+
tokenProgram0: TAccountTokenProgram0;
|
|
1634
|
+
/** Token program that owns `mint_1`. */
|
|
1635
|
+
tokenProgram1: TAccountTokenProgram1;
|
|
1636
|
+
/** SPL Token, which owns every LP mint. */
|
|
1637
|
+
lpTokenProgram?: TAccountLpTokenProgram;
|
|
1638
|
+
/** The associated token account program. */
|
|
1639
|
+
associatedTokenProgram?: TAccountAssociatedTokenProgram;
|
|
1640
|
+
/** The system program. */
|
|
1641
|
+
systemProgram?: TAccountSystemProgram;
|
|
1642
|
+
amount0: CreatePoolInstructionDataArgs["amount0"];
|
|
1643
|
+
amount1: CreatePoolInstructionDataArgs["amount1"];
|
|
1644
|
+
creator: CreatePoolInstructionDataArgs["creator"];
|
|
1645
|
+
creatorFeeMode: CreatePoolInstructionDataArgs["creatorFeeMode"];
|
|
1646
|
+
};
|
|
1647
|
+
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?: {
|
|
1648
|
+
programAddress?: TProgramAddress;
|
|
1649
|
+
}): 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>>>;
|
|
1650
|
+
type ParsedCreatePoolInstruction<TProgram extends string = typeof PINA_AMM_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
|
|
1651
|
+
programAddress: Address<TProgram>;
|
|
1652
|
+
accounts: {
|
|
1653
|
+
/**
|
|
1654
|
+
* Pays rent for the pool, its vaults, its LP mint, and the LP token
|
|
1655
|
+
* account.
|
|
1656
|
+
*/
|
|
1657
|
+
payer: TAccountMetas[0];
|
|
1658
|
+
/**
|
|
1659
|
+
* Owner of the token accounts the initial deposit comes from. May be the
|
|
1660
|
+
* same account as `payer`.
|
|
1661
|
+
*/
|
|
1662
|
+
depositor: TAccountMetas[1];
|
|
1663
|
+
/**
|
|
1664
|
+
* Signer that authorizes pool creation. When the tier restricts pool
|
|
1665
|
+
* creation this must be its pool-creator authority; otherwise any signer
|
|
1666
|
+
* works, so pass the payer.
|
|
1667
|
+
*/
|
|
1668
|
+
poolCreatorAuthority: TAccountMetas[2];
|
|
1669
|
+
/** The fee tier the pool is created under. */
|
|
1670
|
+
ammConfig: TAccountMetas[3];
|
|
1671
|
+
/** Token 0 mint: the byte-wise smaller mint address. */
|
|
1672
|
+
mint0: TAccountMetas[4];
|
|
1673
|
+
/** Token 1 mint: the byte-wise larger mint address. */
|
|
1674
|
+
mint1: TAccountMetas[5];
|
|
1675
|
+
/** The pool PDA to create: `[b"pool", amm_config, mint_0, mint_1]`. */
|
|
1676
|
+
pool: TAccountMetas[6];
|
|
1677
|
+
/** The LP mint PDA to create: `[b"pool_lp_mint", pool]`. */
|
|
1678
|
+
lpMint: TAccountMetas[7];
|
|
1679
|
+
/** The token 0 vault PDA to create: `[b"pool_vault", pool, mint_0]`. */
|
|
1680
|
+
vault0: TAccountMetas[8];
|
|
1681
|
+
/** The token 1 vault PDA to create: `[b"pool_vault", pool, mint_1]`. */
|
|
1682
|
+
vault1: TAccountMetas[9];
|
|
1683
|
+
/** The depositor's token 0 account. */
|
|
1684
|
+
depositorToken0: TAccountMetas[10];
|
|
1685
|
+
/** The depositor's token 1 account. */
|
|
1686
|
+
depositorToken1: TAccountMetas[11];
|
|
1687
|
+
/** Wallet that receives the initial LP. */
|
|
1688
|
+
lpOwner: TAccountMetas[12];
|
|
1689
|
+
/** `lp_owner`'s associated token account for the LP mint, created here. */
|
|
1690
|
+
lpOwnerToken: TAccountMetas[13];
|
|
1691
|
+
/** Token program that owns `mint_0`. */
|
|
1692
|
+
tokenProgram0: TAccountMetas[14];
|
|
1693
|
+
/** Token program that owns `mint_1`. */
|
|
1694
|
+
tokenProgram1: TAccountMetas[15];
|
|
1695
|
+
/** SPL Token, which owns every LP mint. */
|
|
1696
|
+
lpTokenProgram: TAccountMetas[16];
|
|
1697
|
+
/** The associated token account program. */
|
|
1698
|
+
associatedTokenProgram: TAccountMetas[17];
|
|
1699
|
+
/** The system program. */
|
|
1700
|
+
systemProgram: TAccountMetas[18];
|
|
1701
|
+
};
|
|
1702
|
+
data: CreatePoolInstructionData;
|
|
1703
|
+
};
|
|
1704
|
+
declare function parseCreatePoolInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedCreatePoolInstruction<TProgram, TAccountMetas>;
|
|
1705
|
+
|
|
1706
|
+
/**
|
|
1707
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
1708
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
1709
|
+
* to add features, then rerun Codama to update it.
|
|
1710
|
+
*
|
|
1711
|
+
* @see https://github.com/codama-idl/codama
|
|
1712
|
+
*/
|
|
1713
|
+
|
|
1714
|
+
declare const DEPOSIT_DISCRIMINATOR = 3;
|
|
1715
|
+
declare function getDepositDiscriminatorBytes(): ReadonlyUint8Array;
|
|
1716
|
+
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]>;
|
|
1717
|
+
type DepositInstructionData = {
|
|
1718
|
+
discriminator: number;
|
|
1719
|
+
/** LP to mint. */
|
|
1720
|
+
lpAmount: bigint;
|
|
1721
|
+
/** Most token 0 the depositor will add. */
|
|
1722
|
+
maximumAmount0: bigint;
|
|
1723
|
+
/** Most token 1 the depositor will add. */
|
|
1724
|
+
maximumAmount1: bigint;
|
|
1725
|
+
};
|
|
1726
|
+
type DepositInstructionDataArgs = {
|
|
1727
|
+
/** LP to mint. */
|
|
1728
|
+
lpAmount: number | bigint;
|
|
1729
|
+
/** Most token 0 the depositor will add. */
|
|
1730
|
+
maximumAmount0: number | bigint;
|
|
1731
|
+
/** Most token 1 the depositor will add. */
|
|
1732
|
+
maximumAmount1: number | bigint;
|
|
1733
|
+
};
|
|
1734
|
+
declare function getDepositInstructionDataEncoder(): FixedSizeEncoder<DepositInstructionDataArgs>;
|
|
1735
|
+
declare function getDepositInstructionDataDecoder(): FixedSizeDecoder<DepositInstructionData>;
|
|
1736
|
+
declare function getDepositInstructionDataCodec(): FixedSizeCodec<DepositInstructionDataArgs, DepositInstructionData>;
|
|
1737
|
+
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> = {
|
|
1738
|
+
/** The LP owner, who owns every token account below. */
|
|
1739
|
+
owner: TAccountOwner;
|
|
1740
|
+
/** The pool. */
|
|
1741
|
+
pool: TAccountPool;
|
|
1742
|
+
/** The pool's token 0 vault. */
|
|
1743
|
+
vault0: TAccountVault0;
|
|
1744
|
+
/** The pool's token 1 vault. */
|
|
1745
|
+
vault1: TAccountVault1;
|
|
1746
|
+
/** The pool's LP mint. */
|
|
1747
|
+
lpMint: TAccountLpMint;
|
|
1748
|
+
/** The owner's token 0 account. */
|
|
1749
|
+
ownerToken0: TAccountOwnerToken0;
|
|
1750
|
+
/** The owner's token 1 account. */
|
|
1751
|
+
ownerToken1: TAccountOwnerToken1;
|
|
1752
|
+
/** The owner's LP token account. */
|
|
1753
|
+
ownerLpToken: TAccountOwnerLpToken;
|
|
1754
|
+
/** Token program that owns token 0. */
|
|
1755
|
+
tokenProgram0: TAccountTokenProgram0;
|
|
1756
|
+
/** Token program that owns token 1. */
|
|
1757
|
+
tokenProgram1: TAccountTokenProgram1;
|
|
1758
|
+
/** SPL Token, which owns every LP mint. */
|
|
1759
|
+
lpTokenProgram?: TAccountLpTokenProgram;
|
|
1760
|
+
lpAmount: DepositInstructionDataArgs["lpAmount"];
|
|
1761
|
+
maximumAmount0: DepositInstructionDataArgs["maximumAmount0"];
|
|
1762
|
+
maximumAmount1: DepositInstructionDataArgs["maximumAmount1"];
|
|
1763
|
+
};
|
|
1764
|
+
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?: {
|
|
1765
|
+
programAddress?: TProgramAddress;
|
|
1766
|
+
}): 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>>>;
|
|
1767
|
+
type ParsedDepositInstruction<TProgram extends string = typeof PINA_AMM_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
|
|
1768
|
+
programAddress: Address<TProgram>;
|
|
1769
|
+
accounts: {
|
|
1770
|
+
/** The LP owner, who owns every token account below. */
|
|
1771
|
+
owner: TAccountMetas[0];
|
|
1772
|
+
/** The pool. */
|
|
1773
|
+
pool: TAccountMetas[1];
|
|
1774
|
+
/** The pool's token 0 vault. */
|
|
1775
|
+
vault0: TAccountMetas[2];
|
|
1776
|
+
/** The pool's token 1 vault. */
|
|
1777
|
+
vault1: TAccountMetas[3];
|
|
1778
|
+
/** The pool's LP mint. */
|
|
1779
|
+
lpMint: TAccountMetas[4];
|
|
1780
|
+
/** The owner's token 0 account. */
|
|
1781
|
+
ownerToken0: TAccountMetas[5];
|
|
1782
|
+
/** The owner's token 1 account. */
|
|
1783
|
+
ownerToken1: TAccountMetas[6];
|
|
1784
|
+
/** The owner's LP token account. */
|
|
1785
|
+
ownerLpToken: TAccountMetas[7];
|
|
1786
|
+
/** Token program that owns token 0. */
|
|
1787
|
+
tokenProgram0: TAccountMetas[8];
|
|
1788
|
+
/** Token program that owns token 1. */
|
|
1789
|
+
tokenProgram1: TAccountMetas[9];
|
|
1790
|
+
/** SPL Token, which owns every LP mint. */
|
|
1791
|
+
lpTokenProgram: TAccountMetas[10];
|
|
1792
|
+
};
|
|
1793
|
+
data: DepositInstructionData;
|
|
1794
|
+
};
|
|
1795
|
+
declare function parseDepositInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedDepositInstruction<TProgram, TAccountMetas>;
|
|
1796
|
+
|
|
1797
|
+
/**
|
|
1798
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
1799
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
1800
|
+
* to add features, then rerun Codama to update it.
|
|
1801
|
+
*
|
|
1802
|
+
* @see https://github.com/codama-idl/codama
|
|
1803
|
+
*/
|
|
1804
|
+
|
|
1805
|
+
declare const SET_POOL_CREATOR_DISCRIMINATOR = 9;
|
|
1806
|
+
declare function getSetPoolCreatorDiscriminatorBytes(): ReadonlyUint8Array;
|
|
1807
|
+
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]>;
|
|
1808
|
+
type SetPoolCreatorInstructionData = {
|
|
1809
|
+
discriminator: number;
|
|
1810
|
+
/** New recipient of the pool's creator fees. */
|
|
1811
|
+
newCreator: Address;
|
|
1812
|
+
};
|
|
1813
|
+
type SetPoolCreatorInstructionDataArgs = {
|
|
1814
|
+
/** New recipient of the pool's creator fees. */
|
|
1815
|
+
newCreator: Address;
|
|
1816
|
+
};
|
|
1817
|
+
declare function getSetPoolCreatorInstructionDataEncoder(): FixedSizeEncoder<SetPoolCreatorInstructionDataArgs>;
|
|
1818
|
+
declare function getSetPoolCreatorInstructionDataDecoder(): FixedSizeDecoder<SetPoolCreatorInstructionData>;
|
|
1819
|
+
declare function getSetPoolCreatorInstructionDataCodec(): FixedSizeCodec<SetPoolCreatorInstructionDataArgs, SetPoolCreatorInstructionData>;
|
|
1820
|
+
type SetPoolCreatorInput<TAccountCreator extends InstructionSignerInput = InstructionSignerInput, TAccountPool extends InstructionAccountInput = InstructionAccountInput> = {
|
|
1821
|
+
/** The pool's current creator. */
|
|
1822
|
+
creator: TAccountCreator;
|
|
1823
|
+
/** The pool. */
|
|
1824
|
+
pool: TAccountPool;
|
|
1825
|
+
newCreator: SetPoolCreatorInstructionDataArgs["newCreator"];
|
|
1826
|
+
};
|
|
1827
|
+
declare function getSetPoolCreatorInstruction<TAccountCreator extends InstructionSignerInput, TAccountPool extends InstructionAccountInput, TProgramAddress extends Address = typeof PINA_AMM_PROGRAM_ADDRESS>(input: SetPoolCreatorInput<TAccountCreator, TAccountPool>, config?: {
|
|
1828
|
+
programAddress?: TProgramAddress;
|
|
1829
|
+
}): SetPoolCreatorInstruction<TProgramAddress, ResolvedInstructionAccountMeta<TAccountCreator, InstructionAccountInputAddress<TAccountCreator>>, ResolvedInstructionAccountMeta<TAccountPool, InstructionAccountInputAddress<TAccountPool>>>;
|
|
1830
|
+
type ParsedSetPoolCreatorInstruction<TProgram extends string = typeof PINA_AMM_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
|
|
1831
|
+
programAddress: Address<TProgram>;
|
|
1832
|
+
accounts: {
|
|
1833
|
+
/** The pool's current creator. */
|
|
1834
|
+
creator: TAccountMetas[0];
|
|
1835
|
+
/** The pool. */
|
|
1836
|
+
pool: TAccountMetas[1];
|
|
1837
|
+
};
|
|
1838
|
+
data: SetPoolCreatorInstructionData;
|
|
1839
|
+
};
|
|
1840
|
+
declare function parseSetPoolCreatorInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedSetPoolCreatorInstruction<TProgram, TAccountMetas>;
|
|
1841
|
+
|
|
1842
|
+
/**
|
|
1843
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
1844
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
1845
|
+
* to add features, then rerun Codama to update it.
|
|
1846
|
+
*
|
|
1847
|
+
* @see https://github.com/codama-idl/codama
|
|
1848
|
+
*/
|
|
1849
|
+
|
|
1850
|
+
declare const SWAP_EXACT_IN_DISCRIMINATOR = 5;
|
|
1851
|
+
declare function getSwapExactInDiscriminatorBytes(): ReadonlyUint8Array;
|
|
1852
|
+
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]>;
|
|
1853
|
+
type SwapExactInInstructionData = {
|
|
1854
|
+
discriminator: number;
|
|
1855
|
+
/** Exact input the trader sells. */
|
|
1856
|
+
amountIn: bigint;
|
|
1857
|
+
/** Least output the trader will accept. */
|
|
1858
|
+
minimumAmountOut: bigint;
|
|
1859
|
+
};
|
|
1860
|
+
type SwapExactInInstructionDataArgs = {
|
|
1861
|
+
/** Exact input the trader sells. */
|
|
1862
|
+
amountIn: number | bigint;
|
|
1863
|
+
/** Least output the trader will accept. */
|
|
1864
|
+
minimumAmountOut: number | bigint;
|
|
1865
|
+
};
|
|
1866
|
+
declare function getSwapExactInInstructionDataEncoder(): FixedSizeEncoder<SwapExactInInstructionDataArgs>;
|
|
1867
|
+
declare function getSwapExactInInstructionDataDecoder(): FixedSizeDecoder<SwapExactInInstructionData>;
|
|
1868
|
+
declare function getSwapExactInInstructionDataCodec(): FixedSizeCodec<SwapExactInInstructionDataArgs, SwapExactInInstructionData>;
|
|
1869
|
+
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> = {
|
|
1870
|
+
/** The trader, who owns `input_token`. */
|
|
1871
|
+
trader: TAccountTrader;
|
|
1872
|
+
/** The pool to trade against. */
|
|
1873
|
+
pool: TAccountPool;
|
|
1874
|
+
/** The trader's account for the token being sold. */
|
|
1875
|
+
inputToken: TAccountInputToken;
|
|
1876
|
+
/** The account that receives the token being bought. */
|
|
1877
|
+
outputToken: TAccountOutputToken;
|
|
1878
|
+
/** The pool's vault for the token being sold. */
|
|
1879
|
+
inputVault: TAccountInputVault;
|
|
1880
|
+
/** The pool's vault for the token being bought. */
|
|
1881
|
+
outputVault: TAccountOutputVault;
|
|
1882
|
+
/** Token program that owns the sold token. */
|
|
1883
|
+
inputTokenProgram: TAccountInputTokenProgram;
|
|
1884
|
+
/** Token program that owns the bought token. */
|
|
1885
|
+
outputTokenProgram: TAccountOutputTokenProgram;
|
|
1886
|
+
amountIn: SwapExactInInstructionDataArgs["amountIn"];
|
|
1887
|
+
minimumAmountOut: SwapExactInInstructionDataArgs["minimumAmountOut"];
|
|
1888
|
+
};
|
|
1889
|
+
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?: {
|
|
1890
|
+
programAddress?: TProgramAddress;
|
|
1891
|
+
}): 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>>>;
|
|
1892
|
+
type ParsedSwapExactInInstruction<TProgram extends string = typeof PINA_AMM_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
|
|
1893
|
+
programAddress: Address<TProgram>;
|
|
1894
|
+
accounts: {
|
|
1895
|
+
/** The trader, who owns `input_token`. */
|
|
1896
|
+
trader: TAccountMetas[0];
|
|
1897
|
+
/** The pool to trade against. */
|
|
1898
|
+
pool: TAccountMetas[1];
|
|
1899
|
+
/** The trader's account for the token being sold. */
|
|
1900
|
+
inputToken: TAccountMetas[2];
|
|
1901
|
+
/** The account that receives the token being bought. */
|
|
1902
|
+
outputToken: TAccountMetas[3];
|
|
1903
|
+
/** The pool's vault for the token being sold. */
|
|
1904
|
+
inputVault: TAccountMetas[4];
|
|
1905
|
+
/** The pool's vault for the token being bought. */
|
|
1906
|
+
outputVault: TAccountMetas[5];
|
|
1907
|
+
/** Token program that owns the sold token. */
|
|
1908
|
+
inputTokenProgram: TAccountMetas[6];
|
|
1909
|
+
/** Token program that owns the bought token. */
|
|
1910
|
+
outputTokenProgram: TAccountMetas[7];
|
|
1911
|
+
};
|
|
1912
|
+
data: SwapExactInInstructionData;
|
|
1913
|
+
};
|
|
1914
|
+
declare function parseSwapExactInInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedSwapExactInInstruction<TProgram, TAccountMetas>;
|
|
1915
|
+
|
|
1916
|
+
/**
|
|
1917
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
1918
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
1919
|
+
* to add features, then rerun Codama to update it.
|
|
1920
|
+
*
|
|
1921
|
+
* @see https://github.com/codama-idl/codama
|
|
1922
|
+
*/
|
|
1923
|
+
|
|
1924
|
+
declare const SWAP_EXACT_OUT_DISCRIMINATOR = 6;
|
|
1925
|
+
declare function getSwapExactOutDiscriminatorBytes(): ReadonlyUint8Array;
|
|
1926
|
+
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]>;
|
|
1927
|
+
type SwapExactOutInstructionData = {
|
|
1928
|
+
discriminator: number;
|
|
1929
|
+
/** Exact output the trader buys. */
|
|
1930
|
+
amountOut: bigint;
|
|
1931
|
+
/** Most input the trader will pay. */
|
|
1932
|
+
maximumAmountIn: bigint;
|
|
1933
|
+
};
|
|
1934
|
+
type SwapExactOutInstructionDataArgs = {
|
|
1935
|
+
/** Exact output the trader buys. */
|
|
1936
|
+
amountOut: number | bigint;
|
|
1937
|
+
/** Most input the trader will pay. */
|
|
1938
|
+
maximumAmountIn: number | bigint;
|
|
1939
|
+
};
|
|
1940
|
+
declare function getSwapExactOutInstructionDataEncoder(): FixedSizeEncoder<SwapExactOutInstructionDataArgs>;
|
|
1941
|
+
declare function getSwapExactOutInstructionDataDecoder(): FixedSizeDecoder<SwapExactOutInstructionData>;
|
|
1942
|
+
declare function getSwapExactOutInstructionDataCodec(): FixedSizeCodec<SwapExactOutInstructionDataArgs, SwapExactOutInstructionData>;
|
|
1943
|
+
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> = {
|
|
1944
|
+
/** The trader, who owns `input_token`. */
|
|
1945
|
+
trader: TAccountTrader;
|
|
1946
|
+
/** The pool to trade against. */
|
|
1947
|
+
pool: TAccountPool;
|
|
1948
|
+
/** The trader's account for the token being sold. */
|
|
1949
|
+
inputToken: TAccountInputToken;
|
|
1950
|
+
/** The account that receives the token being bought. */
|
|
1951
|
+
outputToken: TAccountOutputToken;
|
|
1952
|
+
/** The pool's vault for the token being sold. */
|
|
1953
|
+
inputVault: TAccountInputVault;
|
|
1954
|
+
/** The pool's vault for the token being bought. */
|
|
1955
|
+
outputVault: TAccountOutputVault;
|
|
1956
|
+
/** Token program that owns the sold token. */
|
|
1957
|
+
inputTokenProgram: TAccountInputTokenProgram;
|
|
1958
|
+
/** Token program that owns the bought token. */
|
|
1959
|
+
outputTokenProgram: TAccountOutputTokenProgram;
|
|
1960
|
+
amountOut: SwapExactOutInstructionDataArgs["amountOut"];
|
|
1961
|
+
maximumAmountIn: SwapExactOutInstructionDataArgs["maximumAmountIn"];
|
|
1962
|
+
};
|
|
1963
|
+
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?: {
|
|
1964
|
+
programAddress?: TProgramAddress;
|
|
1965
|
+
}): 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>>>;
|
|
1966
|
+
type ParsedSwapExactOutInstruction<TProgram extends string = typeof PINA_AMM_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
|
|
1967
|
+
programAddress: Address<TProgram>;
|
|
1968
|
+
accounts: {
|
|
1969
|
+
/** The trader, who owns `input_token`. */
|
|
1970
|
+
trader: TAccountMetas[0];
|
|
1971
|
+
/** The pool to trade against. */
|
|
1972
|
+
pool: TAccountMetas[1];
|
|
1973
|
+
/** The trader's account for the token being sold. */
|
|
1974
|
+
inputToken: TAccountMetas[2];
|
|
1975
|
+
/** The account that receives the token being bought. */
|
|
1976
|
+
outputToken: TAccountMetas[3];
|
|
1977
|
+
/** The pool's vault for the token being sold. */
|
|
1978
|
+
inputVault: TAccountMetas[4];
|
|
1979
|
+
/** The pool's vault for the token being bought. */
|
|
1980
|
+
outputVault: TAccountMetas[5];
|
|
1981
|
+
/** Token program that owns the sold token. */
|
|
1982
|
+
inputTokenProgram: TAccountMetas[6];
|
|
1983
|
+
/** Token program that owns the bought token. */
|
|
1984
|
+
outputTokenProgram: TAccountMetas[7];
|
|
1985
|
+
};
|
|
1986
|
+
data: SwapExactOutInstructionData;
|
|
1987
|
+
};
|
|
1988
|
+
declare function parseSwapExactOutInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedSwapExactOutInstruction<TProgram, TAccountMetas>;
|
|
1989
|
+
|
|
1990
|
+
/**
|
|
1991
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
1992
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
1993
|
+
* to add features, then rerun Codama to update it.
|
|
1994
|
+
*
|
|
1995
|
+
* @see https://github.com/codama-idl/codama
|
|
1996
|
+
*/
|
|
1997
|
+
|
|
1998
|
+
declare const SYNC_POOL_DISCRIMINATOR = 10;
|
|
1999
|
+
declare function getSyncPoolDiscriminatorBytes(): ReadonlyUint8Array;
|
|
2000
|
+
type SyncPoolInstruction<TProgram extends string = typeof PINA_AMM_PROGRAM_ADDRESS, TAccountPool extends string | AccountMeta<string> = string, TAccountVault0 extends string | AccountMeta<string> = string, TAccountVault1 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<[TAccountPool extends string ? WritableAccount<TAccountPool> : TAccountPool, TAccountVault0 extends string ? ReadonlyAccount<TAccountVault0> : TAccountVault0, TAccountVault1 extends string ? ReadonlyAccount<TAccountVault1> : TAccountVault1, TAccountTokenProgram0 extends string ? ReadonlyAccount<TAccountTokenProgram0> : TAccountTokenProgram0, TAccountTokenProgram1 extends string ? ReadonlyAccount<TAccountTokenProgram1> : TAccountTokenProgram1, ...TRemainingAccounts]>;
|
|
2001
|
+
type SyncPoolInstructionData = {
|
|
2002
|
+
discriminator: number;
|
|
2003
|
+
};
|
|
2004
|
+
type SyncPoolInstructionDataArgs = {};
|
|
2005
|
+
declare function getSyncPoolInstructionDataEncoder(): FixedSizeEncoder<SyncPoolInstructionDataArgs>;
|
|
2006
|
+
declare function getSyncPoolInstructionDataDecoder(): FixedSizeDecoder<SyncPoolInstructionData>;
|
|
2007
|
+
declare function getSyncPoolInstructionDataCodec(): FixedSizeCodec<SyncPoolInstructionDataArgs, SyncPoolInstructionData>;
|
|
2008
|
+
type SyncPoolInput<TAccountPool extends InstructionAccountInput = InstructionAccountInput, TAccountVault0 extends InstructionAccountInput = InstructionAccountInput, TAccountVault1 extends InstructionAccountInput = InstructionAccountInput, TAccountTokenProgram0 extends InstructionAccountInput = InstructionAccountInput, TAccountTokenProgram1 extends InstructionAccountInput = InstructionAccountInput> = {
|
|
2009
|
+
/** The pool whose accumulator is advanced. */
|
|
2010
|
+
pool: TAccountPool;
|
|
2011
|
+
/** The pool's token 0 vault. */
|
|
2012
|
+
vault0: TAccountVault0;
|
|
2013
|
+
/** The pool's token 1 vault. */
|
|
2014
|
+
vault1: TAccountVault1;
|
|
2015
|
+
/** Token program that owns token 0. */
|
|
2016
|
+
tokenProgram0: TAccountTokenProgram0;
|
|
2017
|
+
/** Token program that owns token 1. */
|
|
2018
|
+
tokenProgram1: TAccountTokenProgram1;
|
|
2019
|
+
};
|
|
2020
|
+
declare function getSyncPoolInstruction<TAccountPool extends InstructionAccountInput, TAccountVault0 extends InstructionAccountInput, TAccountVault1 extends InstructionAccountInput, TAccountTokenProgram0 extends InstructionAccountInput, TAccountTokenProgram1 extends InstructionAccountInput, TProgramAddress extends Address = typeof PINA_AMM_PROGRAM_ADDRESS>(input: SyncPoolInput<TAccountPool, TAccountVault0, TAccountVault1, TAccountTokenProgram0, TAccountTokenProgram1>, config?: {
|
|
2021
|
+
programAddress?: TProgramAddress;
|
|
2022
|
+
}): SyncPoolInstruction<TProgramAddress, ResolvedInstructionAccountMeta<TAccountPool, InstructionAccountInputAddress<TAccountPool>>, ResolvedInstructionAccountMeta<TAccountVault0, InstructionAccountInputAddress<TAccountVault0>>, ResolvedInstructionAccountMeta<TAccountVault1, InstructionAccountInputAddress<TAccountVault1>>, ResolvedInstructionAccountMeta<TAccountTokenProgram0, InstructionAccountInputAddress<TAccountTokenProgram0>>, ResolvedInstructionAccountMeta<TAccountTokenProgram1, InstructionAccountInputAddress<TAccountTokenProgram1>>>;
|
|
2023
|
+
type ParsedSyncPoolInstruction<TProgram extends string = typeof PINA_AMM_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
|
|
2024
|
+
programAddress: Address<TProgram>;
|
|
2025
|
+
accounts: {
|
|
2026
|
+
/** The pool whose accumulator is advanced. */
|
|
2027
|
+
pool: TAccountMetas[0];
|
|
2028
|
+
/** The pool's token 0 vault. */
|
|
2029
|
+
vault0: TAccountMetas[1];
|
|
2030
|
+
/** The pool's token 1 vault. */
|
|
2031
|
+
vault1: TAccountMetas[2];
|
|
2032
|
+
/** Token program that owns token 0. */
|
|
2033
|
+
tokenProgram0: TAccountMetas[3];
|
|
2034
|
+
/** Token program that owns token 1. */
|
|
2035
|
+
tokenProgram1: TAccountMetas[4];
|
|
2036
|
+
};
|
|
2037
|
+
data: SyncPoolInstructionData;
|
|
2038
|
+
};
|
|
2039
|
+
declare function parseSyncPoolInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedSyncPoolInstruction<TProgram, TAccountMetas>;
|
|
2040
|
+
|
|
2041
|
+
/**
|
|
2042
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
2043
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
2044
|
+
* to add features, then rerun Codama to update it.
|
|
2045
|
+
*
|
|
2046
|
+
* @see https://github.com/codama-idl/codama
|
|
2047
|
+
*/
|
|
2048
|
+
|
|
2049
|
+
declare const UPDATE_CONFIG_DISCRIMINATOR = 1;
|
|
2050
|
+
declare function getUpdateConfigDiscriminatorBytes(): ReadonlyUint8Array;
|
|
2051
|
+
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]>;
|
|
2052
|
+
type UpdateConfigInstructionData = {
|
|
2053
|
+
discriminator: number;
|
|
2054
|
+
/** New tier authority. Pass the current authority to keep it. */
|
|
2055
|
+
newAuthority: Address;
|
|
2056
|
+
/** Swap fee future pools snapshot, in parts per million. */
|
|
2057
|
+
tradeFeeRate: number;
|
|
2058
|
+
/** Protocol share future pools snapshot, in parts per million. */
|
|
2059
|
+
protocolFeeRate: number;
|
|
2060
|
+
/** Creator fee future pools snapshot, in parts per million. */
|
|
2061
|
+
creatorFeeRate: number;
|
|
2062
|
+
};
|
|
2063
|
+
type UpdateConfigInstructionDataArgs = {
|
|
2064
|
+
/** New tier authority. Pass the current authority to keep it. */
|
|
2065
|
+
newAuthority: Address;
|
|
2066
|
+
/** Swap fee future pools snapshot, in parts per million. */
|
|
2067
|
+
tradeFeeRate: number;
|
|
2068
|
+
/** Protocol share future pools snapshot, in parts per million. */
|
|
2069
|
+
protocolFeeRate: number;
|
|
2070
|
+
/** Creator fee future pools snapshot, in parts per million. */
|
|
2071
|
+
creatorFeeRate: number;
|
|
2072
|
+
};
|
|
2073
|
+
declare function getUpdateConfigInstructionDataEncoder(): FixedSizeEncoder<UpdateConfigInstructionDataArgs>;
|
|
2074
|
+
declare function getUpdateConfigInstructionDataDecoder(): FixedSizeDecoder<UpdateConfigInstructionData>;
|
|
2075
|
+
declare function getUpdateConfigInstructionDataCodec(): FixedSizeCodec<UpdateConfigInstructionDataArgs, UpdateConfigInstructionData>;
|
|
2076
|
+
type UpdateConfigInput<TAccountAuthority extends InstructionSignerInput = InstructionSignerInput, TAccountAmmConfig extends InstructionAccountInput = InstructionAccountInput> = {
|
|
2077
|
+
/** The tier's current authority. */
|
|
2078
|
+
authority: TAccountAuthority;
|
|
2079
|
+
/** The tier to update. */
|
|
2080
|
+
ammConfig: TAccountAmmConfig;
|
|
2081
|
+
newAuthority: UpdateConfigInstructionDataArgs["newAuthority"];
|
|
2082
|
+
tradeFeeRate: UpdateConfigInstructionDataArgs["tradeFeeRate"];
|
|
2083
|
+
protocolFeeRate: UpdateConfigInstructionDataArgs["protocolFeeRate"];
|
|
2084
|
+
creatorFeeRate: UpdateConfigInstructionDataArgs["creatorFeeRate"];
|
|
2085
|
+
};
|
|
2086
|
+
declare function getUpdateConfigInstruction<TAccountAuthority extends InstructionSignerInput, TAccountAmmConfig extends InstructionAccountInput, TProgramAddress extends Address = typeof PINA_AMM_PROGRAM_ADDRESS>(input: UpdateConfigInput<TAccountAuthority, TAccountAmmConfig>, config?: {
|
|
2087
|
+
programAddress?: TProgramAddress;
|
|
2088
|
+
}): UpdateConfigInstruction<TProgramAddress, ResolvedInstructionAccountMeta<TAccountAuthority, InstructionAccountInputAddress<TAccountAuthority>>, ResolvedInstructionAccountMeta<TAccountAmmConfig, InstructionAccountInputAddress<TAccountAmmConfig>>>;
|
|
2089
|
+
type ParsedUpdateConfigInstruction<TProgram extends string = typeof PINA_AMM_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
|
|
2090
|
+
programAddress: Address<TProgram>;
|
|
2091
|
+
accounts: {
|
|
2092
|
+
/** The tier's current authority. */
|
|
2093
|
+
authority: TAccountMetas[0];
|
|
2094
|
+
/** The tier to update. */
|
|
2095
|
+
ammConfig: TAccountMetas[1];
|
|
2096
|
+
};
|
|
2097
|
+
data: UpdateConfigInstructionData;
|
|
2098
|
+
};
|
|
2099
|
+
declare function parseUpdateConfigInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedUpdateConfigInstruction<TProgram, TAccountMetas>;
|
|
2100
|
+
|
|
2101
|
+
/**
|
|
2102
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
2103
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
2104
|
+
* to add features, then rerun Codama to update it.
|
|
2105
|
+
*
|
|
2106
|
+
* @see https://github.com/codama-idl/codama
|
|
2107
|
+
*/
|
|
2108
|
+
|
|
2109
|
+
declare const WITHDRAW_DISCRIMINATOR = 4;
|
|
2110
|
+
declare function getWithdrawDiscriminatorBytes(): ReadonlyUint8Array;
|
|
2111
|
+
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]>;
|
|
2112
|
+
type WithdrawInstructionData = {
|
|
2113
|
+
discriminator: number;
|
|
2114
|
+
/** LP to burn. */
|
|
2115
|
+
lpAmount: bigint;
|
|
2116
|
+
/** Least token 0 the owner will accept. */
|
|
2117
|
+
minimumAmount0: bigint;
|
|
2118
|
+
/** Least token 1 the owner will accept. */
|
|
2119
|
+
minimumAmount1: bigint;
|
|
2120
|
+
};
|
|
2121
|
+
type WithdrawInstructionDataArgs = {
|
|
2122
|
+
/** LP to burn. */
|
|
2123
|
+
lpAmount: number | bigint;
|
|
2124
|
+
/** Least token 0 the owner will accept. */
|
|
2125
|
+
minimumAmount0: number | bigint;
|
|
2126
|
+
/** Least token 1 the owner will accept. */
|
|
2127
|
+
minimumAmount1: number | bigint;
|
|
2128
|
+
};
|
|
2129
|
+
declare function getWithdrawInstructionDataEncoder(): FixedSizeEncoder<WithdrawInstructionDataArgs>;
|
|
2130
|
+
declare function getWithdrawInstructionDataDecoder(): FixedSizeDecoder<WithdrawInstructionData>;
|
|
2131
|
+
declare function getWithdrawInstructionDataCodec(): FixedSizeCodec<WithdrawInstructionDataArgs, WithdrawInstructionData>;
|
|
2132
|
+
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> = {
|
|
2133
|
+
/** The LP owner, who owns every token account below. */
|
|
2134
|
+
owner: TAccountOwner;
|
|
2135
|
+
/** The pool. */
|
|
2136
|
+
pool: TAccountPool;
|
|
2137
|
+
/** The pool's token 0 vault. */
|
|
2138
|
+
vault0: TAccountVault0;
|
|
2139
|
+
/** The pool's token 1 vault. */
|
|
2140
|
+
vault1: TAccountVault1;
|
|
2141
|
+
/** The pool's LP mint. */
|
|
2142
|
+
lpMint: TAccountLpMint;
|
|
2143
|
+
/** The owner's token 0 account. */
|
|
2144
|
+
ownerToken0: TAccountOwnerToken0;
|
|
2145
|
+
/** The owner's token 1 account. */
|
|
2146
|
+
ownerToken1: TAccountOwnerToken1;
|
|
2147
|
+
/** The owner's LP token account. */
|
|
2148
|
+
ownerLpToken: TAccountOwnerLpToken;
|
|
2149
|
+
/** Token program that owns token 0. */
|
|
2150
|
+
tokenProgram0: TAccountTokenProgram0;
|
|
2151
|
+
/** Token program that owns token 1. */
|
|
2152
|
+
tokenProgram1: TAccountTokenProgram1;
|
|
2153
|
+
/** SPL Token, which owns every LP mint. */
|
|
2154
|
+
lpTokenProgram?: TAccountLpTokenProgram;
|
|
2155
|
+
lpAmount: WithdrawInstructionDataArgs["lpAmount"];
|
|
2156
|
+
minimumAmount0: WithdrawInstructionDataArgs["minimumAmount0"];
|
|
2157
|
+
minimumAmount1: WithdrawInstructionDataArgs["minimumAmount1"];
|
|
2158
|
+
};
|
|
2159
|
+
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?: {
|
|
2160
|
+
programAddress?: TProgramAddress;
|
|
2161
|
+
}): 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>>>;
|
|
2162
|
+
type ParsedWithdrawInstruction<TProgram extends string = typeof PINA_AMM_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
|
|
2163
|
+
programAddress: Address<TProgram>;
|
|
2164
|
+
accounts: {
|
|
2165
|
+
/** The LP owner, who owns every token account below. */
|
|
2166
|
+
owner: TAccountMetas[0];
|
|
2167
|
+
/** The pool. */
|
|
2168
|
+
pool: TAccountMetas[1];
|
|
2169
|
+
/** The pool's token 0 vault. */
|
|
2170
|
+
vault0: TAccountMetas[2];
|
|
2171
|
+
/** The pool's token 1 vault. */
|
|
2172
|
+
vault1: TAccountMetas[3];
|
|
2173
|
+
/** The pool's LP mint. */
|
|
2174
|
+
lpMint: TAccountMetas[4];
|
|
2175
|
+
/** The owner's token 0 account. */
|
|
2176
|
+
ownerToken0: TAccountMetas[5];
|
|
2177
|
+
/** The owner's token 1 account. */
|
|
2178
|
+
ownerToken1: TAccountMetas[6];
|
|
2179
|
+
/** The owner's LP token account. */
|
|
2180
|
+
ownerLpToken: TAccountMetas[7];
|
|
2181
|
+
/** Token program that owns token 0. */
|
|
2182
|
+
tokenProgram0: TAccountMetas[8];
|
|
2183
|
+
/** Token program that owns token 1. */
|
|
2184
|
+
tokenProgram1: TAccountMetas[9];
|
|
2185
|
+
/** SPL Token, which owns every LP mint. */
|
|
2186
|
+
lpTokenProgram: TAccountMetas[10];
|
|
2187
|
+
};
|
|
2188
|
+
data: WithdrawInstructionData;
|
|
2189
|
+
};
|
|
2190
|
+
declare function parseWithdrawInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedWithdrawInstruction<TProgram, TAccountMetas>;
|
|
2191
|
+
|
|
2192
|
+
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, CONFIG_CREATED_EVENT_DISCRIMINATOR, CONFIG_CREATED_EVENT_DISCRIMINATOR2, CONFIG_UPDATED_EVENT_DISCRIMINATOR, CONFIG_UPDATED_EVENT_DISCRIMINATOR2, CREATE_CONFIG_DISCRIMINATOR, CREATE_POOL_DISCRIMINATOR, type CollectCreatorFeesInput, type CollectCreatorFeesInstruction, type CollectCreatorFeesInstructionData, type CollectCreatorFeesInstructionDataArgs, type CollectProtocolFeesInput, type CollectProtocolFeesInstruction, type CollectProtocolFeesInstructionData, type CollectProtocolFeesInstructionDataArgs, type ConfigCreatedEvent, type ConfigCreatedEventArgs, type ConfigUpdatedEvent, type ConfigUpdatedEventArgs, type CreateConfigInput, type CreateConfigInstruction, type CreateConfigInstructionData, type CreateConfigInstructionDataArgs, type CreatePoolAsyncInput, type CreatePoolInput, type CreatePoolInstruction, type CreatePoolInstructionData, type CreatePoolInstructionDataArgs, DEPOSIT_DISCRIMINATOR, type DecodedConfigCreatedEvent, type DecodedConfigUpdatedEvent, type DecodedFeesCollectedEvent, type DecodedLiquidityChangedEvent, type DecodedPinaAmmEvent, type DecodedPoolCreatedEvent, type DecodedPoolCreatorChangedEvent, type DecodedPoolSyncedEvent, type DecodedPoolSyncedV0Event, 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__DEFAULT_CREATOR, 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_CREATOR_CHANGED_EVENT_DISCRIMINATOR, POOL_CREATOR_CHANGED_EVENT_DISCRIMINATOR2, POOL_DISCRIMINATOR, POOL_DISCRIMINATOR2, POOL_MIGRATION_VERSION, POOL_SYNCED_EVENT_DISCRIMINATOR, POOL_SYNCED_EVENT_DISCRIMINATOR2, POOL_SYNCED_V0_EVENT_DISCRIMINATOR, POOL_SYNCED_V0_EVENT_DISCRIMINATOR2, type ParsedCollectCreatorFeesInstruction, type ParsedCollectProtocolFeesInstruction, type ParsedCreateConfigInstruction, type ParsedCreatePoolInstruction, type ParsedDepositInstruction, type ParsedPinaAmmInstruction, type ParsedSetPoolCreatorInstruction, type ParsedSwapExactInInstruction, type ParsedSwapExactOutInstruction, type ParsedSyncPoolInstruction, 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 PoolCreatorChangedEvent, type PoolCreatorChangedEventArgs, type PoolLpMintSeeds, type PoolSeeds, type PoolSyncedEvent, type PoolSyncedEventArgs, type PoolSyncedV0Event, type PoolSyncedV0EventArgs, type PoolVaultSeeds, SET_POOL_CREATOR_DISCRIMINATOR, SWAPPED_EVENT_DISCRIMINATOR, SWAPPED_EVENT_DISCRIMINATOR2, SWAP_EXACT_IN_DISCRIMINATOR, SWAP_EXACT_OUT_DISCRIMINATOR, SYNC_POOL_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, type SyncPoolInput, type SyncPoolInstruction, type SyncPoolInstructionData, type SyncPoolInstructionDataArgs, UPDATE_CONFIG_DISCRIMINATOR, type UpdateConfigInput, type UpdateConfigInstruction, type UpdateConfigInstructionData, type UpdateConfigInstructionDataArgs, WITHDRAW_DISCRIMINATOR, type WithdrawInput, type WithdrawInstruction, type WithdrawInstructionData, type WithdrawInstructionDataArgs, ammConfigNeedsMigration, decodeAmmConfig, decodeConfigCreatedEvent, decodeConfigUpdatedEvent, decodeFeesCollectedEvent, decodeLiquidityChangedEvent, decodePool, decodePoolCreatedEvent, decodePoolCreatorChangedEvent, decodePoolSyncedEvent, decodePoolSyncedV0Event, 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, getConfigCreatedEventCodec, getConfigCreatedEventDecoder, getConfigCreatedEventDiscriminator2Bytes, getConfigCreatedEventDiscriminatorBytes, getConfigCreatedEventEncoder, getConfigUpdatedEventCodec, getConfigUpdatedEventDecoder, getConfigUpdatedEventDiscriminator2Bytes, getConfigUpdatedEventDiscriminatorBytes, getConfigUpdatedEventEncoder, 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, getPoolCreatorChangedEventCodec, getPoolCreatorChangedEventDecoder, getPoolCreatorChangedEventDiscriminator2Bytes, getPoolCreatorChangedEventDiscriminatorBytes, getPoolCreatorChangedEventEncoder, getPoolDecoder, getPoolDiscriminator2Bytes, getPoolDiscriminatorBytes, getPoolEncoder, getPoolSyncedEventCodec, getPoolSyncedEventDecoder, getPoolSyncedEventDiscriminator2Bytes, getPoolSyncedEventDiscriminatorBytes, getPoolSyncedEventEncoder, getPoolSyncedV0EventCodec, getPoolSyncedV0EventDecoder, getPoolSyncedV0EventDiscriminator2Bytes, getPoolSyncedV0EventDiscriminatorBytes, getPoolSyncedV0EventEncoder, getSetPoolCreatorDiscriminatorBytes, getSetPoolCreatorInstruction, getSetPoolCreatorInstructionDataCodec, getSetPoolCreatorInstructionDataDecoder, getSetPoolCreatorInstructionDataEncoder, getSwapExactInDiscriminatorBytes, getSwapExactInInstruction, getSwapExactInInstructionDataCodec, getSwapExactInInstructionDataDecoder, getSwapExactInInstructionDataEncoder, getSwapExactOutDiscriminatorBytes, getSwapExactOutInstruction, getSwapExactOutInstructionDataCodec, getSwapExactOutInstructionDataDecoder, getSwapExactOutInstructionDataEncoder, getSwappedEventCodec, getSwappedEventDecoder, getSwappedEventDiscriminator2Bytes, getSwappedEventDiscriminatorBytes, getSwappedEventEncoder, getSyncPoolDiscriminatorBytes, getSyncPoolInstruction, getSyncPoolInstructionDataCodec, getSyncPoolInstructionDataDecoder, getSyncPoolInstructionDataEncoder, getUpdateConfigDiscriminatorBytes, getUpdateConfigInstruction, getUpdateConfigInstructionDataCodec, getUpdateConfigInstructionDataDecoder, getUpdateConfigInstructionDataEncoder, getWithdrawDiscriminatorBytes, getWithdrawInstruction, getWithdrawInstructionDataCodec, getWithdrawInstructionDataDecoder, getWithdrawInstructionDataEncoder, identifyPinaAmmAccount, identifyPinaAmmEvent, identifyPinaAmmInstruction, isPinaAmmError, parseCollectCreatorFeesInstruction, parseCollectProtocolFeesInstruction, parseConfigCreatedEvent, parseConfigCreatedEventFromLog, parseConfigUpdatedEvent, parseConfigUpdatedEventFromLog, parseCreateConfigInstruction, parseCreatePoolInstruction, parseDepositInstruction, parseFeesCollectedEvent, parseFeesCollectedEventFromLog, parseLiquidityChangedEvent, parseLiquidityChangedEventFromLog, parsePinaAmmEventsFromLogs, parsePinaAmmInstruction, parsePoolCreatedEvent, parsePoolCreatedEventFromLog, parsePoolCreatorChangedEvent, parsePoolCreatorChangedEventFromLog, parsePoolSyncedEvent, parsePoolSyncedEventFromLog, parsePoolSyncedV0Event, parsePoolSyncedV0EventFromLog, parseSetPoolCreatorInstruction, parseSwapExactInInstruction, parseSwapExactOutInstruction, parseSwappedEvent, parseSwappedEventFromLog, parseSyncPoolInstruction, parseUpdateConfigInstruction, parseWithdrawInstruction, pinaAmmProgram, poolNeedsMigration };
|