@liquid-af/sdk 0.10.2 → 0.10.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/README.md +2 -2
  2. package/dist/accounts/liquid-state.d.ts +10 -10
  3. package/dist/client.d.ts +18 -10
  4. package/dist/client.d.ts.map +1 -1
  5. package/dist/client.js +13 -0
  6. package/dist/client.js.map +1 -1
  7. package/dist/events/types.d.ts +1 -2
  8. package/dist/events/types.d.ts.map +1 -1
  9. package/dist/helpers/cashback.d.ts +14 -0
  10. package/dist/helpers/cashback.d.ts.map +1 -0
  11. package/dist/helpers/cashback.js +20 -0
  12. package/dist/helpers/cashback.js.map +1 -0
  13. package/dist/helpers/index.d.ts +1 -0
  14. package/dist/helpers/index.d.ts.map +1 -1
  15. package/dist/helpers/index.js +1 -0
  16. package/dist/helpers/index.js.map +1 -1
  17. package/dist/idl/liquid.d.ts +2557 -2550
  18. package/dist/idl/liquid.d.ts.map +1 -1
  19. package/dist/idl/liquid.json +2557 -2550
  20. package/dist/idl/liquid_events.d.ts +4 -11
  21. package/dist/idl/liquid_events.d.ts.map +1 -1
  22. package/dist/idl/liquid_events.json +4 -11
  23. package/dist/idl/liquid_fees.d.ts +20 -31
  24. package/dist/idl/liquid_fees.d.ts.map +1 -1
  25. package/dist/idl/liquid_fees.json +20 -31
  26. package/dist/idl/liquid_state.d.ts +180 -136
  27. package/dist/idl/liquid_state.d.ts.map +1 -1
  28. package/dist/idl/liquid_state.json +180 -136
  29. package/dist/idl/liquid_swap.d.ts +1017 -1010
  30. package/dist/idl/liquid_swap.d.ts.map +1 -1
  31. package/dist/idl/liquid_swap.json +1017 -1010
  32. package/dist/index.d.ts +1 -1
  33. package/dist/index.d.ts.map +1 -1
  34. package/dist/index.js.map +1 -1
  35. package/dist/math/cashback.d.ts +41 -0
  36. package/dist/math/cashback.d.ts.map +1 -0
  37. package/dist/math/cashback.js +86 -0
  38. package/dist/math/cashback.js.map +1 -0
  39. package/dist/math/index.d.ts +2 -0
  40. package/dist/math/index.d.ts.map +1 -1
  41. package/dist/math/index.js +1 -0
  42. package/dist/math/index.js.map +1 -1
  43. package/dist/types.d.ts +29 -5
  44. package/dist/types.d.ts.map +1 -1
  45. package/package.json +1 -1
  46. package/src/client.ts +20 -0
  47. package/src/events/types.ts +1 -2
  48. package/src/helpers/cashback.ts +28 -0
  49. package/src/helpers/index.ts +1 -0
  50. package/src/idl/liquid.json +2557 -2550
  51. package/src/idl/liquid.ts +2557 -2550
  52. package/src/idl/liquid_events.json +4 -11
  53. package/src/idl/liquid_events.ts +4 -11
  54. package/src/idl/liquid_fees.json +20 -31
  55. package/src/idl/liquid_fees.ts +20 -31
  56. package/src/idl/liquid_state.json +180 -136
  57. package/src/idl/liquid_state.ts +180 -136
  58. package/src/idl/liquid_swap.json +1017 -1010
  59. package/src/idl/liquid_swap.ts +1017 -1010
  60. package/src/index.ts +2 -0
  61. package/src/math/cashback.ts +124 -0
  62. package/src/math/index.ts +3 -0
  63. package/src/types.ts +31 -5
@@ -1,5 +1,5 @@
1
1
  {
2
- "address": "EventsQeXA43nLKR69DhHwNsJ6aM512AweMCgG3wG8zG",
2
+ "address": "Bast7hBDiqSsxiwEmqazwvPvXC3N4z8UQR5ZmkqXnCiY",
3
3
  "metadata": {
4
4
  "name": "liquid_events",
5
5
  "version": "0.1.0",
@@ -1159,13 +1159,6 @@
1159
1159
  ],
1160
1160
  "type": "pubkey"
1161
1161
  },
1162
- {
1163
- "name": "multiplier_bps",
1164
- "docs": [
1165
- "Cashback multiplier in basis points."
1166
- ],
1167
- "type": "u16"
1168
- },
1169
1162
  {
1170
1163
  "name": "timestamp",
1171
1164
  "docs": [
@@ -2266,9 +2259,9 @@
2266
2259
  "type": "u32"
2267
2260
  },
2268
2261
  {
2269
- "name": "sol_volume",
2262
+ "name": "usd_volume",
2270
2263
  "docs": [
2271
- "SOL volume at snapshot time."
2264
+ "USD volume at snapshot time."
2272
2265
  ],
2273
2266
  "type": "u128"
2274
2267
  },
@@ -2622,7 +2615,7 @@
2622
2615
  {
2623
2616
  "name": "TradeAmounts",
2624
2617
  "docs": [
2625
- "Trade amount variants for bonding curve trades."
2618
+ "Trade amount variants for bonding curve and AMM trades."
2626
2619
  ],
2627
2620
  "type": {
2628
2621
  "kind": "enum",
@@ -5,7 +5,7 @@
5
5
  * IDL can be found at `target/idl/liquid_events.json`.
6
6
  */
7
7
  export type LiquidEvents = {
8
- "address": "EventsQeXA43nLKR69DhHwNsJ6aM512AweMCgG3wG8zG",
8
+ "address": "Bast7hBDiqSsxiwEmqazwvPvXC3N4z8UQR5ZmkqXnCiY",
9
9
  "metadata": {
10
10
  "name": "liquidEvents",
11
11
  "version": "0.1.0",
@@ -1165,13 +1165,6 @@ export type LiquidEvents = {
1165
1165
  ],
1166
1166
  "type": "pubkey"
1167
1167
  },
1168
- {
1169
- "name": "multiplierBps",
1170
- "docs": [
1171
- "Cashback multiplier in basis points."
1172
- ],
1173
- "type": "u16"
1174
- },
1175
1168
  {
1176
1169
  "name": "timestamp",
1177
1170
  "docs": [
@@ -2272,9 +2265,9 @@ export type LiquidEvents = {
2272
2265
  "type": "u32"
2273
2266
  },
2274
2267
  {
2275
- "name": "solVolume",
2268
+ "name": "usdVolume",
2276
2269
  "docs": [
2277
- "SOL volume at snapshot time."
2270
+ "USD volume at snapshot time."
2278
2271
  ],
2279
2272
  "type": "u128"
2280
2273
  },
@@ -2628,7 +2621,7 @@ export type LiquidEvents = {
2628
2621
  {
2629
2622
  "name": "tradeAmounts",
2630
2623
  "docs": [
2631
- "Trade amount variants for bonding curve trades."
2624
+ "Trade amount variants for bonding curve and AMM trades."
2632
2625
  ],
2633
2626
  "type": {
2634
2627
  "kind": "enum",
@@ -1,5 +1,5 @@
1
1
  {
2
- "address": "FeesZQLb1xTeZbvaFRGnqzrZYzzmQtwhTYKQphbNGQru",
2
+ "address": "3iFrDQxt6ZQT5eTyoHSpdq9hpyj9QmXDjTNEopGYpvTh",
3
3
  "metadata": {
4
4
  "name": "liquid_fees",
5
5
  "version": "0.1.0",
@@ -10,10 +10,7 @@
10
10
  {
11
11
  "name": "accept_admin",
12
12
  "docs": [
13
- "Accept a pending admin transfer (step 2 of 2).",
14
- "",
15
- "# Arguments",
16
- "* `ctx` - Context containing the pending admin signer."
13
+ "Accept a pending admin transfer (step 2 of 2)."
17
14
  ],
18
15
  "discriminator": [
19
16
  112,
@@ -69,12 +66,7 @@
69
66
  {
70
67
  "name": "claim_fees",
71
68
  "docs": [
72
- "Claim accumulated SOL fees from a recipient's vault PDA.",
73
- "",
74
- "# Arguments",
75
- "The recipient must sign the transaction. The vault PDA is derived",
76
- "from the fee_config and recipient pubkey, ensuring only the rightful",
77
- "recipient can claim."
69
+ "Claim accumulated SOL fees from a recipient's vault PDA."
78
70
  ],
79
71
  "discriminator": [
80
72
  82,
@@ -178,7 +170,7 @@
178
170
  "docs": [
179
171
  "Liquid events program for centralized event emission."
180
172
  ],
181
- "address": "EventsQeXA43nLKR69DhHwNsJ6aM512AweMCgG3wG8zG"
173
+ "address": "Bast7hBDiqSsxiwEmqazwvPvXC3N4z8UQR5ZmkqXnCiY"
182
174
  }
183
175
  ],
184
176
  "args": []
@@ -186,11 +178,7 @@
186
178
  {
187
179
  "name": "claim_token_fees",
188
180
  "docs": [
189
- "Claim accumulated token fees from a recipient's vault ATA.",
190
- "",
191
- "# Arguments",
192
- "The recipient must sign the transaction. After claiming, the vault",
193
- "ATA is closed and rent is returned to the recipient."
181
+ "Claim accumulated token fees from a recipient's vault ATA."
194
182
  ],
195
183
  "discriminator": [
196
184
  205,
@@ -403,7 +391,7 @@
403
391
  "docs": [
404
392
  "Liquid events program for centralized event emission."
405
393
  ],
406
- "address": "EventsQeXA43nLKR69DhHwNsJ6aM512AweMCgG3wG8zG"
394
+ "address": "Bast7hBDiqSsxiwEmqazwvPvXC3N4z8UQR5ZmkqXnCiY"
407
395
  }
408
396
  ],
409
397
  "args": []
@@ -547,7 +535,7 @@
547
535
  "docs": [
548
536
  "Liquid events program for centralized event emission."
549
537
  ],
550
- "address": "EventsQeXA43nLKR69DhHwNsJ6aM512AweMCgG3wG8zG"
538
+ "address": "Bast7hBDiqSsxiwEmqazwvPvXC3N4z8UQR5ZmkqXnCiY"
551
539
  }
552
540
  ],
553
541
  "args": []
@@ -794,7 +782,7 @@
794
782
  "docs": [
795
783
  "Liquid events program for centralized event emission."
796
784
  ],
797
- "address": "EventsQeXA43nLKR69DhHwNsJ6aM512AweMCgG3wG8zG"
785
+ "address": "Bast7hBDiqSsxiwEmqazwvPvXC3N4z8UQR5ZmkqXnCiY"
798
786
  }
799
787
  ],
800
788
  "args": []
@@ -806,7 +794,10 @@
806
794
  "",
807
795
  "This should be called when creating a new bonding curve.",
808
796
  "The fee configuration is keyed by token_mint, so it persists",
809
- "across migration from bonding curve to AMM."
797
+ "across migration from bonding curve to AMM.",
798
+ "",
799
+ "# Arguments",
800
+ "* `args` - Fee recipients, basis points, and update authority."
810
801
  ],
811
802
  "discriminator": [
812
803
  62,
@@ -931,10 +922,7 @@
931
922
  {
932
923
  "name": "initialize_global_config",
933
924
  "docs": [
934
- "Initialize the global configuration for the liquid-fees program.",
935
- "",
936
- "# Arguments",
937
- "* `ctx` - Context containing the admin signer and global config PDA."
925
+ "Initialize the global configuration for the liquid-fees program."
938
926
  ],
939
927
  "discriminator": [
940
928
  113,
@@ -997,7 +985,6 @@
997
985
  "Override the update authority on a fee configuration.",
998
986
  "",
999
987
  "# Arguments",
1000
- "* `ctx` - Context containing the admin, global config, and target fee config.",
1001
988
  "* `args` - Contains the new update authority public key."
1002
989
  ],
1003
990
  "discriminator": [
@@ -1119,7 +1106,7 @@
1119
1106
  "docs": [
1120
1107
  "Liquid events program for centralized event emission."
1121
1108
  ],
1122
- "address": "EventsQeXA43nLKR69DhHwNsJ6aM512AweMCgG3wG8zG"
1109
+ "address": "Bast7hBDiqSsxiwEmqazwvPvXC3N4z8UQR5ZmkqXnCiY"
1123
1110
  }
1124
1111
  ],
1125
1112
  "args": [
@@ -1272,7 +1259,7 @@
1272
1259
  "docs": [
1273
1260
  "Liquid events program for centralized event emission."
1274
1261
  ],
1275
- "address": "EventsQeXA43nLKR69DhHwNsJ6aM512AweMCgG3wG8zG"
1262
+ "address": "Bast7hBDiqSsxiwEmqazwvPvXC3N4z8UQR5ZmkqXnCiY"
1276
1263
  }
1277
1264
  ],
1278
1265
  "args": []
@@ -1283,7 +1270,6 @@
1283
1270
  "Transfer admin authority to a new address (step 1 of 2).",
1284
1271
  "",
1285
1272
  "# Arguments",
1286
- "* `ctx` - Context containing the current admin signer.",
1287
1273
  "* `new_admin` - The new admin authority public key."
1288
1274
  ],
1289
1275
  "discriminator": [
@@ -1349,7 +1335,10 @@
1349
1335
  "",
1350
1336
  "Can update recipients or transfer update authority.",
1351
1337
  "Cannot be used to revoke - use `revoke_fee_config` instead.",
1352
- "Cannot be called on revoked configurations."
1338
+ "Cannot be called on revoked configurations.",
1339
+ "",
1340
+ "# Arguments",
1341
+ "* `args` - New recipients and/or new update authority."
1353
1342
  ],
1354
1343
  "discriminator": [
1355
1344
  104,
@@ -1484,7 +1473,7 @@
1484
1473
  "docs": [
1485
1474
  "Liquid events program for centralized event emission."
1486
1475
  ],
1487
- "address": "EventsQeXA43nLKR69DhHwNsJ6aM512AweMCgG3wG8zG"
1476
+ "address": "Bast7hBDiqSsxiwEmqazwvPvXC3N4z8UQR5ZmkqXnCiY"
1488
1477
  }
1489
1478
  ],
1490
1479
  "args": [
@@ -5,7 +5,7 @@
5
5
  * IDL can be found at `target/idl/liquid_fees.json`.
6
6
  */
7
7
  export type LiquidFees = {
8
- "address": "FeesZQLb1xTeZbvaFRGnqzrZYzzmQtwhTYKQphbNGQru",
8
+ "address": "3iFrDQxt6ZQT5eTyoHSpdq9hpyj9QmXDjTNEopGYpvTh",
9
9
  "metadata": {
10
10
  "name": "liquidFees",
11
11
  "version": "0.1.0",
@@ -16,10 +16,7 @@ export type LiquidFees = {
16
16
  {
17
17
  "name": "acceptAdmin",
18
18
  "docs": [
19
- "Accept a pending admin transfer (step 2 of 2).",
20
- "",
21
- "# Arguments",
22
- "* `ctx` - Context containing the pending admin signer."
19
+ "Accept a pending admin transfer (step 2 of 2)."
23
20
  ],
24
21
  "discriminator": [
25
22
  112,
@@ -75,12 +72,7 @@ export type LiquidFees = {
75
72
  {
76
73
  "name": "claimFees",
77
74
  "docs": [
78
- "Claim accumulated SOL fees from a recipient's vault PDA.",
79
- "",
80
- "# Arguments",
81
- "The recipient must sign the transaction. The vault PDA is derived",
82
- "from the fee_config and recipient pubkey, ensuring only the rightful",
83
- "recipient can claim."
75
+ "Claim accumulated SOL fees from a recipient's vault PDA."
84
76
  ],
85
77
  "discriminator": [
86
78
  82,
@@ -184,7 +176,7 @@ export type LiquidFees = {
184
176
  "docs": [
185
177
  "Liquid events program for centralized event emission."
186
178
  ],
187
- "address": "EventsQeXA43nLKR69DhHwNsJ6aM512AweMCgG3wG8zG"
179
+ "address": "Bast7hBDiqSsxiwEmqazwvPvXC3N4z8UQR5ZmkqXnCiY"
188
180
  }
189
181
  ],
190
182
  "args": []
@@ -192,11 +184,7 @@ export type LiquidFees = {
192
184
  {
193
185
  "name": "claimTokenFees",
194
186
  "docs": [
195
- "Claim accumulated token fees from a recipient's vault ATA.",
196
- "",
197
- "# Arguments",
198
- "The recipient must sign the transaction. After claiming, the vault",
199
- "ATA is closed and rent is returned to the recipient."
187
+ "Claim accumulated token fees from a recipient's vault ATA."
200
188
  ],
201
189
  "discriminator": [
202
190
  205,
@@ -409,7 +397,7 @@ export type LiquidFees = {
409
397
  "docs": [
410
398
  "Liquid events program for centralized event emission."
411
399
  ],
412
- "address": "EventsQeXA43nLKR69DhHwNsJ6aM512AweMCgG3wG8zG"
400
+ "address": "Bast7hBDiqSsxiwEmqazwvPvXC3N4z8UQR5ZmkqXnCiY"
413
401
  }
414
402
  ],
415
403
  "args": []
@@ -553,7 +541,7 @@ export type LiquidFees = {
553
541
  "docs": [
554
542
  "Liquid events program for centralized event emission."
555
543
  ],
556
- "address": "EventsQeXA43nLKR69DhHwNsJ6aM512AweMCgG3wG8zG"
544
+ "address": "Bast7hBDiqSsxiwEmqazwvPvXC3N4z8UQR5ZmkqXnCiY"
557
545
  }
558
546
  ],
559
547
  "args": []
@@ -800,7 +788,7 @@ export type LiquidFees = {
800
788
  "docs": [
801
789
  "Liquid events program for centralized event emission."
802
790
  ],
803
- "address": "EventsQeXA43nLKR69DhHwNsJ6aM512AweMCgG3wG8zG"
791
+ "address": "Bast7hBDiqSsxiwEmqazwvPvXC3N4z8UQR5ZmkqXnCiY"
804
792
  }
805
793
  ],
806
794
  "args": []
@@ -812,7 +800,10 @@ export type LiquidFees = {
812
800
  "",
813
801
  "This should be called when creating a new bonding curve.",
814
802
  "The fee configuration is keyed by token_mint, so it persists",
815
- "across migration from bonding curve to AMM."
803
+ "across migration from bonding curve to AMM.",
804
+ "",
805
+ "# Arguments",
806
+ "* `args` - Fee recipients, basis points, and update authority."
816
807
  ],
817
808
  "discriminator": [
818
809
  62,
@@ -937,10 +928,7 @@ export type LiquidFees = {
937
928
  {
938
929
  "name": "initializeGlobalConfig",
939
930
  "docs": [
940
- "Initialize the global configuration for the liquid-fees program.",
941
- "",
942
- "# Arguments",
943
- "* `ctx` - Context containing the admin signer and global config PDA."
931
+ "Initialize the global configuration for the liquid-fees program."
944
932
  ],
945
933
  "discriminator": [
946
934
  113,
@@ -1003,7 +991,6 @@ export type LiquidFees = {
1003
991
  "Override the update authority on a fee configuration.",
1004
992
  "",
1005
993
  "# Arguments",
1006
- "* `ctx` - Context containing the admin, global config, and target fee config.",
1007
994
  "* `args` - Contains the new update authority public key."
1008
995
  ],
1009
996
  "discriminator": [
@@ -1125,7 +1112,7 @@ export type LiquidFees = {
1125
1112
  "docs": [
1126
1113
  "Liquid events program for centralized event emission."
1127
1114
  ],
1128
- "address": "EventsQeXA43nLKR69DhHwNsJ6aM512AweMCgG3wG8zG"
1115
+ "address": "Bast7hBDiqSsxiwEmqazwvPvXC3N4z8UQR5ZmkqXnCiY"
1129
1116
  }
1130
1117
  ],
1131
1118
  "args": [
@@ -1278,7 +1265,7 @@ export type LiquidFees = {
1278
1265
  "docs": [
1279
1266
  "Liquid events program for centralized event emission."
1280
1267
  ],
1281
- "address": "EventsQeXA43nLKR69DhHwNsJ6aM512AweMCgG3wG8zG"
1268
+ "address": "Bast7hBDiqSsxiwEmqazwvPvXC3N4z8UQR5ZmkqXnCiY"
1282
1269
  }
1283
1270
  ],
1284
1271
  "args": []
@@ -1289,7 +1276,6 @@ export type LiquidFees = {
1289
1276
  "Transfer admin authority to a new address (step 1 of 2).",
1290
1277
  "",
1291
1278
  "# Arguments",
1292
- "* `ctx` - Context containing the current admin signer.",
1293
1279
  "* `new_admin` - The new admin authority public key."
1294
1280
  ],
1295
1281
  "discriminator": [
@@ -1355,7 +1341,10 @@ export type LiquidFees = {
1355
1341
  "",
1356
1342
  "Can update recipients or transfer update authority.",
1357
1343
  "Cannot be used to revoke - use `revoke_fee_config` instead.",
1358
- "Cannot be called on revoked configurations."
1344
+ "Cannot be called on revoked configurations.",
1345
+ "",
1346
+ "# Arguments",
1347
+ "* `args` - New recipients and/or new update authority."
1359
1348
  ],
1360
1349
  "discriminator": [
1361
1350
  104,
@@ -1490,7 +1479,7 @@ export type LiquidFees = {
1490
1479
  "docs": [
1491
1480
  "Liquid events program for centralized event emission."
1492
1481
  ],
1493
- "address": "EventsQeXA43nLKR69DhHwNsJ6aM512AweMCgG3wG8zG"
1482
+ "address": "Bast7hBDiqSsxiwEmqazwvPvXC3N4z8UQR5ZmkqXnCiY"
1494
1483
  }
1495
1484
  ],
1496
1485
  "args": [