@t2000/sdk 0.6.2 → 0.7.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.
@@ -1,3 +1,4 @@
1
- export { A as AdapterCapability, l as AdapterPositions, m as AdapterTxResult, C as CetusAdapter, o as HealthInfo, L as LendingAdapter, h as LendingRates, N as NaviAdapter, q as ProtocolRegistry, r as SuilendAdapter, b as SwapAdapter, s as SwapQuote } from '../index-DMDq8uxe.cjs';
1
+ export { A as AdapterCapability, k as AdapterPositions, l as AdapterTxResult, C as CetusAdapter, n as HealthInfo, L as LendingAdapter, h as LendingRates, N as NaviAdapter, p as ProtocolDescriptor, q as ProtocolRegistry, s as SuilendAdapter, b as SwapAdapter, t as SwapQuote, u as allDescriptors, v as cetusDescriptor, y as naviDescriptor, J as sentinelDescriptor, Q as suilendDescriptor } from '../index-rT0oHn8M.cjs';
2
2
  import '@mysten/sui/transactions';
3
3
  import '@mysten/sui/jsonRpc';
4
+ import '@mysten/sui/keypairs/ed25519';
@@ -1,3 +1,4 @@
1
- export { A as AdapterCapability, l as AdapterPositions, m as AdapterTxResult, C as CetusAdapter, o as HealthInfo, L as LendingAdapter, h as LendingRates, N as NaviAdapter, q as ProtocolRegistry, r as SuilendAdapter, b as SwapAdapter, s as SwapQuote } from '../index-DMDq8uxe.js';
1
+ export { A as AdapterCapability, k as AdapterPositions, l as AdapterTxResult, C as CetusAdapter, n as HealthInfo, L as LendingAdapter, h as LendingRates, N as NaviAdapter, p as ProtocolDescriptor, q as ProtocolRegistry, s as SuilendAdapter, b as SwapAdapter, t as SwapQuote, u as allDescriptors, v as cetusDescriptor, y as naviDescriptor, J as sentinelDescriptor, Q as suilendDescriptor } from '../index-rT0oHn8M.js';
2
2
  import '@mysten/sui/transactions';
3
3
  import '@mysten/sui/jsonRpc';
4
+ import '@mysten/sui/keypairs/ed25519';
@@ -148,6 +148,9 @@ var T2000_CONFIG_ID = process.env.T2000_CONFIG_ID ?? "0x408add9aa9322f93cfd87523
148
148
  var T2000_TREASURY_ID = process.env.T2000_TREASURY_ID ?? "0x3bb501b8300125dca59019247941a42af6b292a150ce3cfcce9449456be2ec91";
149
149
  process.env.T2000_API_URL ?? "https://api.t2000.ai";
150
150
  var CETUS_USDC_SUI_POOL = "0x51e883ba7c0b566a26cbc8a94cd33eb0abd418a77cc1e60ad22fd9b1f29cd2ab";
151
+ var CETUS_PACKAGE = "0x1eabed72c53feb3805120a081dc15963c204dc8d091542592abaf7a35689b2fb";
152
+ var SENTINEL = {
153
+ PACKAGE: "0x88b83f36dafcd5f6dcdcf1d2cb5889b03f61264ab3cee9cae35db7aa940a21b7"};
151
154
 
152
155
  // src/utils/format.ts
153
156
  function usdcToRaw(amount) {
@@ -584,6 +587,22 @@ async function maxBorrowAmount(client, addressOrKeypair) {
584
587
  }
585
588
 
586
589
  // src/adapters/navi.ts
590
+ var descriptor = {
591
+ id: "navi",
592
+ name: "NAVI Protocol",
593
+ packages: [],
594
+ dynamicPackageId: true,
595
+ actionMap: {
596
+ "incentive_v3::entry_deposit": "save",
597
+ "incentive_v3::deposit": "save",
598
+ "incentive_v3::withdraw_v2": "withdraw",
599
+ "incentive_v3::entry_withdraw": "withdraw",
600
+ "incentive_v3::borrow_v2": "borrow",
601
+ "incentive_v3::entry_borrow": "borrow",
602
+ "incentive_v3::entry_repay": "repay",
603
+ "incentive_v3::repay": "repay"
604
+ }
605
+ };
587
606
  var NaviAdapter = class {
588
607
  id = "navi";
589
608
  name = "NAVI Protocol";
@@ -728,6 +747,18 @@ function fallbackQuote(fromAsset, amount, poolPrice) {
728
747
  }
729
748
 
730
749
  // src/adapters/cetus.ts
750
+ var descriptor2 = {
751
+ id: "cetus",
752
+ name: "Cetus DEX",
753
+ packages: [CETUS_PACKAGE],
754
+ actionMap: {
755
+ "router::swap": "swap",
756
+ "router::swap_ab_bc": "swap",
757
+ "router::swap_ab_cb": "swap",
758
+ "router::swap_ba_bc": "swap",
759
+ "router::swap_ba_cb": "swap"
760
+ }
761
+ };
731
762
  var CetusAdapter = class {
732
763
  id = "cetus";
733
764
  name = "Cetus";
@@ -782,6 +813,20 @@ var LENDING_MARKET_TYPE = "0xf95b06141ed4a174f239417323bde3f209b972f5930d8521ea3
782
813
  var SUILEND_PACKAGE = "0xf95b06141ed4a174f239417323bde3f209b972f5930d8521ea38a52aff3a6ddf";
783
814
  var UPGRADE_CAP_ID = "0x3d4ef1859c3ee9fc72858f588b56a09da5466e64f8cc4e90a7b3b909fba8a7ae";
784
815
  var FALLBACK_PUBLISHED_AT = "0xd2a67633ccb8de063163e25bcfca242929caf5cf1a26c2929dab519ee0b8f331";
816
+ var descriptor3 = {
817
+ id: "suilend",
818
+ name: "Suilend",
819
+ packages: [SUILEND_PACKAGE],
820
+ actionMap: {
821
+ "lending_market::deposit_liquidity_and_mint_ctokens": "save",
822
+ "lending_market::deposit_ctokens_into_obligation": "save",
823
+ "lending_market::create_obligation": "save",
824
+ "lending_market::withdraw_ctokens": "withdraw",
825
+ "lending_market::redeem_ctokens_and_withdraw_liquidity": "withdraw",
826
+ "lending_market::borrow": "borrow",
827
+ "lending_market::repay": "repay"
828
+ }
829
+ };
785
830
  function interpolateRate(utilBreakpoints, aprBreakpoints, utilizationPct) {
786
831
  if (utilBreakpoints.length === 0) return 0;
787
832
  if (utilizationPct <= utilBreakpoints[0]) return aprBreakpoints[0];
@@ -1159,7 +1204,24 @@ var SuilendAdapter = class {
1159
1204
  return all;
1160
1205
  }
1161
1206
  };
1207
+ var descriptor4 = {
1208
+ id: "sentinel",
1209
+ name: "Sui Sentinel",
1210
+ packages: [SENTINEL.PACKAGE],
1211
+ actionMap: {
1212
+ "sentinel::request_attack": "sentinel_attack",
1213
+ "sentinel::consume_prompt": "sentinel_settle"
1214
+ }
1215
+ };
1216
+
1217
+ // src/adapters/index.ts
1218
+ var allDescriptors = [
1219
+ descriptor,
1220
+ descriptor3,
1221
+ descriptor2,
1222
+ descriptor4
1223
+ ];
1162
1224
 
1163
- export { CetusAdapter, NaviAdapter, ProtocolRegistry, SuilendAdapter };
1225
+ export { CetusAdapter, NaviAdapter, ProtocolRegistry, SuilendAdapter, allDescriptors, descriptor2 as cetusDescriptor, descriptor as naviDescriptor, descriptor4 as sentinelDescriptor, descriptor3 as suilendDescriptor };
1164
1226
  //# sourceMappingURL=index.js.map
1165
1227
  //# sourceMappingURL=index.js.map