@liquid-af/sdk 0.10.1 → 0.10.3

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 (38) hide show
  1. package/README.md +2 -2
  2. package/dist/accounts/liquid-state.d.ts +10 -10
  3. package/dist/client.d.ts +10 -10
  4. package/dist/events/types.d.ts +1 -2
  5. package/dist/events/types.d.ts.map +1 -1
  6. package/dist/helpers/preview.d.ts.map +1 -1
  7. package/dist/helpers/preview.js +21 -48
  8. package/dist/helpers/preview.js.map +1 -1
  9. package/dist/idl/liquid.d.ts +67 -60
  10. package/dist/idl/liquid.d.ts.map +1 -1
  11. package/dist/idl/liquid.json +67 -60
  12. package/dist/idl/liquid_events.d.ts +3 -10
  13. package/dist/idl/liquid_events.d.ts.map +1 -1
  14. package/dist/idl/liquid_events.json +3 -10
  15. package/dist/idl/liquid_fees.d.ts +12 -23
  16. package/dist/idl/liquid_fees.d.ts.map +1 -1
  17. package/dist/idl/liquid_fees.json +12 -23
  18. package/dist/idl/liquid_state.d.ts +108 -64
  19. package/dist/idl/liquid_state.d.ts.map +1 -1
  20. package/dist/idl/liquid_state.json +108 -64
  21. package/dist/idl/liquid_swap.d.ts +19 -12
  22. package/dist/idl/liquid_swap.d.ts.map +1 -1
  23. package/dist/idl/liquid_swap.json +19 -12
  24. package/dist/types.d.ts +5 -5
  25. package/package.json +1 -1
  26. package/src/events/types.ts +1 -2
  27. package/src/helpers/preview.ts +46 -48
  28. package/src/idl/liquid.json +67 -60
  29. package/src/idl/liquid.ts +67 -60
  30. package/src/idl/liquid_events.json +3 -10
  31. package/src/idl/liquid_events.ts +3 -10
  32. package/src/idl/liquid_fees.json +12 -23
  33. package/src/idl/liquid_fees.ts +12 -23
  34. package/src/idl/liquid_state.json +108 -64
  35. package/src/idl/liquid_state.ts +108 -64
  36. package/src/idl/liquid_swap.json +19 -12
  37. package/src/idl/liquid_swap.ts +19 -12
  38. package/src/types.ts +5 -5
@@ -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,
@@ -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,
@@ -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": [
@@ -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,
@@ -68,7 +68,10 @@
68
68
  {
69
69
  "name": "admin_update_user",
70
70
  "docs": [
71
- "Admin updates a user's referrer/multiplier and always takes a snapshot"
71
+ "Admin updates a user's referrer/multiplier and always takes a snapshot.",
72
+ "",
73
+ "# Arguments",
74
+ "* `args` - Optional new referrer and cashback multiplier override."
72
75
  ],
73
76
  "discriminator": [
74
77
  161,
@@ -574,7 +577,10 @@
574
577
  {
575
578
  "name": "earn_cashback",
576
579
  "docs": [
577
- "Earn cashback credits (called via CPI during trades)"
580
+ "Earn cashback credits (called via CPI during trades).",
581
+ "",
582
+ "# Arguments",
583
+ "* `cashback_amount` - Base cashback amount in USD (6 decimals) before multiplier adjustment."
578
584
  ],
579
585
  "discriminator": [
580
586
  123,
@@ -667,6 +673,36 @@
667
673
  "Liquid events program for centralized event emission."
668
674
  ],
669
675
  "address": "EventsQeXA43nLKR69DhHwNsJ6aM512AweMCgG3wG8zG"
676
+ },
677
+ {
678
+ "name": "cashback_config",
679
+ "docs": [
680
+ "Cashback configuration for balance-based multiplier tiers."
681
+ ],
682
+ "pda": {
683
+ "seeds": [
684
+ {
685
+ "kind": "const",
686
+ "value": [
687
+ 99,
688
+ 97,
689
+ 115,
690
+ 104,
691
+ 98,
692
+ 97,
693
+ 99,
694
+ 107,
695
+ 95,
696
+ 99,
697
+ 111,
698
+ 110,
699
+ 102,
700
+ 105,
701
+ 103
702
+ ]
703
+ }
704
+ ]
705
+ }
670
706
  }
671
707
  ],
672
708
  "args": [
@@ -679,7 +715,10 @@
679
715
  {
680
716
  "name": "initialize_config",
681
717
  "docs": [
682
- "Initialize global configuration (cashback config and volume accumulators)"
718
+ "Initialize global configuration (cashback config and volume accumulators).",
719
+ "",
720
+ "# Arguments",
721
+ "* `args` - Admin authority, cashback ranges, and trader cashback basis points."
683
722
  ],
684
723
  "discriminator": [
685
724
  208,
@@ -1118,33 +1157,6 @@
1118
1157
  ]
1119
1158
  }
1120
1159
  },
1121
- {
1122
- "name": "cashback_config",
1123
- "pda": {
1124
- "seeds": [
1125
- {
1126
- "kind": "const",
1127
- "value": [
1128
- 99,
1129
- 97,
1130
- 115,
1131
- 104,
1132
- 98,
1133
- 97,
1134
- 99,
1135
- 107,
1136
- 95,
1137
- 99,
1138
- 111,
1139
- 110,
1140
- 102,
1141
- 105,
1142
- 103
1143
- ]
1144
- }
1145
- ]
1146
- }
1147
- },
1148
1160
  {
1149
1161
  "name": "cpi_authority",
1150
1162
  "docs": [
@@ -1186,7 +1198,10 @@
1186
1198
  {
1187
1199
  "name": "set_referrer",
1188
1200
  "docs": [
1189
- "User sets their referrer (one-time only)"
1201
+ "User sets their referrer (one-time only).",
1202
+ "",
1203
+ "# Arguments",
1204
+ "* `referrer` - The referrer's public key."
1190
1205
  ],
1191
1206
  "discriminator": [
1192
1207
  115,
@@ -1289,8 +1304,13 @@
1289
1304
  {
1290
1305
  "name": "spend_cashback",
1291
1306
  "docs": [
1292
- "Spend cashback credits to offset protocol fees (called via CPI)",
1293
- "Returns the amount actually spent"
1307
+ "Spend cashback credits to offset protocol fees (called via CPI).",
1308
+ "",
1309
+ "# Arguments",
1310
+ "* `amount` - Maximum USD credits to spend (6 decimals).",
1311
+ "",
1312
+ "# Returns",
1313
+ "* `SpendCashbackResult` - The amount of credits actually spent."
1294
1314
  ],
1295
1315
  "discriminator": [
1296
1316
  59,
@@ -1582,7 +1602,10 @@
1582
1602
  {
1583
1603
  "name": "transfer_admin",
1584
1604
  "docs": [
1585
- "Propose transfer of admin authority to a new pubkey (two-step)"
1605
+ "Propose transfer of admin authority to a new pubkey (two-step).",
1606
+ "",
1607
+ "# Arguments",
1608
+ "* `new_admin` - The proposed new admin authority public key."
1586
1609
  ],
1587
1610
  "discriminator": [
1588
1611
  42,
@@ -1645,7 +1668,11 @@
1645
1668
  "name": "update_amm_volumes",
1646
1669
  "docs": [
1647
1670
  "Update volume accumulators for AMM trades.",
1648
- "Called via CPI from the liquid-swap program."
1671
+ "Called via CPI from the liquid-swap program.",
1672
+ "",
1673
+ "# Arguments",
1674
+ "* `usd_amount` - Trade volume in USD (6 decimals).",
1675
+ "* `token_amount` - Trade volume in base token units."
1649
1676
  ],
1650
1677
  "discriminator": [
1651
1678
  155,
@@ -1840,7 +1867,7 @@
1840
1867
  ],
1841
1868
  "args": [
1842
1869
  {
1843
- "name": "sol_amount",
1870
+ "name": "usd_amount",
1844
1871
  "type": "u64"
1845
1872
  },
1846
1873
  {
@@ -1852,7 +1879,10 @@
1852
1879
  {
1853
1880
  "name": "update_config",
1854
1881
  "docs": [
1855
- "Admin updates cashback configuration"
1882
+ "Admin updates cashback configuration.",
1883
+ "",
1884
+ "# Arguments",
1885
+ "* `args` - New cashback ranges and/or trader cashback basis points."
1856
1886
  ],
1857
1887
  "discriminator": [
1858
1888
  29,
@@ -1919,7 +1949,11 @@
1919
1949
  "name": "update_curve_volumes",
1920
1950
  "docs": [
1921
1951
  "Update volume accumulators for bonding curve trades.",
1922
- "Called via CPI from the liquid program."
1952
+ "Called via CPI from the liquid program.",
1953
+ "",
1954
+ "# Arguments",
1955
+ "* `usd_amount` - Trade volume in USD (6 decimals).",
1956
+ "* `token_amount` - Trade volume in base token units."
1923
1957
  ],
1924
1958
  "discriminator": [
1925
1959
  119,
@@ -2116,7 +2150,7 @@
2116
2150
  ],
2117
2151
  "args": [
2118
2152
  {
2119
- "name": "sol_amount",
2153
+ "name": "usd_amount",
2120
2154
  "type": "u64"
2121
2155
  },
2122
2156
  {
@@ -2128,7 +2162,10 @@
2128
2162
  {
2129
2163
  "name": "update_deal",
2130
2164
  "docs": [
2131
- "Admin updates a deal's cashback multiplier"
2165
+ "Admin updates a deal's cashback multiplier.",
2166
+ "",
2167
+ "# Arguments",
2168
+ "* `new_cashback_multiplier_bps` - New cashback multiplier in basis points (10000 = 1x)."
2132
2169
  ],
2133
2170
  "discriminator": [
2134
2171
  244,
@@ -2464,7 +2501,9 @@
2464
2501
  {
2465
2502
  "name": "ranges",
2466
2503
  "docs": [
2467
- "Volume-based multiplier ranges (use len() for active count)"
2504
+ "Balance-based multiplier ranges (use len() for active count).",
2505
+ "Thresholds refer to the user's cashback credit balance. Multiplier is",
2506
+ "applied progressively as credits are earned, not at mode-switch."
2468
2507
  ],
2469
2508
  "type": {
2470
2509
  "vec": {
@@ -2496,7 +2535,12 @@
2496
2535
  {
2497
2536
  "name": "CashbackRange",
2498
2537
  "docs": [
2499
- "Cashback range defining volume-based multiplier tiers"
2538
+ "Cashback range defining balance-based multiplier tiers.",
2539
+ "",
2540
+ "Each range maps a cashback balance interval to a multiplier. When a user earns",
2541
+ "cashback, the earned amount is multiplied by the tier corresponding to their",
2542
+ "current balance. If earning crosses a tier boundary, the amount is split so",
2543
+ "each portion receives its respective tier's multiplier."
2500
2544
  ],
2501
2545
  "type": {
2502
2546
  "kind": "struct",
@@ -2504,14 +2548,14 @@
2504
2548
  {
2505
2549
  "name": "range_start_inclusive",
2506
2550
  "docs": [
2507
- "Lower bound of volume range (inclusive)"
2551
+ "Lower bound of balance range (inclusive), in USD with 6 decimals"
2508
2552
  ],
2509
2553
  "type": "u64"
2510
2554
  },
2511
2555
  {
2512
2556
  "name": "range_end_exclusive",
2513
2557
  "docs": [
2514
- "Upper bound of volume range (exclusive)"
2558
+ "Upper bound of balance range (exclusive), in USD with 6 decimals"
2515
2559
  ],
2516
2560
  "type": "u64"
2517
2561
  },
@@ -2571,9 +2615,9 @@
2571
2615
  "kind": "struct",
2572
2616
  "fields": [
2573
2617
  {
2574
- "name": "total_sol_volume",
2618
+ "name": "total_usd_volume",
2575
2619
  "docs": [
2576
- "Total SOL volume across all AMM trades"
2620
+ "Total USD volume across all AMM trades (6 decimals)"
2577
2621
  ],
2578
2622
  "type": "u128"
2579
2623
  },
@@ -2598,9 +2642,9 @@
2598
2642
  "kind": "struct",
2599
2643
  "fields": [
2600
2644
  {
2601
- "name": "total_sol_volume",
2645
+ "name": "total_usd_volume",
2602
2646
  "docs": [
2603
- "Total SOL volume across all curve trades"
2647
+ "Total USD volume across all curve trades (6 decimals)"
2604
2648
  ],
2605
2649
  "type": "u128"
2606
2650
  },
@@ -2704,9 +2748,9 @@
2704
2748
  "type": "pubkey"
2705
2749
  },
2706
2750
  {
2707
- "name": "total_sol_volume",
2751
+ "name": "total_usd_volume",
2708
2752
  "docs": [
2709
- "Total SOL volume for this token (curve + AMM)"
2753
+ "Total USD volume for this token (curve + AMM, 6 decimals)"
2710
2754
  ],
2711
2755
  "type": "u128"
2712
2756
  },
@@ -2718,16 +2762,16 @@
2718
2762
  "type": "u128"
2719
2763
  },
2720
2764
  {
2721
- "name": "curve_sol_volume",
2765
+ "name": "curve_usd_volume",
2722
2766
  "docs": [
2723
- "SOL volume from curve trades (for analytics)"
2767
+ "USD volume from curve trades (for analytics)"
2724
2768
  ],
2725
2769
  "type": "u128"
2726
2770
  },
2727
2771
  {
2728
- "name": "amm_sol_volume",
2772
+ "name": "amm_usd_volume",
2729
2773
  "docs": [
2730
- "SOL volume from AMM trades (for analytics)"
2774
+ "USD volume from AMM trades (for analytics)"
2731
2775
  ],
2732
2776
  "type": "u128"
2733
2777
  }
@@ -2784,9 +2828,9 @@
2784
2828
  }
2785
2829
  },
2786
2830
  {
2787
- "name": "total_sol_volume",
2831
+ "name": "total_usd_volume",
2788
2832
  "docs": [
2789
- "Total SOL volume traded across both curve and AMM (used for cashback multiplier)"
2833
+ "Total USD volume traded across both curve and AMM"
2790
2834
  ],
2791
2835
  "type": "u128"
2792
2836
  },
@@ -2812,23 +2856,23 @@
2812
2856
  "type": "bool"
2813
2857
  },
2814
2858
  {
2815
- "name": "curve_sol_volume",
2859
+ "name": "curve_usd_volume",
2816
2860
  "docs": [
2817
- "SOL volume from curve trades only (for analytics)"
2861
+ "USD volume from curve trades only (for analytics)"
2818
2862
  ],
2819
2863
  "type": "u128"
2820
2864
  },
2821
2865
  {
2822
- "name": "amm_sol_volume",
2866
+ "name": "amm_usd_volume",
2823
2867
  "docs": [
2824
- "SOL volume from AMM trades only (for analytics)"
2868
+ "USD volume from AMM trades only (for analytics)"
2825
2869
  ],
2826
2870
  "type": "u128"
2827
2871
  },
2828
2872
  {
2829
- "name": "snapshot_sol_volume",
2873
+ "name": "snapshot_usd_volume",
2830
2874
  "docs": [
2831
- "SOL volume accumulated since the last snapshot (resets on snapshot)"
2875
+ "USD volume accumulated since the last snapshot (resets on snapshot)"
2832
2876
  ],
2833
2877
  "type": "u128"
2834
2878
  },
@@ -2893,9 +2937,9 @@
2893
2937
  }
2894
2938
  },
2895
2939
  {
2896
- "name": "sol_volume",
2940
+ "name": "usd_volume",
2897
2941
  "docs": [
2898
- "SOL volume accumulated during this snapshot period"
2942
+ "USD volume accumulated during this snapshot period"
2899
2943
  ],
2900
2944
  "type": "u128"
2901
2945
  },