@t2000/sdk 1.0.0 → 1.0.1
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.d.cts +1 -1
- package/dist/adapters/descriptors.d.ts +1 -1
- package/dist/adapters/index.cjs +25 -12
- package/dist/adapters/index.cjs.map +1 -1
- package/dist/adapters/index.d.cts +13 -5
- package/dist/adapters/index.d.ts +13 -5
- package/dist/adapters/index.js +25 -12
- package/dist/adapters/index.js.map +1 -1
- package/dist/{descriptors-3YmGYl63.d.cts → descriptors-CDVXo3BM.d.cts} +11 -3
- package/dist/{descriptors-3YmGYl63.d.ts → descriptors-CDVXo3BM.d.ts} +11 -3
- package/dist/index.cjs +25 -12
- 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 -12
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -3,8 +3,8 @@ import { SuiJsonRpcClient } from '@mysten/sui/jsonRpc';
|
|
|
3
3
|
import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
|
|
4
4
|
import { z as TxMetadata, m as SafeguardConfig, T as T2000Error, x as TransactionSigner, Z as ZkLoginProof, t as SupportedAsset } from './token-registry-DAHghHh2.cjs';
|
|
5
5
|
export { A as ALL_NAVI_ASSETS, at as BORROW_FEE_BPS, B as BPS_DENOMINATOR, au as CETUS_USDC_SUI_POOL, C as CLOCK_ID, a as COIN_REGISTRY, b as ClassifyBalanceChange, c as ClassifyResult, d as CoinMeta, D as DEFAULT_NETWORK, e as DEFAULT_SAFEGUARD_CONFIG, E as ETH_TYPE, f as ExtractedTransfer, F as FeeOperation, G as GAS_RESERVE_MIN, I as IKA_TYPE, K as KNOWN_TARGETS, g as KeypairSigner, L as LABEL_PATTERNS, h as LOFI_TYPE, M as MANIFEST_TYPE, i as MIST_PER_SUI, N as NAVX_TYPE, av as OPERATION_ASSETS, O as OUTBOUND_OPS, aw as Operation, P as ProtocolFeeInfo, ax as SAVE_FEE_BPS, S as STABLE_ASSETS, j as SUI_DECIMALS, k as SUI_TYPE, l as SUPPORTED_ASSETS, n as SafeguardError, o as SafeguardErrorDetails, p as SafeguardRule, q as SimulationResult, r as StableAsset, s as SuiRpcTxBlock, u as T2000ErrorCode, v as T2000ErrorData, w as TOKEN_MAP, y as TxDirection, U as USDC_DECIMALS, H as USDC_TYPE, J as USDE_TYPE, Q as USDSUI_TYPE, R as USDT_TYPE, W as WAL_TYPE, V as WBTC_TYPE, X as ZkLoginSigner, Y as addCollectFeeToTx, ay as assertAllowedAsset, _ as calculateFee, $ as classifyAction, a0 as classifyLabel, a1 as classifyTransaction, a2 as extractTransferDetails, a3 as extractTxCommands, a4 as extractTxSender, a5 as fallbackLabel, a6 as formatAssetAmount, a7 as formatSui, a8 as formatUsd, a9 as getDecimals, aa as getDecimalsForCoinType, ab as getTier, az as isAllowedAsset, ac as isSupported, ad as isTier1, ae as isTier2, af as mapMoveAbortCode, ag as mapWalletError, ah as mistToSui, aA as normalizeCoinType, ai as parseSuiRpcTx, aB as queryHistory, aC as queryTransaction, aj as rawToStable, ak as rawToUsdc, al as refineLendingLabel, am as resolveSymbol, an as resolveTokenType, aD as simulateTransaction, ao as stableToRaw, ap as suiToMist, aE as throwIfSimulationFailed, aq as truncateAddress, ar as usdcToRaw, as as validateAddress } from './token-registry-DAHghHh2.cjs';
|
|
6
|
-
import { L as LendingAdapter, a as LendingRates, P as PendingReward$1 } from './descriptors-
|
|
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-
|
|
6
|
+
import { L as LendingAdapter, a as LendingRates, P as PendingReward$1 } from './descriptors-CDVXo3BM.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-CDVXo3BM.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';
|
|
9
9
|
export { A as AssetRates, G as GasReserve, p as HFAlertLevel, e as PositionEntry } from './types-jAD-e7Pq.cjs';
|
|
10
10
|
import { RouterDataV3 } from '@cetusprotocol/aggregator-sdk';
|
package/dist/index.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { SuiJsonRpcClient } from '@mysten/sui/jsonRpc';
|
|
|
3
3
|
import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
|
|
4
4
|
import { z as TxMetadata, m as SafeguardConfig, T as T2000Error, x as TransactionSigner, Z as ZkLoginProof, t as SupportedAsset } from './token-registry-CoTPqCbS.js';
|
|
5
5
|
export { A as ALL_NAVI_ASSETS, at as BORROW_FEE_BPS, B as BPS_DENOMINATOR, au as CETUS_USDC_SUI_POOL, C as CLOCK_ID, a as COIN_REGISTRY, b as ClassifyBalanceChange, c as ClassifyResult, d as CoinMeta, D as DEFAULT_NETWORK, e as DEFAULT_SAFEGUARD_CONFIG, E as ETH_TYPE, f as ExtractedTransfer, F as FeeOperation, G as GAS_RESERVE_MIN, I as IKA_TYPE, K as KNOWN_TARGETS, g as KeypairSigner, L as LABEL_PATTERNS, h as LOFI_TYPE, M as MANIFEST_TYPE, i as MIST_PER_SUI, N as NAVX_TYPE, av as OPERATION_ASSETS, O as OUTBOUND_OPS, aw as Operation, P as ProtocolFeeInfo, ax as SAVE_FEE_BPS, S as STABLE_ASSETS, j as SUI_DECIMALS, k as SUI_TYPE, l as SUPPORTED_ASSETS, n as SafeguardError, o as SafeguardErrorDetails, p as SafeguardRule, q as SimulationResult, r as StableAsset, s as SuiRpcTxBlock, u as T2000ErrorCode, v as T2000ErrorData, w as TOKEN_MAP, y as TxDirection, U as USDC_DECIMALS, H as USDC_TYPE, J as USDE_TYPE, Q as USDSUI_TYPE, R as USDT_TYPE, W as WAL_TYPE, V as WBTC_TYPE, X as ZkLoginSigner, Y as addCollectFeeToTx, ay as assertAllowedAsset, _ as calculateFee, $ as classifyAction, a0 as classifyLabel, a1 as classifyTransaction, a2 as extractTransferDetails, a3 as extractTxCommands, a4 as extractTxSender, a5 as fallbackLabel, a6 as formatAssetAmount, a7 as formatSui, a8 as formatUsd, a9 as getDecimals, aa as getDecimalsForCoinType, ab as getTier, az as isAllowedAsset, ac as isSupported, ad as isTier1, ae as isTier2, af as mapMoveAbortCode, ag as mapWalletError, ah as mistToSui, aA as normalizeCoinType, ai as parseSuiRpcTx, aB as queryHistory, aC as queryTransaction, aj as rawToStable, ak as rawToUsdc, al as refineLendingLabel, am as resolveSymbol, an as resolveTokenType, aD as simulateTransaction, ao as stableToRaw, ap as suiToMist, aE as throwIfSimulationFailed, aq as truncateAddress, ar as usdcToRaw, as as validateAddress } from './token-registry-CoTPqCbS.js';
|
|
6
|
-
import { L as LendingAdapter, a as LendingRates, P as PendingReward$1 } from './descriptors-
|
|
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-
|
|
6
|
+
import { L as LendingAdapter, a as LendingRates, P as PendingReward$1 } from './descriptors-CDVXo3BM.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-CDVXo3BM.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';
|
|
9
9
|
export { A as AssetRates, G as GasReserve, p as HFAlertLevel, e as PositionEntry } from './types-jAD-e7Pq.js';
|
|
10
10
|
import { RouterDataV3 } from '@cetusprotocol/aggregator-sdk';
|
package/dist/index.js
CHANGED
|
@@ -5309,7 +5309,7 @@ async function buildWithdrawTx(client, address, amount, options = {}) {
|
|
|
5309
5309
|
}
|
|
5310
5310
|
const tx = new Transaction();
|
|
5311
5311
|
tx.setSender(address);
|
|
5312
|
-
await refreshOracle(tx, client, address);
|
|
5312
|
+
await refreshOracle(tx, client, address, { skipPythUpdate: options.skipPythUpdate });
|
|
5313
5313
|
try {
|
|
5314
5314
|
const coin = await Qe(tx, assetInfo.type, rawAmount, sdkOptions(client));
|
|
5315
5315
|
tx.transferObjects([coin], address);
|
|
@@ -5338,7 +5338,7 @@ async function addWithdrawToTx(tx, client, address, amount, options = {}) {
|
|
|
5338
5338
|
});
|
|
5339
5339
|
return { coin, effectiveAmount: 0 };
|
|
5340
5340
|
}
|
|
5341
|
-
await refreshOracle(tx, client, address);
|
|
5341
|
+
await refreshOracle(tx, client, address, { skipPythUpdate: options.skipPythUpdate });
|
|
5342
5342
|
try {
|
|
5343
5343
|
const coin = await Qe(tx, assetInfo.type, rawAmount, sdkOptions(client));
|
|
5344
5344
|
return { coin, effectiveAmount };
|
|
@@ -5363,7 +5363,7 @@ async function addSaveToTx(tx, _client, _address, coin, options = {}) {
|
|
|
5363
5363
|
async function addRepayToTx(tx, client, address, coin, options = {}) {
|
|
5364
5364
|
const asset = options.asset ?? "USDC";
|
|
5365
5365
|
const assetInfo = resolveAssetInfo(asset);
|
|
5366
|
-
await refreshOracle(tx, client, address);
|
|
5366
|
+
await refreshOracle(tx, client, address, { skipPythUpdate: options.skipPythUpdate });
|
|
5367
5367
|
try {
|
|
5368
5368
|
await xe(tx, assetInfo.type, coin, { env: "prod" });
|
|
5369
5369
|
} catch (err) {
|
|
@@ -5380,7 +5380,7 @@ async function buildBorrowTx(client, address, amount, options = {}) {
|
|
|
5380
5380
|
const rawAmount = Number(stableToRaw(amount, assetInfo.decimals));
|
|
5381
5381
|
const tx = new Transaction();
|
|
5382
5382
|
tx.setSender(address);
|
|
5383
|
-
await refreshOracle(tx, client, address);
|
|
5383
|
+
await refreshOracle(tx, client, address, { skipPythUpdate: options.skipPythUpdate });
|
|
5384
5384
|
try {
|
|
5385
5385
|
const borrowedCoin = await Xe(tx, assetInfo.type, rawAmount, sdkOptions(client));
|
|
5386
5386
|
if (options.collectFee) {
|
|
@@ -5411,7 +5411,10 @@ async function buildRepayTx(client, address, amount, options = {}) {
|
|
|
5411
5411
|
const coinObj = mergeCoins(tx, coins);
|
|
5412
5412
|
const rawAmount = Math.min(rawRequested, Number(totalBalance));
|
|
5413
5413
|
const [repayCoin] = tx.splitCoins(coinObj, [rawAmount]);
|
|
5414
|
-
await refreshOracle(tx, client, address, {
|
|
5414
|
+
await refreshOracle(tx, client, address, {
|
|
5415
|
+
skipOracle: options.skipOracle,
|
|
5416
|
+
skipPythUpdate: options.skipPythUpdate
|
|
5417
|
+
});
|
|
5415
5418
|
try {
|
|
5416
5419
|
await xe(tx, assetInfo.type, repayCoin, {
|
|
5417
5420
|
...sdkOptions(client),
|
|
@@ -5722,9 +5725,12 @@ var NaviAdapter = class {
|
|
|
5722
5725
|
const tx = await buildSaveTx(this.client, address, amount, { ...options, asset: normalized });
|
|
5723
5726
|
return { tx };
|
|
5724
5727
|
}
|
|
5725
|
-
async buildWithdrawTx(address, amount, asset) {
|
|
5728
|
+
async buildWithdrawTx(address, amount, asset, options) {
|
|
5726
5729
|
const normalized = normalizeAsset(asset);
|
|
5727
|
-
const result = await buildWithdrawTx(this.client, address, amount, {
|
|
5730
|
+
const result = await buildWithdrawTx(this.client, address, amount, {
|
|
5731
|
+
asset: normalized,
|
|
5732
|
+
skipPythUpdate: options?.skipPythUpdate
|
|
5733
|
+
});
|
|
5728
5734
|
return { tx: result.tx, effectiveAmount: result.effectiveAmount };
|
|
5729
5735
|
}
|
|
5730
5736
|
async buildBorrowTx(address, amount, asset, options) {
|
|
@@ -5736,7 +5742,8 @@ var NaviAdapter = class {
|
|
|
5736
5742
|
const normalized = normalizeAsset(asset);
|
|
5737
5743
|
const tx = await buildRepayTx(this.client, address, amount, {
|
|
5738
5744
|
asset: normalized,
|
|
5739
|
-
skipOracle: options?.skipOracle
|
|
5745
|
+
skipOracle: options?.skipOracle,
|
|
5746
|
+
skipPythUpdate: options?.skipPythUpdate
|
|
5740
5747
|
});
|
|
5741
5748
|
return { tx };
|
|
5742
5749
|
}
|
|
@@ -5746,17 +5753,23 @@ var NaviAdapter = class {
|
|
|
5746
5753
|
async maxBorrow(address, _asset) {
|
|
5747
5754
|
return maxBorrowAmount(this.client, address);
|
|
5748
5755
|
}
|
|
5749
|
-
async addWithdrawToTx(tx, address, amount, asset) {
|
|
5756
|
+
async addWithdrawToTx(tx, address, amount, asset, options) {
|
|
5750
5757
|
const normalized = normalizeAsset(asset);
|
|
5751
|
-
return addWithdrawToTx(tx, this.client, address, amount, {
|
|
5758
|
+
return addWithdrawToTx(tx, this.client, address, amount, {
|
|
5759
|
+
asset: normalized,
|
|
5760
|
+
skipPythUpdate: options?.skipPythUpdate
|
|
5761
|
+
});
|
|
5752
5762
|
}
|
|
5753
5763
|
async addSaveToTx(tx, address, coin, asset, options) {
|
|
5754
5764
|
const normalized = normalizeAsset(asset);
|
|
5755
5765
|
return addSaveToTx(tx, this.client, address, coin, { ...options, asset: normalized });
|
|
5756
5766
|
}
|
|
5757
|
-
async addRepayToTx(tx, address, coin, asset) {
|
|
5767
|
+
async addRepayToTx(tx, address, coin, asset, options) {
|
|
5758
5768
|
const normalized = normalizeAsset(asset);
|
|
5759
|
-
return addRepayToTx(tx, this.client, address, coin, {
|
|
5769
|
+
return addRepayToTx(tx, this.client, address, coin, {
|
|
5770
|
+
asset: normalized,
|
|
5771
|
+
skipPythUpdate: options?.skipPythUpdate
|
|
5772
|
+
});
|
|
5760
5773
|
}
|
|
5761
5774
|
async getPendingRewards(address) {
|
|
5762
5775
|
return getPendingRewards(this.client, address);
|