@liquid-af/sdk 0.11.1 → 0.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/idl/liquid.d.ts +24 -1
- package/dist/idl/liquid.d.ts.map +1 -1
- package/dist/idl/liquid.json +24 -1
- package/dist/idl/liquid_events.d.ts +6 -0
- package/dist/idl/liquid_events.d.ts.map +1 -1
- package/dist/idl/liquid_events.json +6 -0
- package/dist/idl/liquid_fees.d.ts +85 -2
- package/dist/idl/liquid_fees.d.ts.map +1 -1
- package/dist/idl/liquid_fees.json +85 -2
- package/dist/idl/liquid_state.d.ts +115 -16
- package/dist/idl/liquid_state.d.ts.map +1 -1
- package/dist/idl/liquid_state.json +115 -16
- package/dist/idl/liquid_swap.d.ts +53 -15
- package/dist/idl/liquid_swap.d.ts.map +1 -1
- package/dist/idl/liquid_swap.json +53 -15
- package/dist/lut.d.ts +0 -13
- package/dist/lut.d.ts.map +1 -1
- package/dist/lut.js +1 -24
- package/dist/lut.js.map +1 -1
- package/package.json +1 -1
- package/src/idl/liquid.json +24 -1
- package/src/idl/liquid.ts +24 -1
- package/src/idl/liquid_events.json +6 -0
- package/src/idl/liquid_events.ts +6 -0
- package/src/idl/liquid_fees.json +85 -2
- package/src/idl/liquid_fees.ts +85 -2
- package/src/idl/liquid_state.json +115 -16
- package/src/idl/liquid_state.ts +115 -16
- package/src/idl/liquid_swap.json +53 -15
- package/src/idl/liquid_swap.ts +53 -15
- package/src/lut.ts +1 -33
package/src/idl/liquid_swap.ts
CHANGED
|
@@ -2100,12 +2100,12 @@ export type LiquidSwap = {
|
|
|
2100
2100
|
{
|
|
2101
2101
|
"name": "create",
|
|
2102
2102
|
"docs": [
|
|
2103
|
-
"Creates
|
|
2103
|
+
"Creates an AMM pool for the given token pair with an initial deposit.",
|
|
2104
2104
|
"",
|
|
2105
2105
|
"# Arguments",
|
|
2106
|
-
"* `init_amount_base` -
|
|
2107
|
-
"* `init_amount_quote` -
|
|
2108
|
-
"* `creator` -
|
|
2106
|
+
"* `init_amount_base` - Initial base token amount to deposit into the pool.",
|
|
2107
|
+
"* `init_amount_quote` - Initial quote token amount to deposit into the pool.",
|
|
2108
|
+
"* `creator` - Optional creator pubkey (for program-initiated migration pools)."
|
|
2109
2109
|
],
|
|
2110
2110
|
"discriminator": [
|
|
2111
2111
|
24,
|
|
@@ -2832,12 +2832,12 @@ export type LiquidSwap = {
|
|
|
2832
2832
|
{
|
|
2833
2833
|
"name": "deposit",
|
|
2834
2834
|
"docs": [
|
|
2835
|
-
"
|
|
2835
|
+
"Deposits liquidity into the pool, minting LP tokens to the owner.",
|
|
2836
2836
|
"",
|
|
2837
2837
|
"# Arguments",
|
|
2838
|
-
"* `lp_token_amount` -
|
|
2839
|
-
"* `maximum_base_token_amount` -
|
|
2840
|
-
"* `maximum_quote_token_amount` - Maximum quote
|
|
2838
|
+
"* `lp_token_amount` - Number of LP tokens to mint.",
|
|
2839
|
+
"* `maximum_base_token_amount` - Maximum base tokens willing to deposit (slippage protection).",
|
|
2840
|
+
"* `maximum_quote_token_amount` - Maximum quote tokens willing to deposit (slippage protection)."
|
|
2841
2841
|
],
|
|
2842
2842
|
"discriminator": [
|
|
2843
2843
|
242,
|
|
@@ -2853,12 +2853,15 @@ export type LiquidSwap = {
|
|
|
2853
2853
|
{
|
|
2854
2854
|
"name": "owner",
|
|
2855
2855
|
"docs": [
|
|
2856
|
-
"
|
|
2856
|
+
"The owner depositing liquidity into the pool."
|
|
2857
2857
|
],
|
|
2858
2858
|
"signer": true
|
|
2859
2859
|
},
|
|
2860
2860
|
{
|
|
2861
2861
|
"name": "poolState",
|
|
2862
|
+
"docs": [
|
|
2863
|
+
"Pool state account validated against base/quote vaults and LP mint."
|
|
2864
|
+
],
|
|
2862
2865
|
"writable": true
|
|
2863
2866
|
},
|
|
2864
2867
|
{
|
|
@@ -4126,10 +4129,16 @@ export type LiquidSwap = {
|
|
|
4126
4129
|
"accounts": [
|
|
4127
4130
|
{
|
|
4128
4131
|
"name": "admin",
|
|
4132
|
+
"docs": [
|
|
4133
|
+
"The admin authorized to pause the protocol."
|
|
4134
|
+
],
|
|
4129
4135
|
"signer": true
|
|
4130
4136
|
},
|
|
4131
4137
|
{
|
|
4132
4138
|
"name": "globalConfig",
|
|
4139
|
+
"docs": [
|
|
4140
|
+
"Global configuration account to be updated."
|
|
4141
|
+
],
|
|
4133
4142
|
"writable": true,
|
|
4134
4143
|
"pda": {
|
|
4135
4144
|
"seeds": [
|
|
@@ -6349,10 +6358,16 @@ export type LiquidSwap = {
|
|
|
6349
6358
|
"accounts": [
|
|
6350
6359
|
{
|
|
6351
6360
|
"name": "admin",
|
|
6361
|
+
"docs": [
|
|
6362
|
+
"The admin authorized to unpause the protocol."
|
|
6363
|
+
],
|
|
6352
6364
|
"signer": true
|
|
6353
6365
|
},
|
|
6354
6366
|
{
|
|
6355
6367
|
"name": "globalConfig",
|
|
6368
|
+
"docs": [
|
|
6369
|
+
"Global configuration account to be updated."
|
|
6370
|
+
],
|
|
6356
6371
|
"writable": true,
|
|
6357
6372
|
"pda": {
|
|
6358
6373
|
"seeds": [
|
|
@@ -6506,12 +6521,12 @@ export type LiquidSwap = {
|
|
|
6506
6521
|
{
|
|
6507
6522
|
"name": "withdraw",
|
|
6508
6523
|
"docs": [
|
|
6509
|
-
"
|
|
6524
|
+
"Withdraws liquidity from the pool, burning LP tokens and returning base and quote tokens.",
|
|
6510
6525
|
"",
|
|
6511
6526
|
"# Arguments",
|
|
6512
|
-
"* `lp_token_amount` -
|
|
6513
|
-
"* `minimum_base_amount` -
|
|
6514
|
-
"* `minimum_quote_amount` -
|
|
6527
|
+
"* `lp_token_amount` - Number of LP tokens to burn.",
|
|
6528
|
+
"* `minimum_base_amount` - Minimum base tokens expected to receive (slippage protection).",
|
|
6529
|
+
"* `minimum_quote_amount` - Minimum quote tokens expected to receive (slippage protection)."
|
|
6515
6530
|
],
|
|
6516
6531
|
"discriminator": [
|
|
6517
6532
|
183,
|
|
@@ -6527,14 +6542,14 @@ export type LiquidSwap = {
|
|
|
6527
6542
|
{
|
|
6528
6543
|
"name": "owner",
|
|
6529
6544
|
"docs": [
|
|
6530
|
-
"
|
|
6545
|
+
"The owner withdrawing liquidity from the pool."
|
|
6531
6546
|
],
|
|
6532
6547
|
"signer": true
|
|
6533
6548
|
},
|
|
6534
6549
|
{
|
|
6535
6550
|
"name": "poolState",
|
|
6536
6551
|
"docs": [
|
|
6537
|
-
"Pool state account."
|
|
6552
|
+
"Pool state account validated against base/quote vaults and LP mint."
|
|
6538
6553
|
],
|
|
6539
6554
|
"writable": true
|
|
6540
6555
|
},
|
|
@@ -7185,6 +7200,9 @@ export type LiquidSwap = {
|
|
|
7185
7200
|
},
|
|
7186
7201
|
{
|
|
7187
7202
|
"name": "feeMode",
|
|
7203
|
+
"docs": [
|
|
7204
|
+
"The fee distribution mode for a token's fee configuration."
|
|
7205
|
+
],
|
|
7188
7206
|
"repr": {
|
|
7189
7207
|
"kind": "rust"
|
|
7190
7208
|
},
|
|
@@ -7202,6 +7220,9 @@ export type LiquidSwap = {
|
|
|
7202
7220
|
},
|
|
7203
7221
|
{
|
|
7204
7222
|
"name": "feeRecipient",
|
|
7223
|
+
"docs": [
|
|
7224
|
+
"A fee recipient with their allocation and vault PDA bump."
|
|
7225
|
+
],
|
|
7205
7226
|
"repr": {
|
|
7206
7227
|
"kind": "c"
|
|
7207
7228
|
},
|
|
@@ -7210,18 +7231,30 @@ export type LiquidSwap = {
|
|
|
7210
7231
|
"fields": [
|
|
7211
7232
|
{
|
|
7212
7233
|
"name": "pubkey",
|
|
7234
|
+
"docs": [
|
|
7235
|
+
"The public key of the fee recipient."
|
|
7236
|
+
],
|
|
7213
7237
|
"type": "pubkey"
|
|
7214
7238
|
},
|
|
7215
7239
|
{
|
|
7216
7240
|
"name": "basisPoints",
|
|
7241
|
+
"docs": [
|
|
7242
|
+
"The recipient's share of fees in basis points (out of 10,000)."
|
|
7243
|
+
],
|
|
7217
7244
|
"type": "u16"
|
|
7218
7245
|
},
|
|
7219
7246
|
{
|
|
7220
7247
|
"name": "vaultBump",
|
|
7248
|
+
"docs": [
|
|
7249
|
+
"The bump seed for the recipient's vault PDA."
|
|
7250
|
+
],
|
|
7221
7251
|
"type": "u8"
|
|
7222
7252
|
},
|
|
7223
7253
|
{
|
|
7224
7254
|
"name": "padding",
|
|
7255
|
+
"docs": [
|
|
7256
|
+
"Padding to align to 8-byte boundary (32 + 2 + 1 + 5 = 40 bytes)."
|
|
7257
|
+
],
|
|
7225
7258
|
"type": {
|
|
7226
7259
|
"array": [
|
|
7227
7260
|
"u8",
|
|
@@ -7579,6 +7612,11 @@ export type LiquidSwap = {
|
|
|
7579
7612
|
},
|
|
7580
7613
|
{
|
|
7581
7614
|
"name": "unifiedFeeConfiguration",
|
|
7615
|
+
"docs": [
|
|
7616
|
+
"Unified fee configuration for a token, supporting both Recipients and Revoked modes.",
|
|
7617
|
+
"",
|
|
7618
|
+
"Stored as a zero-copy account for efficient access in hot paths."
|
|
7619
|
+
],
|
|
7582
7620
|
"serialization": "bytemuckunsafe",
|
|
7583
7621
|
"repr": {
|
|
7584
7622
|
"kind": "c",
|
package/src/lut.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import {
|
|
2
|
-
AddressLookupTableProgram,
|
|
3
2
|
ComputeBudgetProgram,
|
|
4
3
|
PublicKey,
|
|
5
4
|
SystemProgram,
|
|
@@ -122,35 +121,4 @@ export async function fetchLut(
|
|
|
122
121
|
): Promise<AddressLookupTableAccount | null> {
|
|
123
122
|
const result = await connection.getAddressLookupTable(lutAddress);
|
|
124
123
|
return result.value;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Creates instructions to create and extend an Address Lookup Table.
|
|
129
|
-
*
|
|
130
|
-
* @param authority - The LUT authority (usually admin keypair)
|
|
131
|
-
* @param payer - The rent payer
|
|
132
|
-
* @param accounts - The accounts to add to the LUT
|
|
133
|
-
* @param recentSlot - A recent slot for LUT derivation
|
|
134
|
-
* @returns The LUT address and the create + extend instructions
|
|
135
|
-
*/
|
|
136
|
-
export function buildCreateLutInstructions(
|
|
137
|
-
authority: PublicKey,
|
|
138
|
-
payer: PublicKey,
|
|
139
|
-
accounts: PublicKey[],
|
|
140
|
-
recentSlot: number,
|
|
141
|
-
) {
|
|
142
|
-
const [createIx, lutAddress] = AddressLookupTableProgram.createLookupTable({
|
|
143
|
-
authority,
|
|
144
|
-
payer,
|
|
145
|
-
recentSlot,
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
const extendIx = AddressLookupTableProgram.extendLookupTable({
|
|
149
|
-
payer,
|
|
150
|
-
authority,
|
|
151
|
-
lookupTable: lutAddress,
|
|
152
|
-
addresses: accounts,
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
return { lutAddress, instructions: [createIx, extendIx] };
|
|
156
|
-
}
|
|
124
|
+
}
|