@liquid-af/sdk 0.7.2 → 0.8.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.
@@ -192,23 +192,23 @@
192
192
  "args": []
193
193
  },
194
194
  {
195
- "name": "buy_exact_native",
195
+ "name": "buy_exact_in_native",
196
196
  "docs": [
197
- "Buys an exact amount of tokens from the bonding curve, paying SOL.",
197
+ "Buys tokens from the bonding curve by spending an exact amount of SOL (exact input).",
198
198
  "",
199
199
  "# Arguments",
200
- "* `exact_amount_out` - Exact amount of tokens to receive.",
201
- "* `max_amount_in` - Maximum SOL willing to spend (slippage protection)."
200
+ "* `amount_in` - Exact amount of SOL to spend (gross, before fees).",
201
+ "* `min_amount_out` - Minimum tokens expected (slippage protection)."
202
202
  ],
203
203
  "discriminator": [
204
- 58,
204
+ 78,
205
205
  141,
206
- 193,
207
- 198,
208
- 65,
209
- 238,
210
- 124,
211
- 188
206
+ 86,
207
+ 103,
208
+ 221,
209
+ 69,
210
+ 201,
211
+ 8
212
212
  ],
213
213
  "accounts": [
214
214
  {
@@ -1154,33 +1154,33 @@
1154
1154
  ],
1155
1155
  "args": [
1156
1156
  {
1157
- "name": "exact_amount_out",
1157
+ "name": "amount_in",
1158
1158
  "type": "u64"
1159
1159
  },
1160
1160
  {
1161
- "name": "max_amount_in",
1161
+ "name": "min_amount_out",
1162
1162
  "type": "u64"
1163
1163
  }
1164
1164
  ]
1165
1165
  },
1166
1166
  {
1167
- "name": "buy_exact_stable",
1167
+ "name": "buy_exact_in_stable",
1168
1168
  "docs": [
1169
- "Buys an exact amount of base tokens from a token-based bonding curve.",
1169
+ "Buys base tokens from a token-based bonding curve by spending an exact amount of quote tokens (exact input).",
1170
1170
  "",
1171
1171
  "# Arguments",
1172
- "* `exact_amount_out` - Exact amount of base tokens to receive.",
1173
- "* `max_amount_in` - Maximum quote tokens willing to spend (slippage protection)."
1172
+ "* `amount_in` - Exact amount of quote tokens (e.g., USDC) to spend (gross, before fees).",
1173
+ "* `min_amount_out` - Minimum base tokens expected (slippage protection)."
1174
1174
  ],
1175
1175
  "discriminator": [
1176
- 197,
1177
- 162,
1178
- 80,
1179
- 72,
1180
- 207,
1181
- 13,
1182
- 202,
1183
- 198
1176
+ 29,
1177
+ 218,
1178
+ 169,
1179
+ 159,
1180
+ 209,
1181
+ 43,
1182
+ 152,
1183
+ 140
1184
1184
  ],
1185
1185
  "accounts": [
1186
1186
  {
@@ -2271,33 +2271,33 @@
2271
2271
  ],
2272
2272
  "args": [
2273
2273
  {
2274
- "name": "exact_amount_out",
2274
+ "name": "amount_in",
2275
2275
  "type": "u64"
2276
2276
  },
2277
2277
  {
2278
- "name": "max_amount_in",
2278
+ "name": "min_amount_out",
2279
2279
  "type": "u64"
2280
2280
  }
2281
2281
  ]
2282
2282
  },
2283
2283
  {
2284
- "name": "buy_native",
2284
+ "name": "buy_exact_out_native",
2285
2285
  "docs": [
2286
- "Executes a buy on the bonding curve, exchanging SOL for tokens.",
2286
+ "Buys an exact amount of tokens from the bonding curve (exact output).",
2287
2287
  "",
2288
2288
  "# Arguments",
2289
- "* `amount_in` - Amount of SOL to spend (gross, before fees).",
2290
- "* `min_amount_out` - Minimum tokens expected (slippage protection)."
2289
+ "* `amount_out` - Exact amount of tokens to receive.",
2290
+ "* `max_amount_in` - Maximum SOL willing to spend (slippage protection)."
2291
2291
  ],
2292
2292
  "discriminator": [
2293
- 80,
2294
- 193,
2295
- 180,
2296
- 217,
2297
- 182,
2298
- 175,
2299
- 112,
2300
- 215
2293
+ 32,
2294
+ 69,
2295
+ 113,
2296
+ 201,
2297
+ 72,
2298
+ 30,
2299
+ 181,
2300
+ 249
2301
2301
  ],
2302
2302
  "accounts": [
2303
2303
  {
@@ -3243,33 +3243,33 @@
3243
3243
  ],
3244
3244
  "args": [
3245
3245
  {
3246
- "name": "amount_in",
3246
+ "name": "amount_out",
3247
3247
  "type": "u64"
3248
3248
  },
3249
3249
  {
3250
- "name": "min_amount_out",
3250
+ "name": "max_amount_in",
3251
3251
  "type": "u64"
3252
3252
  }
3253
3253
  ]
3254
3254
  },
3255
3255
  {
3256
- "name": "buy_stable",
3256
+ "name": "buy_exact_out_stable",
3257
3257
  "docs": [
3258
- "Executes a buy on a token-based bonding curve, exchanging quote tokens for base tokens.",
3258
+ "Buys an exact amount of base tokens from a token-based bonding curve (exact output).",
3259
3259
  "",
3260
3260
  "# Arguments",
3261
- "* `amount_in` - Amount of quote tokens (e.g., USDC) to spend (gross, before fees).",
3262
- "* `min_amount_out` - Minimum base tokens expected (slippage protection)."
3261
+ "* `amount_out` - Exact amount of base tokens to receive.",
3262
+ "* `max_amount_in` - Maximum quote tokens willing to spend (slippage protection)."
3263
3263
  ],
3264
3264
  "discriminator": [
3265
- 134,
3266
- 103,
3267
- 186,
3268
- 174,
3269
- 6,
3270
- 130,
3271
- 71,
3272
- 32
3265
+ 175,
3266
+ 248,
3267
+ 189,
3268
+ 233,
3269
+ 111,
3270
+ 155,
3271
+ 200,
3272
+ 152
3273
3273
  ],
3274
3274
  "accounts": [
3275
3275
  {
@@ -4360,11 +4360,11 @@
4360
4360
  ],
4361
4361
  "args": [
4362
4362
  {
4363
- "name": "amount_in",
4363
+ "name": "amount_out",
4364
4364
  "type": "u64"
4365
4365
  },
4366
4366
  {
4367
- "name": "min_amount_out",
4367
+ "name": "max_amount_in",
4368
4368
  "type": "u64"
4369
4369
  }
4370
4370
  ]
@@ -8657,23 +8657,23 @@
8657
8657
  "args": []
8658
8658
  },
8659
8659
  {
8660
- "name": "sell_exact_out_native",
8660
+ "name": "sell_exact_in_native",
8661
8661
  "docs": [
8662
- "Sells tokens on the bonding curve to receive an exact amount of SOL.",
8662
+ "Sells an exact amount of tokens on the bonding curve for SOL (exact input).",
8663
8663
  "",
8664
8664
  "# Arguments",
8665
- "* `exact_amount_out` - Exact net SOL to receive (after fees).",
8666
- "* `max_amount_in` - Maximum tokens willing to sell (slippage protection)."
8665
+ "* `amount_in` - Exact amount of tokens to sell.",
8666
+ "* `min_amount_out` - Minimum SOL expected (slippage protection)."
8667
8667
  ],
8668
8668
  "discriminator": [
8669
- 12,
8670
- 37,
8671
- 246,
8672
- 175,
8673
- 240,
8674
- 13,
8675
- 94,
8676
- 159
8669
+ 63,
8670
+ 236,
8671
+ 105,
8672
+ 4,
8673
+ 82,
8674
+ 226,
8675
+ 6,
8676
+ 53
8677
8677
  ],
8678
8678
  "accounts": [
8679
8679
  {
@@ -9619,33 +9619,33 @@
9619
9619
  ],
9620
9620
  "args": [
9621
9621
  {
9622
- "name": "exact_amount_out",
9622
+ "name": "amount_in",
9623
9623
  "type": "u64"
9624
9624
  },
9625
9625
  {
9626
- "name": "max_amount_in",
9626
+ "name": "min_amount_out",
9627
9627
  "type": "u64"
9628
9628
  }
9629
9629
  ]
9630
9630
  },
9631
9631
  {
9632
- "name": "sell_exact_out_stable",
9632
+ "name": "sell_exact_in_stable",
9633
9633
  "docs": [
9634
- "Sells base tokens on a token-based bonding curve to receive an exact amount of quote tokens.",
9634
+ "Sells an exact amount of base tokens on a token-based bonding curve for quote tokens (exact input).",
9635
9635
  "",
9636
9636
  "# Arguments",
9637
- "* `exact_amount_out` - Exact net quote tokens to receive (after fees).",
9638
- "* `max_amount_in` - Maximum base tokens willing to sell (slippage protection)."
9637
+ "* `amount_in` - Exact amount of base tokens to sell.",
9638
+ "* `min_amount_out` - Minimum quote tokens expected (slippage protection)."
9639
9639
  ],
9640
9640
  "discriminator": [
9641
- 142,
9642
- 160,
9643
- 62,
9644
- 117,
9645
- 13,
9646
- 119,
9647
- 8,
9648
- 3
9641
+ 58,
9642
+ 81,
9643
+ 251,
9644
+ 217,
9645
+ 70,
9646
+ 33,
9647
+ 92,
9648
+ 126
9649
9649
  ],
9650
9650
  "accounts": [
9651
9651
  {
@@ -10736,33 +10736,33 @@
10736
10736
  ],
10737
10737
  "args": [
10738
10738
  {
10739
- "name": "exact_amount_out",
10739
+ "name": "amount_in",
10740
10740
  "type": "u64"
10741
10741
  },
10742
10742
  {
10743
- "name": "max_amount_in",
10743
+ "name": "min_amount_out",
10744
10744
  "type": "u64"
10745
10745
  }
10746
10746
  ]
10747
10747
  },
10748
10748
  {
10749
- "name": "sell_native",
10749
+ "name": "sell_exact_out_native",
10750
10750
  "docs": [
10751
- "Executes a sell on the bonding curve, exchanging tokens for SOL.",
10751
+ "Sells tokens on the bonding curve to receive an exact amount of SOL (exact output).",
10752
10752
  "",
10753
10753
  "# Arguments",
10754
- "* `amount_in` - Amount of tokens to sell.",
10755
- "* `min_amount_out` - Minimum SOL expected (slippage protection)."
10754
+ "* `amount_out` - Exact net SOL to receive (after fees).",
10755
+ "* `max_amount_in` - Maximum tokens willing to sell (slippage protection)."
10756
10756
  ],
10757
10757
  "discriminator": [
10758
- 79,
10759
- 161,
10760
- 3,
10761
- 80,
10762
- 113,
10763
- 42,
10764
- 114,
10765
- 195
10758
+ 12,
10759
+ 37,
10760
+ 246,
10761
+ 175,
10762
+ 240,
10763
+ 13,
10764
+ 94,
10765
+ 159
10766
10766
  ],
10767
10767
  "accounts": [
10768
10768
  {
@@ -11708,33 +11708,33 @@
11708
11708
  ],
11709
11709
  "args": [
11710
11710
  {
11711
- "name": "amount_in",
11711
+ "name": "amount_out",
11712
11712
  "type": "u64"
11713
11713
  },
11714
11714
  {
11715
- "name": "min_amount_out",
11715
+ "name": "max_amount_in",
11716
11716
  "type": "u64"
11717
11717
  }
11718
11718
  ]
11719
11719
  },
11720
11720
  {
11721
- "name": "sell_stable",
11721
+ "name": "sell_exact_out_stable",
11722
11722
  "docs": [
11723
- "Executes a sell on a token-based bonding curve, exchanging base tokens for quote tokens.",
11723
+ "Sells base tokens on a token-based bonding curve to receive an exact amount of quote tokens (exact output).",
11724
11724
  "",
11725
11725
  "# Arguments",
11726
- "* `amount_in` - Amount of base tokens to sell.",
11727
- "* `min_amount_out` - Minimum quote tokens expected (slippage protection)."
11726
+ "* `amount_out` - Exact net quote tokens to receive (after fees).",
11727
+ "* `max_amount_in` - Maximum base tokens willing to sell (slippage protection)."
11728
11728
  ],
11729
11729
  "discriminator": [
11730
- 151,
11731
- 118,
11732
- 238,
11733
- 12,
11734
- 206,
11735
- 34,
11736
- 84,
11737
- 220
11730
+ 142,
11731
+ 160,
11732
+ 62,
11733
+ 117,
11734
+ 13,
11735
+ 119,
11736
+ 8,
11737
+ 3
11738
11738
  ],
11739
11739
  "accounts": [
11740
11740
  {
@@ -12825,11 +12825,11 @@
12825
12825
  ],
12826
12826
  "args": [
12827
12827
  {
12828
- "name": "amount_in",
12828
+ "name": "amount_out",
12829
12829
  "type": "u64"
12830
12830
  },
12831
12831
  {
12832
- "name": "min_amount_out",
12832
+ "name": "max_amount_in",
12833
12833
  "type": "u64"
12834
12834
  }
12835
12835
  ]
@@ -70,23 +70,23 @@ export type LiquidSwap = {
70
70
  "args": [];
71
71
  },
72
72
  {
73
- "name": "buy";
73
+ "name": "buyExactIn";
74
74
  "docs": [
75
- "Swap the tokens in the pool base output amount.",
75
+ "Buys base tokens by providing an exact amount of quote tokens (exact input).",
76
76
  "",
77
77
  "# Arguments",
78
- "* `max_amount_in` - input amount prevents excessive slippage",
79
- "* `amount_out` - amount of output token"
78
+ "* `amount_in` - Exact quote tokens to spend (before transfer fees).",
79
+ "* `minimum_amount_out` - Minimum base tokens to receive (after transfer fees; slippage protection)."
80
80
  ];
81
81
  "discriminator": [
82
- 102,
83
- 6,
84
- 61,
85
- 18,
86
- 1,
87
- 218,
88
- 235,
89
- 234
82
+ 250,
83
+ 234,
84
+ 13,
85
+ 123,
86
+ 213,
87
+ 156,
88
+ 19,
89
+ 236
90
90
  ];
91
91
  "accounts": [
92
92
  {
@@ -1046,33 +1046,33 @@ export type LiquidSwap = {
1046
1046
  ];
1047
1047
  "args": [
1048
1048
  {
1049
- "name": "maxAmountIn";
1049
+ "name": "amountIn";
1050
1050
  "type": "u64";
1051
1051
  },
1052
1052
  {
1053
- "name": "amountOut";
1053
+ "name": "minimumAmountOut";
1054
1054
  "type": "u64";
1055
1055
  }
1056
1056
  ];
1057
1057
  },
1058
1058
  {
1059
- "name": "buyExact";
1059
+ "name": "buyExactOut";
1060
1060
  "docs": [
1061
- "Buys base tokens by providing an exact amount of quote tokens (exact input).",
1061
+ "Buys base tokens by providing quote tokens to the pool (exact output).",
1062
1062
  "",
1063
1063
  "# Arguments",
1064
- "* `amount_in` - Exact quote tokens to spend.",
1065
- "* `minimum_amount_out` - Minimum base tokens to receive (slippage protection)."
1064
+ "* `max_amount_in` - Maximum quote tokens willing to spend (including transfer fees; slippage protection).",
1065
+ "* `amount_out` - Exact base tokens the user wants to receive (after transfer fees)."
1066
1066
  ];
1067
1067
  "discriminator": [
1068
- 2,
1069
- 162,
1070
- 8,
1071
- 52,
1072
- 139,
1073
- 46,
1074
- 160,
1075
- 13
1068
+ 24,
1069
+ 211,
1070
+ 116,
1071
+ 40,
1072
+ 105,
1073
+ 3,
1074
+ 153,
1075
+ 56
1076
1076
  ];
1077
1077
  "accounts": [
1078
1078
  {
@@ -2032,11 +2032,11 @@ export type LiquidSwap = {
2032
2032
  ];
2033
2033
  "args": [
2034
2034
  {
2035
- "name": "amountIn";
2035
+ "name": "maxAmountIn";
2036
2036
  "type": "u64";
2037
2037
  },
2038
2038
  {
2039
- "name": "minimumAmountOut";
2039
+ "name": "amountOut";
2040
2040
  "type": "u64";
2041
2041
  }
2042
2042
  ];
@@ -4184,23 +4184,23 @@ export type LiquidSwap = {
4184
4184
  "args": [];
4185
4185
  },
4186
4186
  {
4187
- "name": "sell";
4187
+ "name": "sellExactIn";
4188
4188
  "docs": [
4189
- "Swap the tokens in the pool base input amount.",
4189
+ "Sells base tokens by providing them to the pool and receiving quote tokens (exact input).",
4190
4190
  "",
4191
4191
  "# Arguments",
4192
- "* `amount_in` - input amount to transfer, output to DESTINATION is based on the exchange rate",
4193
- "* `minimum_amount_out` - Minimum amount of output token, prevents excessive slippage"
4192
+ "* `amount_in` - Exact amount of base tokens to sell (before transfer fees).",
4193
+ "* `minimum_amount_out` - Minimum quote tokens expected (after transfer fees; slippage protection)."
4194
4194
  ];
4195
4195
  "discriminator": [
4196
- 51,
4197
- 230,
4198
- 133,
4199
- 164,
4200
- 1,
4201
- 127,
4202
- 131,
4203
- 173
4196
+ 149,
4197
+ 39,
4198
+ 222,
4199
+ 155,
4200
+ 211,
4201
+ 124,
4202
+ 152,
4203
+ 26
4204
4204
  ];
4205
4205
  "accounts": [
4206
4206
  {