@t2000/sdk 2.11.1 → 2.13.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.
package/dist/index.d.cts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { EventEmitter } from 'eventemitter3';
2
2
  import { SuiJsonRpcClient } from '@mysten/sui/jsonRpc';
3
3
  import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
4
- import { Q as TxMetadata, o as SafeguardConfig, T as T2000Error, H as TransactionSigner, _ as ZkLoginProof, v as SupportedAsset } from './types-DmXSwjQ1.cjs';
5
- export { A as ALL_NAVI_ASSETS, B as BORROW_FEE_BPS, a as BPS_DENOMINATOR, ax as CETUS_USDC_SUI_POOL, C as CLOCK_ID, b as COIN_REGISTRY, c as ClassifyBalanceChange, d as ClassifyResult, e as CoinMeta, D as DEFAULT_NETWORK, f as DEFAULT_SAFEGUARD_CONFIG, E as ETH_TYPE, g as ExtractedTransfer, F as FeeOperation, G as GAS_RESERVE_MIN, I as IKA_TYPE, K as KNOWN_TARGETS, h as KeypairSigner, L as LABEL_PATTERNS, i as LOFI_TYPE, M as MANIFEST_TYPE, j as MIST_PER_SUI, N as NAVX_TYPE, ay as OPERATION_ASSETS, O as OUTBOUND_OPS, az as Operation, P as ProtocolFeeInfo, S as SAVE_FEE_BPS, k as STABLE_ASSETS, l as SUI_DECIMALS, m as SUI_TYPE, n as SUPPORTED_ASSETS, p as SafeguardError, q as SafeguardErrorDetails, r as SafeguardRule, s as SimulationResult, t as StableAsset, u as SuiRpcTxBlock, w as T2000ErrorCode, x as T2000ErrorData, y as T2000_OVERLAY_FEE_WALLET, z as TOKEN_MAP, J as TxDirection, U as USDC_DECIMALS, R as USDC_TYPE, V as USDE_TYPE, W as USDSUI_TYPE, X as USDT_TYPE, Y as WAL_TYPE, Z as WBTC_TYPE, $ as ZkLoginSigner, a0 as addFeeTransfer, aA as assertAllowedAsset, a1 as calculateFee, a2 as classifyAction, a3 as classifyLabel, a4 as classifyTransaction, a5 as extractAllUserLegs, a6 as extractTransferDetails, a7 as extractTxCommands, a8 as extractTxSender, a9 as fallbackLabel, aa as formatAssetAmount, ab as formatSui, ac as formatUsd, aB as getCoinMeta, ad as getDecimals, ae as getDecimalsForCoinType, af as getTier, aC as isAllowedAsset, aD as isInRegistry, ag as isSupported, ah as isTier1, ai as isTier2, aj as mapMoveAbortCode, ak as mapWalletError, al as mistToSui, aE as normalizeAsset, aF as normalizeCoinType, am as parseSuiRpcTx, aG as queryHistory, aH as queryTransaction, an as rawToStable, ao as rawToUsdc, ap as refineLendingLabel, aq as resolveSymbol, ar as resolveTokenType, aI as simulateTransaction, as as stableToRaw, at as suiToMist, aJ as throwIfSimulationFailed, au as truncateAddress, av as usdcToRaw, aw as validateAddress } from './types-DmXSwjQ1.cjs';
6
- import { L as LendingAdapter, a as LendingRates, P as PendingReward$1 } from './descriptors-BnbL3xN8.cjs';
7
- export { A as AdapterCapability, b as AdapterPositions, c as AdapterTxResult, H as HealthInfo, d as ProtocolDescriptor, e as allDescriptors, n as naviDescriptor } from './descriptors-BnbL3xN8.cjs';
4
+ import { Q as TxMetadata, o as SafeguardConfig, T as T2000Error, H as TransactionSigner, _ as ZkLoginProof, v as SupportedAsset } from './types-BY6ovQGK.cjs';
5
+ export { A as ALL_NAVI_ASSETS, B as BORROW_FEE_BPS, a as BPS_DENOMINATOR, ax as CETUS_USDC_SUI_POOL, C as CLOCK_ID, b as COIN_REGISTRY, c as ClassifyBalanceChange, d as ClassifyResult, e as CoinMeta, D as DEFAULT_NETWORK, f as DEFAULT_SAFEGUARD_CONFIG, E as ETH_TYPE, g as ExtractedTransfer, F as FeeOperation, G as GAS_RESERVE_MIN, I as IKA_TYPE, K as KNOWN_TARGETS, h as KeypairSigner, L as LABEL_PATTERNS, i as LOFI_TYPE, M as MANIFEST_TYPE, j as MIST_PER_SUI, N as NAVX_TYPE, ay as OPERATION_ASSETS, O as OUTBOUND_OPS, az as Operation, P as ProtocolFeeInfo, S as SAVE_FEE_BPS, k as STABLE_ASSETS, l as SUI_DECIMALS, m as SUI_TYPE, n as SUPPORTED_ASSETS, p as SafeguardError, q as SafeguardErrorDetails, r as SafeguardRule, s as SimulationResult, t as StableAsset, u as SuiRpcTxBlock, w as T2000ErrorCode, x as T2000ErrorData, y as T2000_OVERLAY_FEE_WALLET, z as TOKEN_MAP, J as TxDirection, U as USDC_DECIMALS, R as USDC_TYPE, V as USDE_TYPE, W as USDSUI_TYPE, X as USDT_TYPE, Y as WAL_TYPE, Z as WBTC_TYPE, $ as ZkLoginSigner, a0 as addFeeTransfer, aA as assertAllowedAsset, a1 as calculateFee, a2 as classifyAction, a3 as classifyLabel, a4 as classifyTransaction, a5 as extractAllUserLegs, a6 as extractTransferDetails, a7 as extractTxCommands, a8 as extractTxSender, a9 as fallbackLabel, aa as formatAssetAmount, ab as formatSui, ac as formatUsd, aB as getCoinMeta, ad as getDecimals, ae as getDecimalsForCoinType, af as getTier, aC as isAllowedAsset, aD as isInRegistry, ag as isSupported, ah as isTier1, ai as isTier2, aj as mapMoveAbortCode, ak as mapWalletError, al as mistToSui, aE as normalizeAsset, aF as normalizeCoinType, am as parseSuiRpcTx, aG as queryHistory, aH as queryTransaction, an as rawToStable, ao as rawToUsdc, ap as refineLendingLabel, aq as resolveSymbol, ar as resolveTokenType, aI as simulateTransaction, as as stableToRaw, at as suiToMist, aJ as throwIfSimulationFailed, au as truncateAddress, av as usdcToRaw, aw as validateAddress } from './types-BY6ovQGK.cjs';
6
+ import { L as LendingAdapter, a as LendingRates, P as PendingReward$1 } from './descriptors-DqIb4AnV.cjs';
7
+ export { A as AdapterCapability, b as AdapterPositions, c as AdapterTxResult, H as HealthInfo, d as ProtocolDescriptor, e as allDescriptors, n as naviDescriptor } from './descriptors-DqIb4AnV.cjs';
8
8
  import { n as T2000Options, P as PayOptions, d as PayResult, o as StakeVSuiResult, U as UnstakeVSuiResult, p as SwapResult, q as SwapQuoteResult, i as SendResult, B as BalanceResponse, k as TransactionRecord, D as DepositInfo, r as PaymentRequest, S as SaveResult, W as WithdrawResult, b as MaxWithdrawResult, a as BorrowResult, h as RepayResult, M as MaxBorrowResult, H as HealthFactorResult, e as PendingReward, C as ClaimRewardsResult, s as CompoundRewardsResult, g as PositionsResult, R as RatesResult, E as EarningsResult, F as FundStatusResult, c as OverlayFeeConfig, j as SwapRouteResult, t as FinancialSummary } from './types-epj9U13o.cjs';
9
9
  export { A as AssetRates, G as GasReserve, u as HFAlertLevel, O as OVERLAY_FEE_RATE, f as PositionEntry, v as SerializedCetusRoute, w as SerializedCetusRoutePath, x as SerializedRouterDataV3, T as TransactionLeg, y as addSwapToTx, l as buildSwapTx, z as deserializeCetusRoute, m as findSwapRoute, I as isCetusRouteFresh, J as serializeCetusRoute, K as verifyCetusRouteCoinMatch } from './types-epj9U13o.cjs';
10
10
  import { Transaction, TransactionObjectArgument } from '@mysten/sui/transactions';
@@ -437,8 +437,6 @@ declare function selectSuiCoin(tx: Transaction, client: SuiJsonRpcClient, owner:
437
437
  * (Track B 2026-05-08 added `harvest_rewards`).
438
438
  *
439
439
  * Excluded by design:
440
- * - `pay_api` — recipient/amount unknown at compose time; the on-chain
441
- * leg uses `send_transfer` after the gateway 402 challenge resolves.
442
440
  * - `save_contact` — no on-chain leg (Prisma-only).
443
441
  */
444
442
  type WriteToolName = 'save_deposit' | 'withdraw' | 'borrow' | 'repay_debt' | 'send_transfer' | 'swap_execute' | 'claim_rewards' | 'harvest_rewards' | 'volo_stake' | 'volo_unstake';
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { EventEmitter } from 'eventemitter3';
2
2
  import { SuiJsonRpcClient } from '@mysten/sui/jsonRpc';
3
3
  import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
4
- import { Q as TxMetadata, o as SafeguardConfig, T as T2000Error, H as TransactionSigner, _ as ZkLoginProof, v as SupportedAsset } from './types-CvBZ1IrA.js';
5
- export { A as ALL_NAVI_ASSETS, B as BORROW_FEE_BPS, a as BPS_DENOMINATOR, ax as CETUS_USDC_SUI_POOL, C as CLOCK_ID, b as COIN_REGISTRY, c as ClassifyBalanceChange, d as ClassifyResult, e as CoinMeta, D as DEFAULT_NETWORK, f as DEFAULT_SAFEGUARD_CONFIG, E as ETH_TYPE, g as ExtractedTransfer, F as FeeOperation, G as GAS_RESERVE_MIN, I as IKA_TYPE, K as KNOWN_TARGETS, h as KeypairSigner, L as LABEL_PATTERNS, i as LOFI_TYPE, M as MANIFEST_TYPE, j as MIST_PER_SUI, N as NAVX_TYPE, ay as OPERATION_ASSETS, O as OUTBOUND_OPS, az as Operation, P as ProtocolFeeInfo, S as SAVE_FEE_BPS, k as STABLE_ASSETS, l as SUI_DECIMALS, m as SUI_TYPE, n as SUPPORTED_ASSETS, p as SafeguardError, q as SafeguardErrorDetails, r as SafeguardRule, s as SimulationResult, t as StableAsset, u as SuiRpcTxBlock, w as T2000ErrorCode, x as T2000ErrorData, y as T2000_OVERLAY_FEE_WALLET, z as TOKEN_MAP, J as TxDirection, U as USDC_DECIMALS, R as USDC_TYPE, V as USDE_TYPE, W as USDSUI_TYPE, X as USDT_TYPE, Y as WAL_TYPE, Z as WBTC_TYPE, $ as ZkLoginSigner, a0 as addFeeTransfer, aA as assertAllowedAsset, a1 as calculateFee, a2 as classifyAction, a3 as classifyLabel, a4 as classifyTransaction, a5 as extractAllUserLegs, a6 as extractTransferDetails, a7 as extractTxCommands, a8 as extractTxSender, a9 as fallbackLabel, aa as formatAssetAmount, ab as formatSui, ac as formatUsd, aB as getCoinMeta, ad as getDecimals, ae as getDecimalsForCoinType, af as getTier, aC as isAllowedAsset, aD as isInRegistry, ag as isSupported, ah as isTier1, ai as isTier2, aj as mapMoveAbortCode, ak as mapWalletError, al as mistToSui, aE as normalizeAsset, aF as normalizeCoinType, am as parseSuiRpcTx, aG as queryHistory, aH as queryTransaction, an as rawToStable, ao as rawToUsdc, ap as refineLendingLabel, aq as resolveSymbol, ar as resolveTokenType, aI as simulateTransaction, as as stableToRaw, at as suiToMist, aJ as throwIfSimulationFailed, au as truncateAddress, av as usdcToRaw, aw as validateAddress } from './types-CvBZ1IrA.js';
6
- import { L as LendingAdapter, a as LendingRates, P as PendingReward$1 } from './descriptors-BnbL3xN8.js';
7
- export { A as AdapterCapability, b as AdapterPositions, c as AdapterTxResult, H as HealthInfo, d as ProtocolDescriptor, e as allDescriptors, n as naviDescriptor } from './descriptors-BnbL3xN8.js';
4
+ import { Q as TxMetadata, o as SafeguardConfig, T as T2000Error, H as TransactionSigner, _ as ZkLoginProof, v as SupportedAsset } from './types-WeZQDV54.js';
5
+ export { A as ALL_NAVI_ASSETS, B as BORROW_FEE_BPS, a as BPS_DENOMINATOR, ax as CETUS_USDC_SUI_POOL, C as CLOCK_ID, b as COIN_REGISTRY, c as ClassifyBalanceChange, d as ClassifyResult, e as CoinMeta, D as DEFAULT_NETWORK, f as DEFAULT_SAFEGUARD_CONFIG, E as ETH_TYPE, g as ExtractedTransfer, F as FeeOperation, G as GAS_RESERVE_MIN, I as IKA_TYPE, K as KNOWN_TARGETS, h as KeypairSigner, L as LABEL_PATTERNS, i as LOFI_TYPE, M as MANIFEST_TYPE, j as MIST_PER_SUI, N as NAVX_TYPE, ay as OPERATION_ASSETS, O as OUTBOUND_OPS, az as Operation, P as ProtocolFeeInfo, S as SAVE_FEE_BPS, k as STABLE_ASSETS, l as SUI_DECIMALS, m as SUI_TYPE, n as SUPPORTED_ASSETS, p as SafeguardError, q as SafeguardErrorDetails, r as SafeguardRule, s as SimulationResult, t as StableAsset, u as SuiRpcTxBlock, w as T2000ErrorCode, x as T2000ErrorData, y as T2000_OVERLAY_FEE_WALLET, z as TOKEN_MAP, J as TxDirection, U as USDC_DECIMALS, R as USDC_TYPE, V as USDE_TYPE, W as USDSUI_TYPE, X as USDT_TYPE, Y as WAL_TYPE, Z as WBTC_TYPE, $ as ZkLoginSigner, a0 as addFeeTransfer, aA as assertAllowedAsset, a1 as calculateFee, a2 as classifyAction, a3 as classifyLabel, a4 as classifyTransaction, a5 as extractAllUserLegs, a6 as extractTransferDetails, a7 as extractTxCommands, a8 as extractTxSender, a9 as fallbackLabel, aa as formatAssetAmount, ab as formatSui, ac as formatUsd, aB as getCoinMeta, ad as getDecimals, ae as getDecimalsForCoinType, af as getTier, aC as isAllowedAsset, aD as isInRegistry, ag as isSupported, ah as isTier1, ai as isTier2, aj as mapMoveAbortCode, ak as mapWalletError, al as mistToSui, aE as normalizeAsset, aF as normalizeCoinType, am as parseSuiRpcTx, aG as queryHistory, aH as queryTransaction, an as rawToStable, ao as rawToUsdc, ap as refineLendingLabel, aq as resolveSymbol, ar as resolveTokenType, aI as simulateTransaction, as as stableToRaw, at as suiToMist, aJ as throwIfSimulationFailed, au as truncateAddress, av as usdcToRaw, aw as validateAddress } from './types-WeZQDV54.js';
6
+ import { L as LendingAdapter, a as LendingRates, P as PendingReward$1 } from './descriptors-DqIb4AnV.js';
7
+ export { A as AdapterCapability, b as AdapterPositions, c as AdapterTxResult, H as HealthInfo, d as ProtocolDescriptor, e as allDescriptors, n as naviDescriptor } from './descriptors-DqIb4AnV.js';
8
8
  import { n as T2000Options, P as PayOptions, d as PayResult, o as StakeVSuiResult, U as UnstakeVSuiResult, p as SwapResult, q as SwapQuoteResult, i as SendResult, B as BalanceResponse, k as TransactionRecord, D as DepositInfo, r as PaymentRequest, S as SaveResult, W as WithdrawResult, b as MaxWithdrawResult, a as BorrowResult, h as RepayResult, M as MaxBorrowResult, H as HealthFactorResult, e as PendingReward, C as ClaimRewardsResult, s as CompoundRewardsResult, g as PositionsResult, R as RatesResult, E as EarningsResult, F as FundStatusResult, c as OverlayFeeConfig, j as SwapRouteResult, t as FinancialSummary } from './types-epj9U13o.js';
9
9
  export { A as AssetRates, G as GasReserve, u as HFAlertLevel, O as OVERLAY_FEE_RATE, f as PositionEntry, v as SerializedCetusRoute, w as SerializedCetusRoutePath, x as SerializedRouterDataV3, T as TransactionLeg, y as addSwapToTx, l as buildSwapTx, z as deserializeCetusRoute, m as findSwapRoute, I as isCetusRouteFresh, J as serializeCetusRoute, K as verifyCetusRouteCoinMatch } from './types-epj9U13o.js';
10
10
  import { Transaction, TransactionObjectArgument } from '@mysten/sui/transactions';
@@ -437,8 +437,6 @@ declare function selectSuiCoin(tx: Transaction, client: SuiJsonRpcClient, owner:
437
437
  * (Track B 2026-05-08 added `harvest_rewards`).
438
438
  *
439
439
  * Excluded by design:
440
- * - `pay_api` — recipient/amount unknown at compose time; the on-chain
441
- * leg uses `send_transfer` after the gateway 402 challenge resolves.
442
440
  * - `save_contact` — no on-chain leg (Prisma-only).
443
441
  */
444
442
  type WriteToolName = 'save_deposit' | 'withdraw' | 'borrow' | 'repay_debt' | 'send_transfer' | 'swap_execute' | 'claim_rewards' | 'harvest_rewards' | 'volo_stake' | 'volo_unstake';
package/dist/index.js CHANGED
@@ -1417,6 +1417,9 @@ var KeypairSigner = class {
1417
1417
  async signTransaction(txBytes) {
1418
1418
  return this.keypair.signTransaction(txBytes);
1419
1419
  }
1420
+ async signPersonalMessage(messageBytes) {
1421
+ return this.keypair.signPersonalMessage(messageBytes);
1422
+ }
1420
1423
  /** Access the underlying keypair for APIs that still require it directly. */
1421
1424
  getKeypair() {
1422
1425
  return this.keypair;
@@ -1445,6 +1448,9 @@ var ZkLoginSigner = class {
1445
1448
  })
1446
1449
  };
1447
1450
  }
1451
+ async signPersonalMessage(_messageBytes) {
1452
+ throw new Error("ZkLoginSigner.signPersonalMessage is not yet implemented. Use KeypairSigner for sdk.pay() until grief-protection signing is wired for zkLogin.");
1453
+ }
1448
1454
  isExpired(currentEpoch) {
1449
1455
  return currentEpoch >= this.maxEpoch;
1450
1456
  }
@@ -6507,7 +6513,7 @@ var T2000 = class _T2000 extends EventEmitter {
6507
6513
  this.enforcer.assertNotLocked();
6508
6514
  this.enforcer.check({ operation: "pay", amount: options.maxPrice ?? 1 });
6509
6515
  const { Mppx } = await import('mppx/client');
6510
- const { sui } = await import('@suimpp/mpp/client');
6516
+ const { sui, USDC } = await import('@suimpp/mpp/client');
6511
6517
  const client = this.client;
6512
6518
  const signer = this._signer;
6513
6519
  const signerAddress = signer.getAddress();
@@ -6515,10 +6521,14 @@ var T2000 = class _T2000 extends EventEmitter {
6515
6521
  polyfill: false,
6516
6522
  methods: [sui({
6517
6523
  client,
6518
- signer: { toSuiAddress: () => signerAddress },
6524
+ currency: USDC,
6525
+ signer: {
6526
+ toSuiAddress: () => signerAddress,
6527
+ signPersonalMessage: (bytes) => signer.signPersonalMessage(bytes)
6528
+ },
6519
6529
  execute: async (tx) => {
6520
6530
  const result = await executeTx(client, signer, () => tx);
6521
- return { digest: result.digest, effects: result.effects };
6531
+ return { digest: result.digest };
6522
6532
  }
6523
6533
  })]
6524
6534
  });