@t2000/sdk 1.24.2 → 1.24.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.
- package/dist/adapters/descriptors.cjs +22 -1
- package/dist/adapters/descriptors.cjs.map +1 -1
- package/dist/adapters/descriptors.js +22 -1
- package/dist/adapters/descriptors.js.map +1 -1
- package/dist/adapters/index.cjs +22 -1
- package/dist/adapters/index.cjs.map +1 -1
- package/dist/adapters/index.js +22 -1
- package/dist/adapters/index.js.map +1 -1
- package/dist/browser.cjs +3 -3
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.cts +1 -1
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +3 -3
- package/dist/browser.js.map +1 -1
- package/dist/index.cjs +25 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +25 -4
- package/dist/index.js.map +1 -1
- package/dist/{types-DCb8Xt_q.d.ts → types-D1-rO-J4.d.ts} +10 -3
- package/dist/{types-D03bON1v.d.cts → types-DvNhsBbN.d.cts} +10 -3
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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 { V as TxMetadata, q as SafeguardConfig, T as T2000Error, R as TransactionSigner, a1 as ZkLoginProof, x as SupportedAsset, l as OverlayFeeConfig, y as SwapRouteResult } from './types-
|
|
5
|
-
export { A as ALL_NAVI_ASSETS, B as BORROW_FEE_BPS, a as BPS_DENOMINATOR, aB 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, aC as OPERATION_ASSETS, O as OUTBOUND_OPS, k as OVERLAY_FEE_RATE, aD as Operation, P as ProtocolFeeInfo, S as SAVE_FEE_BPS, m as STABLE_ASSETS, n as SUI_DECIMALS, o as SUI_TYPE, p as SUPPORTED_ASSETS, r as SafeguardError, s as SafeguardErrorDetails, t as SafeguardRule, u as SimulationResult, v as StableAsset, w as SuiRpcTxBlock, z as T2000ErrorCode, H as T2000ErrorData, J as T2000_OVERLAY_FEE_WALLET, Q as TOKEN_MAP, U as TxDirection, W as USDC_DECIMALS, X as USDC_TYPE, Y as USDE_TYPE, Z as USDSUI_TYPE, _ as USDT_TYPE, $ as WAL_TYPE, a0 as WBTC_TYPE, a2 as ZkLoginSigner, a3 as addFeeTransfer, aE as addSwapToTx, aF as assertAllowedAsset, a4 as buildSwapTx, a5 as calculateFee, a6 as classifyAction, a7 as classifyLabel, a8 as classifyTransaction, a9 as extractTransferDetails, aa as extractTxCommands, ab as extractTxSender, ac as fallbackLabel, ad as findSwapRoute, ae as formatAssetAmount, af as formatSui, ag as formatUsd, aG as getCoinMeta, ah as getDecimals, ai as getDecimalsForCoinType, aj as getTier, aH as isAllowedAsset, aI as isInRegistry, ak as isSupported, al as isTier1, am as isTier2, an as mapMoveAbortCode, ao as mapWalletError, ap as mistToSui, aJ as normalizeAsset, aK as normalizeCoinType, aq as parseSuiRpcTx, aL as queryHistory, aM as queryTransaction, ar as rawToStable, as as rawToUsdc, at as refineLendingLabel, au as resolveSymbol, av as resolveTokenType, aN as simulateTransaction, aw as stableToRaw, ax as suiToMist, aO as throwIfSimulationFailed, ay as truncateAddress, az as usdcToRaw, aA as validateAddress } from './types-
|
|
4
|
+
import { V as TxMetadata, q as SafeguardConfig, T as T2000Error, R as TransactionSigner, a1 as ZkLoginProof, x as SupportedAsset, l as OverlayFeeConfig, y as SwapRouteResult } from './types-DvNhsBbN.cjs';
|
|
5
|
+
export { A as ALL_NAVI_ASSETS, B as BORROW_FEE_BPS, a as BPS_DENOMINATOR, aB 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, aC as OPERATION_ASSETS, O as OUTBOUND_OPS, k as OVERLAY_FEE_RATE, aD as Operation, P as ProtocolFeeInfo, S as SAVE_FEE_BPS, m as STABLE_ASSETS, n as SUI_DECIMALS, o as SUI_TYPE, p as SUPPORTED_ASSETS, r as SafeguardError, s as SafeguardErrorDetails, t as SafeguardRule, u as SimulationResult, v as StableAsset, w as SuiRpcTxBlock, z as T2000ErrorCode, H as T2000ErrorData, J as T2000_OVERLAY_FEE_WALLET, Q as TOKEN_MAP, U as TxDirection, W as USDC_DECIMALS, X as USDC_TYPE, Y as USDE_TYPE, Z as USDSUI_TYPE, _ as USDT_TYPE, $ as WAL_TYPE, a0 as WBTC_TYPE, a2 as ZkLoginSigner, a3 as addFeeTransfer, aE as addSwapToTx, aF as assertAllowedAsset, a4 as buildSwapTx, a5 as calculateFee, a6 as classifyAction, a7 as classifyLabel, a8 as classifyTransaction, a9 as extractTransferDetails, aa as extractTxCommands, ab as extractTxSender, ac as fallbackLabel, ad as findSwapRoute, ae as formatAssetAmount, af as formatSui, ag as formatUsd, aG as getCoinMeta, ah as getDecimals, ai as getDecimalsForCoinType, aj as getTier, aH as isAllowedAsset, aI as isInRegistry, ak as isSupported, al as isTier1, am as isTier2, an as mapMoveAbortCode, ao as mapWalletError, ap as mistToSui, aJ as normalizeAsset, aK as normalizeCoinType, aq as parseSuiRpcTx, aL as queryHistory, aM as queryTransaction, ar as rawToStable, as as rawToUsdc, at as refineLendingLabel, au as resolveSymbol, av as resolveTokenType, aN as simulateTransaction, aw as stableToRaw, ax as suiToMist, aO as throwIfSimulationFailed, ay as truncateAddress, az as usdcToRaw, aA as validateAddress } from './types-DvNhsBbN.cjs';
|
|
6
6
|
import { L as LendingAdapter, a as LendingRates, P as PendingReward$1 } from './descriptors-BnbL3xN8.cjs';
|
|
7
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';
|
|
8
8
|
import { i as T2000Options, P as PayOptions, c as PayResult, j as StakeVSuiResult, U as UnstakeVSuiResult, k as SwapResult, l as SwapQuoteResult, h as SendResult, B as BalanceResponse, T as TransactionRecord, D as DepositInfo, m as PaymentRequest, S as SaveResult, W as WithdrawResult, b as MaxWithdrawResult, a as BorrowResult, g as RepayResult, M as MaxBorrowResult, H as HealthFactorResult, d as PendingReward, C as ClaimRewardsResult, n as CompoundRewardsResult, f as PositionsResult, R as RatesResult, E as EarningsResult, F as FundStatusResult, o as FinancialSummary } from './types-jAD-e7Pq.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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 { V as TxMetadata, q as SafeguardConfig, T as T2000Error, R as TransactionSigner, a1 as ZkLoginProof, x as SupportedAsset, l as OverlayFeeConfig, y as SwapRouteResult } from './types-
|
|
5
|
-
export { A as ALL_NAVI_ASSETS, B as BORROW_FEE_BPS, a as BPS_DENOMINATOR, aB 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, aC as OPERATION_ASSETS, O as OUTBOUND_OPS, k as OVERLAY_FEE_RATE, aD as Operation, P as ProtocolFeeInfo, S as SAVE_FEE_BPS, m as STABLE_ASSETS, n as SUI_DECIMALS, o as SUI_TYPE, p as SUPPORTED_ASSETS, r as SafeguardError, s as SafeguardErrorDetails, t as SafeguardRule, u as SimulationResult, v as StableAsset, w as SuiRpcTxBlock, z as T2000ErrorCode, H as T2000ErrorData, J as T2000_OVERLAY_FEE_WALLET, Q as TOKEN_MAP, U as TxDirection, W as USDC_DECIMALS, X as USDC_TYPE, Y as USDE_TYPE, Z as USDSUI_TYPE, _ as USDT_TYPE, $ as WAL_TYPE, a0 as WBTC_TYPE, a2 as ZkLoginSigner, a3 as addFeeTransfer, aE as addSwapToTx, aF as assertAllowedAsset, a4 as buildSwapTx, a5 as calculateFee, a6 as classifyAction, a7 as classifyLabel, a8 as classifyTransaction, a9 as extractTransferDetails, aa as extractTxCommands, ab as extractTxSender, ac as fallbackLabel, ad as findSwapRoute, ae as formatAssetAmount, af as formatSui, ag as formatUsd, aG as getCoinMeta, ah as getDecimals, ai as getDecimalsForCoinType, aj as getTier, aH as isAllowedAsset, aI as isInRegistry, ak as isSupported, al as isTier1, am as isTier2, an as mapMoveAbortCode, ao as mapWalletError, ap as mistToSui, aJ as normalizeAsset, aK as normalizeCoinType, aq as parseSuiRpcTx, aL as queryHistory, aM as queryTransaction, ar as rawToStable, as as rawToUsdc, at as refineLendingLabel, au as resolveSymbol, av as resolveTokenType, aN as simulateTransaction, aw as stableToRaw, ax as suiToMist, aO as throwIfSimulationFailed, ay as truncateAddress, az as usdcToRaw, aA as validateAddress } from './types-
|
|
4
|
+
import { V as TxMetadata, q as SafeguardConfig, T as T2000Error, R as TransactionSigner, a1 as ZkLoginProof, x as SupportedAsset, l as OverlayFeeConfig, y as SwapRouteResult } from './types-D1-rO-J4.js';
|
|
5
|
+
export { A as ALL_NAVI_ASSETS, B as BORROW_FEE_BPS, a as BPS_DENOMINATOR, aB 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, aC as OPERATION_ASSETS, O as OUTBOUND_OPS, k as OVERLAY_FEE_RATE, aD as Operation, P as ProtocolFeeInfo, S as SAVE_FEE_BPS, m as STABLE_ASSETS, n as SUI_DECIMALS, o as SUI_TYPE, p as SUPPORTED_ASSETS, r as SafeguardError, s as SafeguardErrorDetails, t as SafeguardRule, u as SimulationResult, v as StableAsset, w as SuiRpcTxBlock, z as T2000ErrorCode, H as T2000ErrorData, J as T2000_OVERLAY_FEE_WALLET, Q as TOKEN_MAP, U as TxDirection, W as USDC_DECIMALS, X as USDC_TYPE, Y as USDE_TYPE, Z as USDSUI_TYPE, _ as USDT_TYPE, $ as WAL_TYPE, a0 as WBTC_TYPE, a2 as ZkLoginSigner, a3 as addFeeTransfer, aE as addSwapToTx, aF as assertAllowedAsset, a4 as buildSwapTx, a5 as calculateFee, a6 as classifyAction, a7 as classifyLabel, a8 as classifyTransaction, a9 as extractTransferDetails, aa as extractTxCommands, ab as extractTxSender, ac as fallbackLabel, ad as findSwapRoute, ae as formatAssetAmount, af as formatSui, ag as formatUsd, aG as getCoinMeta, ah as getDecimals, ai as getDecimalsForCoinType, aj as getTier, aH as isAllowedAsset, aI as isInRegistry, ak as isSupported, al as isTier1, am as isTier2, an as mapMoveAbortCode, ao as mapWalletError, ap as mistToSui, aJ as normalizeAsset, aK as normalizeCoinType, aq as parseSuiRpcTx, aL as queryHistory, aM as queryTransaction, ar as rawToStable, as as rawToUsdc, at as refineLendingLabel, au as resolveSymbol, av as resolveTokenType, aN as simulateTransaction, aw as stableToRaw, ax as suiToMist, aO as throwIfSimulationFailed, ay as truncateAddress, az as usdcToRaw, aA as validateAddress } from './types-D1-rO-J4.js';
|
|
6
6
|
import { L as LendingAdapter, a as LendingRates, P as PendingReward$1 } from './descriptors-BnbL3xN8.js';
|
|
7
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';
|
|
8
8
|
import { i as T2000Options, P as PayOptions, c as PayResult, j as StakeVSuiResult, U as UnstakeVSuiResult, k as SwapResult, l as SwapQuoteResult, h as SendResult, B as BalanceResponse, T as TransactionRecord, D as DepositInfo, m as PaymentRequest, S as SaveResult, W as WithdrawResult, b as MaxWithdrawResult, a as BorrowResult, g as RepayResult, M as MaxBorrowResult, H as HealthFactorResult, d as PendingReward, C as ClaimRewardsResult, n as CompoundRewardsResult, f as PositionsResult, R as RatesResult, E as EarningsResult, F as FundStatusResult, o as FinancialSummary } from './types-jAD-e7Pq.js';
|
package/dist/index.js
CHANGED
|
@@ -5886,14 +5886,35 @@ var naviDescriptor = {
|
|
|
5886
5886
|
packages: [],
|
|
5887
5887
|
dynamicPackageId: true,
|
|
5888
5888
|
actionMap: {
|
|
5889
|
+
// Deposit variants (entry_deposit / deposit + account-cap form for
|
|
5890
|
+
// harvest's internal save leg)
|
|
5889
5891
|
"incentive_v3::entry_deposit": "save",
|
|
5890
5892
|
"incentive_v3::deposit": "save",
|
|
5893
|
+
"incentive_v3::deposit_with_account_cap": "save",
|
|
5894
|
+
// Withdraw variants
|
|
5891
5895
|
"incentive_v3::withdraw_v2": "withdraw",
|
|
5892
5896
|
"incentive_v3::entry_withdraw": "withdraw",
|
|
5897
|
+
"incentive_v3::withdraw_with_account_cap": "withdraw",
|
|
5898
|
+
"incentive_v3::withdraw_with_account_cap_v": "withdraw",
|
|
5899
|
+
"incentive_v3::withdraw": "withdraw",
|
|
5900
|
+
"incentive_v3::withdraw_v": "withdraw",
|
|
5901
|
+
// Borrow variants
|
|
5893
5902
|
"incentive_v3::borrow_v2": "borrow",
|
|
5894
5903
|
"incentive_v3::entry_borrow": "borrow",
|
|
5904
|
+
"incentive_v3::borrow": "borrow",
|
|
5905
|
+
"incentive_v3::borrow_v": "borrow",
|
|
5906
|
+
"incentive_v3::borrow_with_account_cap": "borrow",
|
|
5907
|
+
"incentive_v3::borrow_with_account_cap_v": "borrow",
|
|
5908
|
+
// Repay variants
|
|
5895
5909
|
"incentive_v3::entry_repay": "repay",
|
|
5896
|
-
"incentive_v3::repay": "repay"
|
|
5910
|
+
"incentive_v3::repay": "repay",
|
|
5911
|
+
"incentive_v3::repay_with_account_cap": "repay",
|
|
5912
|
+
// Claim-reward variants — required for `claim_rewards` tagging AND for
|
|
5913
|
+
// `harvest` compound-op detection in the indexer (paired with a save
|
|
5914
|
+
// target, classified as `harvest` instead of `claim`).
|
|
5915
|
+
"incentive_v3::claim_reward": "claim",
|
|
5916
|
+
"incentive_v3::claim_reward_entry": "claim",
|
|
5917
|
+
"incentive_v3::claim_reward_with_account_cap": "claim"
|
|
5897
5918
|
}
|
|
5898
5919
|
};
|
|
5899
5920
|
var allDescriptors = [
|
|
@@ -8014,7 +8035,7 @@ var FEE_RATES = {
|
|
|
8014
8035
|
function calculateFee(operation, amount) {
|
|
8015
8036
|
const bps = FEE_RATES[operation];
|
|
8016
8037
|
const feeAmount = amount * Number(bps) / Number(BPS_DENOMINATOR);
|
|
8017
|
-
const rawAmount =
|
|
8038
|
+
const rawAmount = stableToRaw(feeAmount, USDC_DECIMALS);
|
|
8018
8039
|
return {
|
|
8019
8040
|
amount: feeAmount,
|
|
8020
8041
|
asset: "USDC",
|
|
@@ -8022,11 +8043,11 @@ function calculateFee(operation, amount) {
|
|
|
8022
8043
|
rawAmount
|
|
8023
8044
|
};
|
|
8024
8045
|
}
|
|
8025
|
-
function addFeeTransfer(tx, paymentCoin, feeBps, receiver, amount) {
|
|
8046
|
+
function addFeeTransfer(tx, paymentCoin, feeBps, receiver, amount, decimals = USDC_DECIMALS) {
|
|
8026
8047
|
if (feeBps <= 0n) return;
|
|
8027
8048
|
if (amount <= 0) return;
|
|
8028
8049
|
const feeAmount = amount * Number(feeBps) / Number(BPS_DENOMINATOR);
|
|
8029
|
-
const rawFee =
|
|
8050
|
+
const rawFee = stableToRaw(feeAmount, decimals);
|
|
8030
8051
|
if (rawFee <= 0n) return;
|
|
8031
8052
|
const [feeCoin] = tx.splitCoins(paymentCoin, [tx.pure.u64(rawFee)]);
|
|
8032
8053
|
tx.transferObjects([feeCoin], tx.pure.address(receiver));
|