@t2000/sdk 0.56.2 → 1.0.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/README.md +8 -25
- package/dist/adapters/descriptors.d.cts +1 -1
- package/dist/adapters/descriptors.d.ts +1 -1
- package/dist/adapters/index.cjs +7 -15
- package/dist/adapters/index.cjs.map +1 -1
- package/dist/adapters/index.d.cts +4 -9
- package/dist/adapters/index.d.ts +4 -9
- package/dist/adapters/index.js +7 -15
- package/dist/adapters/index.js.map +1 -1
- package/dist/browser.cjs +14 -335
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.cts +2 -2
- package/dist/browser.d.ts +2 -2
- package/dist/browser.js +15 -332
- package/dist/browser.js.map +1 -1
- package/dist/{descriptors-DkKhitk_.d.cts → descriptors-3YmGYl63.d.cts} +1 -6
- package/dist/{descriptors-DkKhitk_.d.ts → descriptors-3YmGYl63.d.ts} +1 -6
- package/dist/index.cjs +54 -434
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +24 -20
- package/dist/index.d.ts +24 -20
- package/dist/index.js +56 -431
- package/dist/index.js.map +1 -1
- package/dist/{token-registry-BortlMRr.d.ts → token-registry-CoTPqCbS.d.ts} +19 -84
- package/dist/{token-registry-DWRdYf6m.d.cts → token-registry-DAHghHh2.d.cts} +19 -84
- package/dist/{types-DVVns7_w.d.cts → types-jAD-e7Pq.d.cts} +1 -14
- package/dist/{types-DVVns7_w.d.ts → types-jAD-e7Pq.d.ts} +1 -14
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,16 +1,33 @@
|
|
|
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 {
|
|
5
|
-
export { A as ALL_NAVI_ASSETS,
|
|
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-
|
|
8
|
-
import {
|
|
9
|
-
export { A as AssetRates, G as
|
|
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
|
+
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-3YmGYl63.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-3YmGYl63.cjs';
|
|
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
|
+
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';
|
|
11
11
|
import { Transaction, TransactionObjectArgument } from '@mysten/sui/transactions';
|
|
12
12
|
export { NaviAdapter, ProtocolRegistry } from './adapters/index.cjs';
|
|
13
13
|
|
|
14
|
+
declare class SafeguardEnforcer {
|
|
15
|
+
private config;
|
|
16
|
+
private readonly configPath;
|
|
17
|
+
constructor(configDir?: string);
|
|
18
|
+
load(): void;
|
|
19
|
+
assertNotLocked(): void;
|
|
20
|
+
check(metadata: TxMetadata): void;
|
|
21
|
+
recordUsage(amount: number): void;
|
|
22
|
+
lock(): void;
|
|
23
|
+
unlock(): void;
|
|
24
|
+
set(key: string, value: unknown): void;
|
|
25
|
+
getConfig(): SafeguardConfig;
|
|
26
|
+
isConfigured(): boolean;
|
|
27
|
+
private resetDailyIfNewDay;
|
|
28
|
+
private save;
|
|
29
|
+
}
|
|
30
|
+
|
|
14
31
|
interface Contact {
|
|
15
32
|
name: string;
|
|
16
33
|
address: string;
|
|
@@ -59,15 +76,6 @@ interface T2000Events {
|
|
|
59
76
|
apy: number;
|
|
60
77
|
timestamp: number;
|
|
61
78
|
}) => void;
|
|
62
|
-
gasAutoTopUp: (result: {
|
|
63
|
-
usdcSpent: number;
|
|
64
|
-
suiReceived: number;
|
|
65
|
-
}) => void;
|
|
66
|
-
gasStationFallback: (event: {
|
|
67
|
-
reason: string;
|
|
68
|
-
method: string;
|
|
69
|
-
suiUsed: number;
|
|
70
|
-
}) => void;
|
|
71
79
|
error: (error: T2000Error) => void;
|
|
72
80
|
}
|
|
73
81
|
declare class T2000 extends EventEmitter<T2000Events> {
|
|
@@ -91,11 +99,9 @@ declare class T2000 extends EventEmitter<T2000Events> {
|
|
|
91
99
|
passphrase?: string;
|
|
92
100
|
keyPath?: string;
|
|
93
101
|
name?: string;
|
|
94
|
-
sponsored?: boolean;
|
|
95
102
|
}): Promise<{
|
|
96
103
|
agent: T2000;
|
|
97
104
|
address: string;
|
|
98
|
-
sponsored: boolean;
|
|
99
105
|
}>;
|
|
100
106
|
/** SuiJsonRpcClient used by this agent — exposed for integrations. */
|
|
101
107
|
get suiClient(): SuiJsonRpcClient;
|
|
@@ -227,8 +233,6 @@ declare function walletExists(keyPath?: string): Promise<boolean>;
|
|
|
227
233
|
declare function exportPrivateKey(keypair: Ed25519Keypair): string;
|
|
228
234
|
declare function getAddress(keypair: Ed25519Keypair): string;
|
|
229
235
|
|
|
230
|
-
declare function solveHashcash(challenge: string): string;
|
|
231
|
-
|
|
232
236
|
declare const HF_WARN_THRESHOLD = 1.8;
|
|
233
237
|
declare const HF_CRITICAL_THRESHOLD = 1.3;
|
|
234
238
|
interface FinancialSummaryOptions {
|
|
@@ -324,4 +328,4 @@ declare function buildStakeVSuiTx(_client: SuiJsonRpcClient, address: string, am
|
|
|
324
328
|
*/
|
|
325
329
|
declare function buildUnstakeVSuiTx(client: SuiJsonRpcClient, address: string, amountMist: bigint | 'all'): Promise<Transaction>;
|
|
326
330
|
|
|
327
|
-
export { BalanceResponse, BorrowResult, ClaimRewardsResult, CompoundRewardsResult, ContactManager, DepositInfo, EarningsResult, FinancialSummary, type FinancialSummaryOptions, FundStatusResult, HF_CRITICAL_THRESHOLD, HF_WARN_THRESHOLD, HealthFactorResult, LendingAdapter, LendingRates, MaxBorrowResult, MaxWithdrawResult, OVERLAY_FEE_RATE, PayOptions, PayResult, PaymentRequest, PendingReward, PositionsResult, RatesResult, RepayResult, SafeguardEnforcer, SaveResult, SendResult, StakeVSuiResult, SupportedAsset, SwapQuoteResult, SwapResult, type SwapRouteResult, T2000, T2000Error, T2000Options, TransactionRecord, TransactionSigner, UnstakeVSuiResult, VOLO_METADATA, VOLO_PKG, VOLO_POOL, VSUI_TYPE, type VoloStats, WithdrawResult, ZkLoginProof, buildStakeVSuiTx, buildSwapTx, buildUnstakeVSuiTx, exportPrivateKey, findSwapRoute, generateKeypair, getAddress, getFinancialSummary, getPendingRewards, getRates, getSwapQuote, getVoloStats, keypairFromPrivateKey, loadKey, saveKey,
|
|
331
|
+
export { BalanceResponse, BorrowResult, ClaimRewardsResult, CompoundRewardsResult, ContactManager, DepositInfo, EarningsResult, FinancialSummary, type FinancialSummaryOptions, FundStatusResult, HF_CRITICAL_THRESHOLD, HF_WARN_THRESHOLD, HealthFactorResult, LendingAdapter, LendingRates, MaxBorrowResult, MaxWithdrawResult, OVERLAY_FEE_RATE, PayOptions, PayResult, PaymentRequest, PendingReward, PositionsResult, RatesResult, RepayResult, SafeguardConfig, SafeguardEnforcer, SaveResult, SendResult, StakeVSuiResult, SupportedAsset, SwapQuoteResult, SwapResult, type SwapRouteResult, T2000, T2000Error, T2000Options, TransactionRecord, TransactionSigner, TxMetadata, UnstakeVSuiResult, VOLO_METADATA, VOLO_PKG, VOLO_POOL, VSUI_TYPE, type VoloStats, WithdrawResult, ZkLoginProof, buildStakeVSuiTx, buildSwapTx, buildUnstakeVSuiTx, exportPrivateKey, findSwapRoute, generateKeypair, getAddress, getFinancialSummary, getPendingRewards, getRates, getSwapQuote, getVoloStats, keypairFromPrivateKey, loadKey, saveKey, walletExists };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,33 @@
|
|
|
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 {
|
|
5
|
-
export { A as ALL_NAVI_ASSETS,
|
|
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-
|
|
8
|
-
import {
|
|
9
|
-
export { A as AssetRates, G as
|
|
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
|
+
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-3YmGYl63.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-3YmGYl63.js';
|
|
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
|
+
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';
|
|
11
11
|
import { Transaction, TransactionObjectArgument } from '@mysten/sui/transactions';
|
|
12
12
|
export { NaviAdapter, ProtocolRegistry } from './adapters/index.js';
|
|
13
13
|
|
|
14
|
+
declare class SafeguardEnforcer {
|
|
15
|
+
private config;
|
|
16
|
+
private readonly configPath;
|
|
17
|
+
constructor(configDir?: string);
|
|
18
|
+
load(): void;
|
|
19
|
+
assertNotLocked(): void;
|
|
20
|
+
check(metadata: TxMetadata): void;
|
|
21
|
+
recordUsage(amount: number): void;
|
|
22
|
+
lock(): void;
|
|
23
|
+
unlock(): void;
|
|
24
|
+
set(key: string, value: unknown): void;
|
|
25
|
+
getConfig(): SafeguardConfig;
|
|
26
|
+
isConfigured(): boolean;
|
|
27
|
+
private resetDailyIfNewDay;
|
|
28
|
+
private save;
|
|
29
|
+
}
|
|
30
|
+
|
|
14
31
|
interface Contact {
|
|
15
32
|
name: string;
|
|
16
33
|
address: string;
|
|
@@ -59,15 +76,6 @@ interface T2000Events {
|
|
|
59
76
|
apy: number;
|
|
60
77
|
timestamp: number;
|
|
61
78
|
}) => void;
|
|
62
|
-
gasAutoTopUp: (result: {
|
|
63
|
-
usdcSpent: number;
|
|
64
|
-
suiReceived: number;
|
|
65
|
-
}) => void;
|
|
66
|
-
gasStationFallback: (event: {
|
|
67
|
-
reason: string;
|
|
68
|
-
method: string;
|
|
69
|
-
suiUsed: number;
|
|
70
|
-
}) => void;
|
|
71
79
|
error: (error: T2000Error) => void;
|
|
72
80
|
}
|
|
73
81
|
declare class T2000 extends EventEmitter<T2000Events> {
|
|
@@ -91,11 +99,9 @@ declare class T2000 extends EventEmitter<T2000Events> {
|
|
|
91
99
|
passphrase?: string;
|
|
92
100
|
keyPath?: string;
|
|
93
101
|
name?: string;
|
|
94
|
-
sponsored?: boolean;
|
|
95
102
|
}): Promise<{
|
|
96
103
|
agent: T2000;
|
|
97
104
|
address: string;
|
|
98
|
-
sponsored: boolean;
|
|
99
105
|
}>;
|
|
100
106
|
/** SuiJsonRpcClient used by this agent — exposed for integrations. */
|
|
101
107
|
get suiClient(): SuiJsonRpcClient;
|
|
@@ -227,8 +233,6 @@ declare function walletExists(keyPath?: string): Promise<boolean>;
|
|
|
227
233
|
declare function exportPrivateKey(keypair: Ed25519Keypair): string;
|
|
228
234
|
declare function getAddress(keypair: Ed25519Keypair): string;
|
|
229
235
|
|
|
230
|
-
declare function solveHashcash(challenge: string): string;
|
|
231
|
-
|
|
232
236
|
declare const HF_WARN_THRESHOLD = 1.8;
|
|
233
237
|
declare const HF_CRITICAL_THRESHOLD = 1.3;
|
|
234
238
|
interface FinancialSummaryOptions {
|
|
@@ -324,4 +328,4 @@ declare function buildStakeVSuiTx(_client: SuiJsonRpcClient, address: string, am
|
|
|
324
328
|
*/
|
|
325
329
|
declare function buildUnstakeVSuiTx(client: SuiJsonRpcClient, address: string, amountMist: bigint | 'all'): Promise<Transaction>;
|
|
326
330
|
|
|
327
|
-
export { BalanceResponse, BorrowResult, ClaimRewardsResult, CompoundRewardsResult, ContactManager, DepositInfo, EarningsResult, FinancialSummary, type FinancialSummaryOptions, FundStatusResult, HF_CRITICAL_THRESHOLD, HF_WARN_THRESHOLD, HealthFactorResult, LendingAdapter, LendingRates, MaxBorrowResult, MaxWithdrawResult, OVERLAY_FEE_RATE, PayOptions, PayResult, PaymentRequest, PendingReward, PositionsResult, RatesResult, RepayResult, SafeguardEnforcer, SaveResult, SendResult, StakeVSuiResult, SupportedAsset, SwapQuoteResult, SwapResult, type SwapRouteResult, T2000, T2000Error, T2000Options, TransactionRecord, TransactionSigner, UnstakeVSuiResult, VOLO_METADATA, VOLO_PKG, VOLO_POOL, VSUI_TYPE, type VoloStats, WithdrawResult, ZkLoginProof, buildStakeVSuiTx, buildSwapTx, buildUnstakeVSuiTx, exportPrivateKey, findSwapRoute, generateKeypair, getAddress, getFinancialSummary, getPendingRewards, getRates, getSwapQuote, getVoloStats, keypairFromPrivateKey, loadKey, saveKey,
|
|
331
|
+
export { BalanceResponse, BorrowResult, ClaimRewardsResult, CompoundRewardsResult, ContactManager, DepositInfo, EarningsResult, FinancialSummary, type FinancialSummaryOptions, FundStatusResult, HF_CRITICAL_THRESHOLD, HF_WARN_THRESHOLD, HealthFactorResult, LendingAdapter, LendingRates, MaxBorrowResult, MaxWithdrawResult, OVERLAY_FEE_RATE, PayOptions, PayResult, PaymentRequest, PendingReward, PositionsResult, RatesResult, RepayResult, SafeguardConfig, SafeguardEnforcer, SaveResult, SendResult, StakeVSuiResult, SupportedAsset, SwapQuoteResult, SwapResult, type SwapRouteResult, T2000, T2000Error, T2000Options, TransactionRecord, TransactionSigner, TxMetadata, UnstakeVSuiResult, VOLO_METADATA, VOLO_PKG, VOLO_POOL, VSUI_TYPE, type VoloStats, WithdrawResult, ZkLoginProof, buildStakeVSuiTx, buildSwapTx, buildUnstakeVSuiTx, exportPrivateKey, findSwapRoute, generateKeypair, getAddress, getFinancialSummary, getPendingRewards, getRates, getSwapQuote, getVoloStats, keypairFromPrivateKey, loadKey, saveKey, walletExists };
|