@t2000/cli 0.26.0 → 0.26.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.
@@ -63907,7 +63907,7 @@ var init_token_registry = __esm2({
63907
63907
  SUI: { type: "0x2::sui::SUI", decimals: 9, symbol: "SUI", tier: 2 },
63908
63908
  wBTC: { type: "0x0041f9f9344cac094454cd574e333c4fdb132d7bcc9379bcd4aab485b2a63942::wbtc::WBTC", decimals: 8, symbol: "wBTC", tier: 2 },
63909
63909
  ETH: { type: "0xd0e89b2af5e4910726fbcd8b8dd37bb79b29e5f83f7491bca830e94f7f226d29::eth::ETH", decimals: 8, symbol: "ETH", tier: 2 },
63910
- GOLD: { type: "0x9d297676e7a4b771ab023291377b2adfaa4938fb9080b8d12430e4b108b836a9::xaum::XAUM", decimals: 6, symbol: "GOLD", tier: 2 },
63910
+ GOLD: { type: "0x9d297676e7a4b771ab023291377b2adfaa4938fb9080b8d12430e4b108b836a9::xaum::XAUM", decimals: 9, symbol: "GOLD", tier: 2 },
63911
63911
  DEEP: { type: "0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270::deep::DEEP", decimals: 6, symbol: "DEEP", tier: 2 },
63912
63912
  WAL: { type: "0x356a26eb9e012a68958082340d4c4116e7f55615cf27affcff209cf0ae544f59::wal::WAL", decimals: 9, symbol: "WAL", tier: 2 },
63913
63913
  NS: { type: "0x5145494a5f5100e645e4b0aa950fa6b68f614e8c59e17bc5ded3495123a79178::ns::NS", decimals: 6, symbol: "NS", tier: 2 },
@@ -64139,6 +64139,7 @@ var init_cetus_swap = __esm2({
64139
64139
  clientInstance = null;
64140
64140
  }
64141
64141
  });
64142
+ init_errors();
64142
64143
  var MIST_PER_SUI2 = 1000000000n;
64143
64144
  var SUI_DECIMALS2 = 9;
64144
64145
  var USDC_DECIMALS = 6;
@@ -64207,6 +64208,30 @@ var SUPPORTED_ASSETS = {
64207
64208
  };
64208
64209
  var STABLE_ASSETS = ["USDC"];
64209
64210
  var ALL_NAVI_ASSETS = Object.keys(SUPPORTED_ASSETS);
64211
+ var OPERATION_ASSETS = {
64212
+ save: ["USDC"],
64213
+ borrow: ["USDC"],
64214
+ withdraw: "*",
64215
+ repay: "*",
64216
+ send: "*",
64217
+ swap: "*"
64218
+ };
64219
+ function isAllowedAsset(op, asset) {
64220
+ const allowed = OPERATION_ASSETS[op];
64221
+ if (allowed === "*") return true;
64222
+ return allowed.includes(asset.toUpperCase());
64223
+ }
64224
+ function assertAllowedAsset(op, asset) {
64225
+ if (!asset) return;
64226
+ if (!isAllowedAsset(op, asset)) {
64227
+ const allowed = OPERATION_ASSETS[op];
64228
+ const list = Array.isArray(allowed) ? allowed.join(", ") : "any";
64229
+ throw new T2000Error(
64230
+ "INVALID_ASSET",
64231
+ `${op} only supports ${list}. Cannot use ${asset}.${op === "save" ? " Swap to USDC first." : ""}`
64232
+ );
64233
+ }
64234
+ }
64210
64235
  var T2000_PACKAGE_ID = process.env.T2000_PACKAGE_ID ?? "0xab92e9f1fe549ad3d6a52924a73181b45791e76120b975138fac9ec9b75db9f3";
64211
64236
  var T2000_CONFIG_ID = process.env.T2000_CONFIG_ID ?? "0x408add9aa9322f93cfd87523d8f603006eb8713894f4c460283c58a6888dae8a";
64212
64237
  var T2000_TREASURY_ID = process.env.T2000_TREASURY_ID ?? "0x3bb501b8300125dca59019247941a42af6b292a150ce3cfcce9449456be2ec91";
@@ -66299,9 +66324,7 @@ var T2000 = class _T2000 extends import_index.default {
66299
66324
  // -- Savings --
66300
66325
  async save(params) {
66301
66326
  this.enforcer.assertNotLocked();
66302
- if (params.asset && params.asset !== "USDC") {
66303
- throw new T2000Error("INVALID_ASSET", "Only USDC deposits are supported. Swap to USDC first.");
66304
- }
66327
+ assertAllowedAsset("save", params.asset);
66305
66328
  const asset = "USDC";
66306
66329
  const assetInfo = SUPPORTED_ASSETS[asset];
66307
66330
  let amount;
@@ -67082,6 +67105,9 @@ export {
67082
67105
  SUPPORTED_ASSETS,
67083
67106
  STABLE_ASSETS,
67084
67107
  ALL_NAVI_ASSETS,
67108
+ OPERATION_ASSETS,
67109
+ isAllowedAsset,
67110
+ assertAllowedAsset,
67085
67111
  DEFAULT_NETWORK,
67086
67112
  CETUS_USDC_SUI_POOL,
67087
67113
  GAS_RESERVE_MIN,
@@ -67175,4 +67201,4 @@ axios/dist/node/axios.cjs:
67175
67201
  @scure/bip39/index.js:
67176
67202
  (*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) *)
67177
67203
  */
67178
- //# sourceMappingURL=chunk-FSE25UF3.js.map
67204
+ //# sourceMappingURL=chunk-KLHAR3XK.js.map