@t2000/sdk 0.56.2 → 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.
@@ -1,7 +1,7 @@
1
1
  import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
2
2
  import { SuiJsonRpcClient } from '@mysten/sui/jsonRpc';
3
+ import { T as TransactionRecord } from './types-jAD-e7Pq.js';
3
4
  import { Transaction, TransactionObjectArgument } from '@mysten/sui/transactions';
4
- import { G as GasMethod, T as TransactionRecord } from './types-DVVns7_w.js';
5
5
 
6
6
  /**
7
7
  * Abstract signing interface that decouples the SDK from any specific
@@ -51,7 +51,7 @@ declare class ZkLoginSigner implements TransactionSigner {
51
51
  isExpired(currentEpoch: number): boolean;
52
52
  }
53
53
 
54
- type T2000ErrorCode = 'INSUFFICIENT_BALANCE' | 'INSUFFICIENT_GAS' | 'INVALID_ADDRESS' | 'INVALID_AMOUNT' | 'WALLET_NOT_FOUND' | 'WALLET_LOCKED' | 'WALLET_EXISTS' | 'SPONSOR_FAILED' | 'SPONSOR_RATE_LIMITED' | 'GAS_STATION_UNAVAILABLE' | 'GAS_FEE_EXCEEDED' | 'SIMULATION_FAILED' | 'TRANSACTION_FAILED' | 'ASSET_NOT_SUPPORTED' | 'INVALID_ASSET' | 'HEALTH_FACTOR_TOO_LOW' | 'WITHDRAW_WOULD_LIQUIDATE' | 'WITHDRAW_FAILED' | 'NO_COLLATERAL' | 'PROTOCOL_PAUSED' | 'PROTOCOL_UNAVAILABLE' | 'RPC_ERROR' | 'RPC_UNREACHABLE' | 'SPONSOR_UNAVAILABLE' | 'AUTO_TOPUP_FAILED' | 'PRICE_EXCEEDS_LIMIT' | 'UNSUPPORTED_NETWORK' | 'PAYMENT_EXPIRED' | 'DUPLICATE_PAYMENT' | 'FACILITATOR_REJECTION' | 'CONTACT_NOT_FOUND' | 'INVALID_CONTACT_NAME' | 'FACILITATOR_TIMEOUT' | 'SAFEGUARD_BLOCKED' | 'SWAP_NO_ROUTE' | 'SWAP_FAILED' | 'UNKNOWN';
54
+ type T2000ErrorCode = 'INSUFFICIENT_BALANCE' | 'INSUFFICIENT_GAS' | 'INVALID_ADDRESS' | 'INVALID_AMOUNT' | 'WALLET_NOT_FOUND' | 'WALLET_LOCKED' | 'WALLET_EXISTS' | 'SIMULATION_FAILED' | 'TRANSACTION_FAILED' | 'ASSET_NOT_SUPPORTED' | 'INVALID_ASSET' | 'HEALTH_FACTOR_TOO_LOW' | 'WITHDRAW_WOULD_LIQUIDATE' | 'WITHDRAW_FAILED' | 'NO_COLLATERAL' | 'PROTOCOL_PAUSED' | 'PROTOCOL_UNAVAILABLE' | 'RPC_ERROR' | 'RPC_UNREACHABLE' | 'PRICE_EXCEEDS_LIMIT' | 'UNSUPPORTED_NETWORK' | 'PAYMENT_EXPIRED' | 'DUPLICATE_PAYMENT' | 'FACILITATOR_REJECTION' | 'CONTACT_NOT_FOUND' | 'INVALID_CONTACT_NAME' | 'FACILITATOR_TIMEOUT' | 'SAFEGUARD_BLOCKED' | 'SWAP_NO_ROUTE' | 'SWAP_FAILED' | 'UNKNOWN';
55
55
  interface T2000ErrorData {
56
56
  reason?: string;
57
57
  [key: string]: unknown;
@@ -71,87 +71,6 @@ declare class T2000Error extends Error {
71
71
  declare function mapWalletError(error: unknown): T2000Error;
72
72
  declare function mapMoveAbortCode(code: number): string;
73
73
 
74
- interface SafeguardConfig {
75
- locked: boolean;
76
- maxPerTx: number;
77
- maxDailySend: number;
78
- dailyUsed: number;
79
- dailyResetDate: string;
80
- maxLeverage?: number;
81
- maxPositionSize?: number;
82
- }
83
- interface TxMetadata {
84
- operation: 'send' | 'save' | 'withdraw' | 'borrow' | 'repay' | 'pay';
85
- amount?: number;
86
- }
87
- declare const OUTBOUND_OPS: Set<"save" | "borrow" | "withdraw" | "repay" | "send" | "pay">;
88
- declare const DEFAULT_SAFEGUARD_CONFIG: SafeguardConfig;
89
-
90
- declare class SafeguardEnforcer {
91
- private config;
92
- private readonly configPath;
93
- constructor(configDir?: string);
94
- load(): void;
95
- assertNotLocked(): void;
96
- check(metadata: TxMetadata): void;
97
- recordUsage(amount: number): void;
98
- lock(): void;
99
- unlock(): void;
100
- set(key: string, value: unknown): void;
101
- getConfig(): SafeguardConfig;
102
- isConfigured(): boolean;
103
- private resetDailyIfNewDay;
104
- private save;
105
- }
106
-
107
- interface GasExecutionResult {
108
- digest: string;
109
- effects: unknown;
110
- balanceChanges?: unknown[];
111
- gasMethod: GasMethod;
112
- gasCostSui: number;
113
- /** Pre-TX SUI balance in MIST — used internally for proactive gas maintenance. */
114
- preTxSuiMist?: bigint;
115
- }
116
- /**
117
- * Gas resolution chain:
118
- * 1. Self-funded (agent has enough SUI)
119
- * 2. Auto-topup (swap USDC→SUI, then self-fund)
120
- * 3. Gas Station sponsored (fallback)
121
- * 4. Fail with INSUFFICIENT_GAS
122
- *
123
- * After every successful transaction, proactively tops up SUI if it
124
- * dropped below threshold — so the user never hits a "no gas" wall.
125
- */
126
- declare function executeWithGas(client: SuiJsonRpcClient, signer: TransactionSigner, buildTx: () => Transaction | Promise<Transaction>, options?: {
127
- metadata?: TxMetadata;
128
- enforcer?: SafeguardEnforcer;
129
- }): Promise<GasExecutionResult>;
130
-
131
- interface AutoTopUpResult {
132
- success: boolean;
133
- tx: string;
134
- usdcSpent: number;
135
- suiReceived: number;
136
- }
137
- declare function shouldAutoTopUp(client: SuiJsonRpcClient, address: string): Promise<boolean>;
138
- declare function executeAutoTopUp(_client: SuiJsonRpcClient, _signer: TransactionSigner): Promise<AutoTopUpResult>;
139
-
140
- type GasRequestType = 'bootstrap' | 'auto-topup' | 'fallback';
141
- interface GasSponsorResponse {
142
- txBytes: string;
143
- sponsorSignature: string;
144
- gasEstimateUsd: number;
145
- type: GasRequestType;
146
- }
147
- interface GasStatusResponse {
148
- circuitBreaker: boolean;
149
- suiPrice: number;
150
- bootstrapUsed?: number;
151
- bootstrapRemaining?: number;
152
- }
153
- declare function getGasStatus(address?: string): Promise<GasStatusResponse>;
154
-
155
74
  declare const MIST_PER_SUI = 1000000000n;
156
75
  declare const SUI_DECIMALS = 9;
157
76
  declare const USDC_DECIMALS = 6;
@@ -500,6 +419,22 @@ declare class SafeguardError extends T2000Error {
500
419
  };
501
420
  }
502
421
 
422
+ interface SafeguardConfig {
423
+ locked: boolean;
424
+ maxPerTx: number;
425
+ maxDailySend: number;
426
+ dailyUsed: number;
427
+ dailyResetDate: string;
428
+ maxLeverage?: number;
429
+ maxPositionSize?: number;
430
+ }
431
+ interface TxMetadata {
432
+ operation: 'send' | 'save' | 'withdraw' | 'borrow' | 'repay' | 'pay';
433
+ amount?: number;
434
+ }
435
+ declare const OUTBOUND_OPS: Set<"save" | "borrow" | "withdraw" | "repay" | "send" | "pay">;
436
+ declare const DEFAULT_SAFEGUARD_CONFIG: SafeguardConfig;
437
+
503
438
  /**
504
439
  * Unified token registry — single source of truth for coin types, decimals, symbols, and tiers.
505
440
  *
@@ -566,4 +501,4 @@ declare const IKA_TYPE: string;
566
501
  declare const LOFI_TYPE: string;
567
502
  declare const MANIFEST_TYPE: string;
568
503
 
569
- export { WBTC_TYPE as $, ALL_NAVI_ASSETS as A, BPS_DENOMINATOR as B, CLOCK_ID as C, DEFAULT_NETWORK as D, ETH_TYPE as E, type FeeOperation as F, GAS_RESERVE_MIN as G, type T2000ErrorData as H, IKA_TYPE as I, TOKEN_MAP as J, KNOWN_TARGETS as K, LABEL_PATTERNS as L, MANIFEST_TYPE as M, NAVX_TYPE as N, OUTBOUND_OPS as O, type ProtocolFeeInfo as P, type TransactionSigner as Q, type TxDirection as R, STABLE_ASSETS as S, T2000Error as T, type TxMetadata as U, USDC_DECIMALS as V, USDC_TYPE as W, USDE_TYPE as X, USDSUI_TYPE as Y, USDT_TYPE as Z, WAL_TYPE as _, type AutoTopUpResult as a, type ZkLoginProof as a0, ZkLoginSigner as a1, addCollectFeeToTx as a2, calculateFee as a3, classifyAction as a4, classifyLabel as a5, classifyTransaction as a6, executeAutoTopUp as a7, executeWithGas as a8, extractTransferDetails as a9, usdcToRaw as aA, validateAddress as aB, SafeguardEnforcer as aC, BORROW_FEE_BPS as aD, CETUS_USDC_SUI_POOL as aE, OPERATION_ASSETS as aF, type Operation as aG, SAVE_FEE_BPS as aH, assertAllowedAsset as aI, isAllowedAsset as aJ, normalizeCoinType as aK, queryHistory as aL, queryTransaction as aM, simulateTransaction as aN, throwIfSimulationFailed as aO, extractTxCommands as aa, extractTxSender as ab, fallbackLabel as ac, formatAssetAmount as ad, formatSui as ae, formatUsd as af, getDecimals as ag, getDecimalsForCoinType as ah, getGasStatus as ai, getTier as aj, isSupported as ak, isTier1 as al, isTier2 as am, mapMoveAbortCode as an, mapWalletError as ao, mistToSui as ap, parseSuiRpcTx as aq, rawToStable as ar, rawToUsdc as as, refineLendingLabel as at, resolveSymbol as au, resolveTokenType as av, shouldAutoTopUp as aw, stableToRaw as ax, suiToMist as ay, truncateAddress as az, COIN_REGISTRY as b, type ClassifyBalanceChange as c, type ClassifyResult as d, type CoinMeta as e, DEFAULT_SAFEGUARD_CONFIG as f, type ExtractedTransfer as g, type GasExecutionResult as h, type GasRequestType as i, type GasSponsorResponse as j, type GasStatusResponse as k, KeypairSigner as l, LOFI_TYPE as m, MIST_PER_SUI as n, SUI_DECIMALS as o, SUI_TYPE as p, SUPPORTED_ASSETS as q, type SafeguardConfig as r, SafeguardError as s, type SafeguardErrorDetails as t, type SafeguardRule as u, type SimulationResult as v, type StableAsset as w, type SuiRpcTxBlock as x, type SupportedAsset as y, type T2000ErrorCode as z };
504
+ export { classifyAction as $, ALL_NAVI_ASSETS as A, BPS_DENOMINATOR as B, CLOCK_ID as C, DEFAULT_NETWORK as D, ETH_TYPE as E, type FeeOperation as F, GAS_RESERVE_MIN as G, USDC_TYPE as H, IKA_TYPE as I, USDE_TYPE as J, KNOWN_TARGETS as K, LABEL_PATTERNS as L, MANIFEST_TYPE as M, NAVX_TYPE as N, OUTBOUND_OPS as O, type ProtocolFeeInfo as P, USDSUI_TYPE as Q, USDT_TYPE as R, STABLE_ASSETS as S, T2000Error as T, USDC_DECIMALS as U, WBTC_TYPE as V, WAL_TYPE as W, ZkLoginSigner as X, addCollectFeeToTx as Y, type ZkLoginProof as Z, calculateFee as _, COIN_REGISTRY as a, classifyLabel as a0, classifyTransaction as a1, extractTransferDetails as a2, extractTxCommands as a3, extractTxSender as a4, fallbackLabel as a5, formatAssetAmount as a6, formatSui as a7, formatUsd as a8, getDecimals as a9, normalizeCoinType as aA, queryHistory as aB, queryTransaction as aC, simulateTransaction as aD, throwIfSimulationFailed as aE, getDecimalsForCoinType as aa, getTier as ab, isSupported as ac, isTier1 as ad, isTier2 as ae, mapMoveAbortCode as af, mapWalletError as ag, mistToSui as ah, parseSuiRpcTx as ai, rawToStable as aj, rawToUsdc as ak, refineLendingLabel as al, resolveSymbol as am, resolveTokenType as an, stableToRaw as ao, suiToMist as ap, truncateAddress as aq, usdcToRaw as ar, validateAddress as as, BORROW_FEE_BPS as at, CETUS_USDC_SUI_POOL as au, OPERATION_ASSETS as av, type Operation as aw, SAVE_FEE_BPS as ax, assertAllowedAsset as ay, isAllowedAsset as az, type ClassifyBalanceChange as b, type ClassifyResult as c, type CoinMeta as d, DEFAULT_SAFEGUARD_CONFIG as e, type ExtractedTransfer as f, KeypairSigner as g, LOFI_TYPE as h, MIST_PER_SUI as i, SUI_DECIMALS as j, SUI_TYPE as k, SUPPORTED_ASSETS as l, type SafeguardConfig as m, SafeguardError as n, type SafeguardErrorDetails as o, type SafeguardRule as p, type SimulationResult as q, type StableAsset as r, type SuiRpcTxBlock as s, type SupportedAsset as t, type T2000ErrorCode as u, type T2000ErrorData as v, TOKEN_MAP as w, type TransactionSigner as x, type TxDirection as y, type TxMetadata as z };
@@ -1,7 +1,7 @@
1
1
  import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
2
2
  import { SuiJsonRpcClient } from '@mysten/sui/jsonRpc';
3
+ import { T as TransactionRecord } from './types-jAD-e7Pq.cjs';
3
4
  import { Transaction, TransactionObjectArgument } from '@mysten/sui/transactions';
4
- import { G as GasMethod, T as TransactionRecord } from './types-DVVns7_w.cjs';
5
5
 
6
6
  /**
7
7
  * Abstract signing interface that decouples the SDK from any specific
@@ -51,7 +51,7 @@ declare class ZkLoginSigner implements TransactionSigner {
51
51
  isExpired(currentEpoch: number): boolean;
52
52
  }
53
53
 
54
- type T2000ErrorCode = 'INSUFFICIENT_BALANCE' | 'INSUFFICIENT_GAS' | 'INVALID_ADDRESS' | 'INVALID_AMOUNT' | 'WALLET_NOT_FOUND' | 'WALLET_LOCKED' | 'WALLET_EXISTS' | 'SPONSOR_FAILED' | 'SPONSOR_RATE_LIMITED' | 'GAS_STATION_UNAVAILABLE' | 'GAS_FEE_EXCEEDED' | 'SIMULATION_FAILED' | 'TRANSACTION_FAILED' | 'ASSET_NOT_SUPPORTED' | 'INVALID_ASSET' | 'HEALTH_FACTOR_TOO_LOW' | 'WITHDRAW_WOULD_LIQUIDATE' | 'WITHDRAW_FAILED' | 'NO_COLLATERAL' | 'PROTOCOL_PAUSED' | 'PROTOCOL_UNAVAILABLE' | 'RPC_ERROR' | 'RPC_UNREACHABLE' | 'SPONSOR_UNAVAILABLE' | 'AUTO_TOPUP_FAILED' | 'PRICE_EXCEEDS_LIMIT' | 'UNSUPPORTED_NETWORK' | 'PAYMENT_EXPIRED' | 'DUPLICATE_PAYMENT' | 'FACILITATOR_REJECTION' | 'CONTACT_NOT_FOUND' | 'INVALID_CONTACT_NAME' | 'FACILITATOR_TIMEOUT' | 'SAFEGUARD_BLOCKED' | 'SWAP_NO_ROUTE' | 'SWAP_FAILED' | 'UNKNOWN';
54
+ type T2000ErrorCode = 'INSUFFICIENT_BALANCE' | 'INSUFFICIENT_GAS' | 'INVALID_ADDRESS' | 'INVALID_AMOUNT' | 'WALLET_NOT_FOUND' | 'WALLET_LOCKED' | 'WALLET_EXISTS' | 'SIMULATION_FAILED' | 'TRANSACTION_FAILED' | 'ASSET_NOT_SUPPORTED' | 'INVALID_ASSET' | 'HEALTH_FACTOR_TOO_LOW' | 'WITHDRAW_WOULD_LIQUIDATE' | 'WITHDRAW_FAILED' | 'NO_COLLATERAL' | 'PROTOCOL_PAUSED' | 'PROTOCOL_UNAVAILABLE' | 'RPC_ERROR' | 'RPC_UNREACHABLE' | 'PRICE_EXCEEDS_LIMIT' | 'UNSUPPORTED_NETWORK' | 'PAYMENT_EXPIRED' | 'DUPLICATE_PAYMENT' | 'FACILITATOR_REJECTION' | 'CONTACT_NOT_FOUND' | 'INVALID_CONTACT_NAME' | 'FACILITATOR_TIMEOUT' | 'SAFEGUARD_BLOCKED' | 'SWAP_NO_ROUTE' | 'SWAP_FAILED' | 'UNKNOWN';
55
55
  interface T2000ErrorData {
56
56
  reason?: string;
57
57
  [key: string]: unknown;
@@ -71,87 +71,6 @@ declare class T2000Error extends Error {
71
71
  declare function mapWalletError(error: unknown): T2000Error;
72
72
  declare function mapMoveAbortCode(code: number): string;
73
73
 
74
- interface SafeguardConfig {
75
- locked: boolean;
76
- maxPerTx: number;
77
- maxDailySend: number;
78
- dailyUsed: number;
79
- dailyResetDate: string;
80
- maxLeverage?: number;
81
- maxPositionSize?: number;
82
- }
83
- interface TxMetadata {
84
- operation: 'send' | 'save' | 'withdraw' | 'borrow' | 'repay' | 'pay';
85
- amount?: number;
86
- }
87
- declare const OUTBOUND_OPS: Set<"save" | "borrow" | "withdraw" | "repay" | "send" | "pay">;
88
- declare const DEFAULT_SAFEGUARD_CONFIG: SafeguardConfig;
89
-
90
- declare class SafeguardEnforcer {
91
- private config;
92
- private readonly configPath;
93
- constructor(configDir?: string);
94
- load(): void;
95
- assertNotLocked(): void;
96
- check(metadata: TxMetadata): void;
97
- recordUsage(amount: number): void;
98
- lock(): void;
99
- unlock(): void;
100
- set(key: string, value: unknown): void;
101
- getConfig(): SafeguardConfig;
102
- isConfigured(): boolean;
103
- private resetDailyIfNewDay;
104
- private save;
105
- }
106
-
107
- interface GasExecutionResult {
108
- digest: string;
109
- effects: unknown;
110
- balanceChanges?: unknown[];
111
- gasMethod: GasMethod;
112
- gasCostSui: number;
113
- /** Pre-TX SUI balance in MIST — used internally for proactive gas maintenance. */
114
- preTxSuiMist?: bigint;
115
- }
116
- /**
117
- * Gas resolution chain:
118
- * 1. Self-funded (agent has enough SUI)
119
- * 2. Auto-topup (swap USDC→SUI, then self-fund)
120
- * 3. Gas Station sponsored (fallback)
121
- * 4. Fail with INSUFFICIENT_GAS
122
- *
123
- * After every successful transaction, proactively tops up SUI if it
124
- * dropped below threshold — so the user never hits a "no gas" wall.
125
- */
126
- declare function executeWithGas(client: SuiJsonRpcClient, signer: TransactionSigner, buildTx: () => Transaction | Promise<Transaction>, options?: {
127
- metadata?: TxMetadata;
128
- enforcer?: SafeguardEnforcer;
129
- }): Promise<GasExecutionResult>;
130
-
131
- interface AutoTopUpResult {
132
- success: boolean;
133
- tx: string;
134
- usdcSpent: number;
135
- suiReceived: number;
136
- }
137
- declare function shouldAutoTopUp(client: SuiJsonRpcClient, address: string): Promise<boolean>;
138
- declare function executeAutoTopUp(_client: SuiJsonRpcClient, _signer: TransactionSigner): Promise<AutoTopUpResult>;
139
-
140
- type GasRequestType = 'bootstrap' | 'auto-topup' | 'fallback';
141
- interface GasSponsorResponse {
142
- txBytes: string;
143
- sponsorSignature: string;
144
- gasEstimateUsd: number;
145
- type: GasRequestType;
146
- }
147
- interface GasStatusResponse {
148
- circuitBreaker: boolean;
149
- suiPrice: number;
150
- bootstrapUsed?: number;
151
- bootstrapRemaining?: number;
152
- }
153
- declare function getGasStatus(address?: string): Promise<GasStatusResponse>;
154
-
155
74
  declare const MIST_PER_SUI = 1000000000n;
156
75
  declare const SUI_DECIMALS = 9;
157
76
  declare const USDC_DECIMALS = 6;
@@ -500,6 +419,22 @@ declare class SafeguardError extends T2000Error {
500
419
  };
501
420
  }
502
421
 
422
+ interface SafeguardConfig {
423
+ locked: boolean;
424
+ maxPerTx: number;
425
+ maxDailySend: number;
426
+ dailyUsed: number;
427
+ dailyResetDate: string;
428
+ maxLeverage?: number;
429
+ maxPositionSize?: number;
430
+ }
431
+ interface TxMetadata {
432
+ operation: 'send' | 'save' | 'withdraw' | 'borrow' | 'repay' | 'pay';
433
+ amount?: number;
434
+ }
435
+ declare const OUTBOUND_OPS: Set<"save" | "borrow" | "withdraw" | "repay" | "send" | "pay">;
436
+ declare const DEFAULT_SAFEGUARD_CONFIG: SafeguardConfig;
437
+
503
438
  /**
504
439
  * Unified token registry — single source of truth for coin types, decimals, symbols, and tiers.
505
440
  *
@@ -566,4 +501,4 @@ declare const IKA_TYPE: string;
566
501
  declare const LOFI_TYPE: string;
567
502
  declare const MANIFEST_TYPE: string;
568
503
 
569
- export { WBTC_TYPE as $, ALL_NAVI_ASSETS as A, BPS_DENOMINATOR as B, CLOCK_ID as C, DEFAULT_NETWORK as D, ETH_TYPE as E, type FeeOperation as F, GAS_RESERVE_MIN as G, type T2000ErrorData as H, IKA_TYPE as I, TOKEN_MAP as J, KNOWN_TARGETS as K, LABEL_PATTERNS as L, MANIFEST_TYPE as M, NAVX_TYPE as N, OUTBOUND_OPS as O, type ProtocolFeeInfo as P, type TransactionSigner as Q, type TxDirection as R, STABLE_ASSETS as S, T2000Error as T, type TxMetadata as U, USDC_DECIMALS as V, USDC_TYPE as W, USDE_TYPE as X, USDSUI_TYPE as Y, USDT_TYPE as Z, WAL_TYPE as _, type AutoTopUpResult as a, type ZkLoginProof as a0, ZkLoginSigner as a1, addCollectFeeToTx as a2, calculateFee as a3, classifyAction as a4, classifyLabel as a5, classifyTransaction as a6, executeAutoTopUp as a7, executeWithGas as a8, extractTransferDetails as a9, usdcToRaw as aA, validateAddress as aB, SafeguardEnforcer as aC, BORROW_FEE_BPS as aD, CETUS_USDC_SUI_POOL as aE, OPERATION_ASSETS as aF, type Operation as aG, SAVE_FEE_BPS as aH, assertAllowedAsset as aI, isAllowedAsset as aJ, normalizeCoinType as aK, queryHistory as aL, queryTransaction as aM, simulateTransaction as aN, throwIfSimulationFailed as aO, extractTxCommands as aa, extractTxSender as ab, fallbackLabel as ac, formatAssetAmount as ad, formatSui as ae, formatUsd as af, getDecimals as ag, getDecimalsForCoinType as ah, getGasStatus as ai, getTier as aj, isSupported as ak, isTier1 as al, isTier2 as am, mapMoveAbortCode as an, mapWalletError as ao, mistToSui as ap, parseSuiRpcTx as aq, rawToStable as ar, rawToUsdc as as, refineLendingLabel as at, resolveSymbol as au, resolveTokenType as av, shouldAutoTopUp as aw, stableToRaw as ax, suiToMist as ay, truncateAddress as az, COIN_REGISTRY as b, type ClassifyBalanceChange as c, type ClassifyResult as d, type CoinMeta as e, DEFAULT_SAFEGUARD_CONFIG as f, type ExtractedTransfer as g, type GasExecutionResult as h, type GasRequestType as i, type GasSponsorResponse as j, type GasStatusResponse as k, KeypairSigner as l, LOFI_TYPE as m, MIST_PER_SUI as n, SUI_DECIMALS as o, SUI_TYPE as p, SUPPORTED_ASSETS as q, type SafeguardConfig as r, SafeguardError as s, type SafeguardErrorDetails as t, type SafeguardRule as u, type SimulationResult as v, type StableAsset as w, type SuiRpcTxBlock as x, type SupportedAsset as y, type T2000ErrorCode as z };
504
+ export { classifyAction as $, ALL_NAVI_ASSETS as A, BPS_DENOMINATOR as B, CLOCK_ID as C, DEFAULT_NETWORK as D, ETH_TYPE as E, type FeeOperation as F, GAS_RESERVE_MIN as G, USDC_TYPE as H, IKA_TYPE as I, USDE_TYPE as J, KNOWN_TARGETS as K, LABEL_PATTERNS as L, MANIFEST_TYPE as M, NAVX_TYPE as N, OUTBOUND_OPS as O, type ProtocolFeeInfo as P, USDSUI_TYPE as Q, USDT_TYPE as R, STABLE_ASSETS as S, T2000Error as T, USDC_DECIMALS as U, WBTC_TYPE as V, WAL_TYPE as W, ZkLoginSigner as X, addCollectFeeToTx as Y, type ZkLoginProof as Z, calculateFee as _, COIN_REGISTRY as a, classifyLabel as a0, classifyTransaction as a1, extractTransferDetails as a2, extractTxCommands as a3, extractTxSender as a4, fallbackLabel as a5, formatAssetAmount as a6, formatSui as a7, formatUsd as a8, getDecimals as a9, normalizeCoinType as aA, queryHistory as aB, queryTransaction as aC, simulateTransaction as aD, throwIfSimulationFailed as aE, getDecimalsForCoinType as aa, getTier as ab, isSupported as ac, isTier1 as ad, isTier2 as ae, mapMoveAbortCode as af, mapWalletError as ag, mistToSui as ah, parseSuiRpcTx as ai, rawToStable as aj, rawToUsdc as ak, refineLendingLabel as al, resolveSymbol as am, resolveTokenType as an, stableToRaw as ao, suiToMist as ap, truncateAddress as aq, usdcToRaw as ar, validateAddress as as, BORROW_FEE_BPS as at, CETUS_USDC_SUI_POOL as au, OPERATION_ASSETS as av, type Operation as aw, SAVE_FEE_BPS as ax, assertAllowedAsset as ay, isAllowedAsset as az, type ClassifyBalanceChange as b, type ClassifyResult as c, type CoinMeta as d, DEFAULT_SAFEGUARD_CONFIG as e, type ExtractedTransfer as f, KeypairSigner as g, LOFI_TYPE as h, MIST_PER_SUI as i, SUI_DECIMALS as j, SUI_TYPE as k, SUPPORTED_ASSETS as l, type SafeguardConfig as m, SafeguardError as n, type SafeguardErrorDetails as o, type SafeguardRule as p, type SimulationResult as q, type StableAsset as r, type SuiRpcTxBlock as s, type SupportedAsset as t, type T2000ErrorCode as u, type T2000ErrorData as v, TOKEN_MAP as w, type TransactionSigner as x, type TxDirection as y, type TxMetadata as z };
@@ -6,8 +6,6 @@ interface T2000Options {
6
6
  passphrase?: string;
7
7
  network?: 'mainnet' | 'testnet';
8
8
  rpcUrl?: string;
9
- sponsored?: boolean;
10
- name?: string;
11
9
  }
12
10
  interface GasReserve {
13
11
  sui: number;
@@ -22,7 +20,6 @@ interface BalanceResponse {
22
20
  total: number;
23
21
  stables: Record<string, number>;
24
22
  }
25
- type GasMethod = 'self-funded' | 'sponsored' | 'auto-topup' | 'none';
26
23
  interface SendResult {
27
24
  success: boolean;
28
25
  tx: string;
@@ -31,7 +28,6 @@ interface SendResult {
31
28
  contactName?: string;
32
29
  gasCost: number;
33
30
  gasCostUnit: string;
34
- gasMethod: GasMethod;
35
31
  balance: BalanceResponse;
36
32
  }
37
33
  interface SaveResult {
@@ -41,7 +37,6 @@ interface SaveResult {
41
37
  apy: number;
42
38
  fee: number;
43
39
  gasCost: number;
44
- gasMethod: GasMethod;
45
40
  savingsBalance: number;
46
41
  }
47
42
  interface WithdrawResult {
@@ -50,7 +45,6 @@ interface WithdrawResult {
50
45
  amount: number;
51
46
  asset?: string;
52
47
  gasCost: number;
53
- gasMethod: GasMethod;
54
48
  }
55
49
  interface BorrowResult {
56
50
  success: boolean;
@@ -61,7 +55,6 @@ interface BorrowResult {
61
55
  fee: number;
62
56
  healthFactor: number;
63
57
  gasCost: number;
64
- gasMethod: GasMethod;
65
58
  }
66
59
  interface RepayResult {
67
60
  success: boolean;
@@ -71,7 +64,6 @@ interface RepayResult {
71
64
  asset?: string;
72
65
  remainingDebt: number;
73
66
  gasCost: number;
74
- gasMethod: GasMethod;
75
67
  }
76
68
  interface HealthFactorResult {
77
69
  healthFactor: number;
@@ -166,7 +158,6 @@ interface TransactionRecord {
166
158
  direction?: 'in' | 'out';
167
159
  timestamp: number;
168
160
  gasCost?: number;
169
- gasMethod?: GasMethod;
170
161
  }
171
162
  interface PendingReward {
172
163
  protocol: string;
@@ -182,7 +173,6 @@ interface ClaimRewardsResult {
182
173
  rewards: PendingReward[];
183
174
  totalValueUsd: number;
184
175
  gasCost: number;
185
- gasMethod: GasMethod;
186
176
  }
187
177
  interface CompoundRewardsResult {
188
178
  success: boolean;
@@ -200,7 +190,6 @@ interface StakeVSuiResult {
200
190
  vSuiReceived: number;
201
191
  apy: number;
202
192
  gasCost: number;
203
- gasMethod: GasMethod;
204
193
  }
205
194
  interface UnstakeVSuiResult {
206
195
  success: boolean;
@@ -208,7 +197,6 @@ interface UnstakeVSuiResult {
208
197
  vSuiAmount: number;
209
198
  suiReceived: number;
210
199
  gasCost: number;
211
- gasMethod: GasMethod;
212
200
  }
213
201
  interface SwapResult {
214
202
  success: boolean;
@@ -220,7 +208,6 @@ interface SwapResult {
220
208
  priceImpact: number;
221
209
  route: string;
222
210
  gasCost: number;
223
- gasMethod: GasMethod;
224
211
  }
225
212
  interface SwapQuoteResult {
226
213
  fromToken: string;
@@ -264,4 +251,4 @@ interface FinancialSummary {
264
251
  fetchedAt: number;
265
252
  }
266
253
 
267
- export type { AssetRates as A, BalanceResponse as B, ClaimRewardsResult as C, DepositInfo as D, EarningsResult as E, FundStatusResult as F, GasMethod as G, HealthFactorResult as H, MaxBorrowResult as M, PayOptions as P, RatesResult as R, SaveResult as S, TransactionRecord as T, UnstakeVSuiResult as U, WithdrawResult as W, BorrowResult as a, GasReserve as b, MaxWithdrawResult as c, PayResult as d, PendingReward as e, PositionEntry as f, PositionsResult as g, RepayResult as h, SendResult as i, T2000Options as j, StakeVSuiResult as k, SwapResult as l, SwapQuoteResult as m, PaymentRequest as n, CompoundRewardsResult as o, FinancialSummary as p, HFAlertLevel as q };
254
+ export type { AssetRates as A, BalanceResponse as B, ClaimRewardsResult as C, DepositInfo as D, EarningsResult as E, FundStatusResult as F, GasReserve as G, HealthFactorResult as H, MaxBorrowResult as M, PayOptions as P, RatesResult as R, SaveResult as S, TransactionRecord as T, UnstakeVSuiResult as U, WithdrawResult as W, BorrowResult as a, MaxWithdrawResult as b, PayResult as c, PendingReward as d, PositionEntry as e, PositionsResult as f, RepayResult as g, SendResult as h, T2000Options as i, StakeVSuiResult as j, SwapResult as k, SwapQuoteResult as l, PaymentRequest as m, CompoundRewardsResult as n, FinancialSummary as o, HFAlertLevel as p };
@@ -6,8 +6,6 @@ interface T2000Options {
6
6
  passphrase?: string;
7
7
  network?: 'mainnet' | 'testnet';
8
8
  rpcUrl?: string;
9
- sponsored?: boolean;
10
- name?: string;
11
9
  }
12
10
  interface GasReserve {
13
11
  sui: number;
@@ -22,7 +20,6 @@ interface BalanceResponse {
22
20
  total: number;
23
21
  stables: Record<string, number>;
24
22
  }
25
- type GasMethod = 'self-funded' | 'sponsored' | 'auto-topup' | 'none';
26
23
  interface SendResult {
27
24
  success: boolean;
28
25
  tx: string;
@@ -31,7 +28,6 @@ interface SendResult {
31
28
  contactName?: string;
32
29
  gasCost: number;
33
30
  gasCostUnit: string;
34
- gasMethod: GasMethod;
35
31
  balance: BalanceResponse;
36
32
  }
37
33
  interface SaveResult {
@@ -41,7 +37,6 @@ interface SaveResult {
41
37
  apy: number;
42
38
  fee: number;
43
39
  gasCost: number;
44
- gasMethod: GasMethod;
45
40
  savingsBalance: number;
46
41
  }
47
42
  interface WithdrawResult {
@@ -50,7 +45,6 @@ interface WithdrawResult {
50
45
  amount: number;
51
46
  asset?: string;
52
47
  gasCost: number;
53
- gasMethod: GasMethod;
54
48
  }
55
49
  interface BorrowResult {
56
50
  success: boolean;
@@ -61,7 +55,6 @@ interface BorrowResult {
61
55
  fee: number;
62
56
  healthFactor: number;
63
57
  gasCost: number;
64
- gasMethod: GasMethod;
65
58
  }
66
59
  interface RepayResult {
67
60
  success: boolean;
@@ -71,7 +64,6 @@ interface RepayResult {
71
64
  asset?: string;
72
65
  remainingDebt: number;
73
66
  gasCost: number;
74
- gasMethod: GasMethod;
75
67
  }
76
68
  interface HealthFactorResult {
77
69
  healthFactor: number;
@@ -166,7 +158,6 @@ interface TransactionRecord {
166
158
  direction?: 'in' | 'out';
167
159
  timestamp: number;
168
160
  gasCost?: number;
169
- gasMethod?: GasMethod;
170
161
  }
171
162
  interface PendingReward {
172
163
  protocol: string;
@@ -182,7 +173,6 @@ interface ClaimRewardsResult {
182
173
  rewards: PendingReward[];
183
174
  totalValueUsd: number;
184
175
  gasCost: number;
185
- gasMethod: GasMethod;
186
176
  }
187
177
  interface CompoundRewardsResult {
188
178
  success: boolean;
@@ -200,7 +190,6 @@ interface StakeVSuiResult {
200
190
  vSuiReceived: number;
201
191
  apy: number;
202
192
  gasCost: number;
203
- gasMethod: GasMethod;
204
193
  }
205
194
  interface UnstakeVSuiResult {
206
195
  success: boolean;
@@ -208,7 +197,6 @@ interface UnstakeVSuiResult {
208
197
  vSuiAmount: number;
209
198
  suiReceived: number;
210
199
  gasCost: number;
211
- gasMethod: GasMethod;
212
200
  }
213
201
  interface SwapResult {
214
202
  success: boolean;
@@ -220,7 +208,6 @@ interface SwapResult {
220
208
  priceImpact: number;
221
209
  route: string;
222
210
  gasCost: number;
223
- gasMethod: GasMethod;
224
211
  }
225
212
  interface SwapQuoteResult {
226
213
  fromToken: string;
@@ -264,4 +251,4 @@ interface FinancialSummary {
264
251
  fetchedAt: number;
265
252
  }
266
253
 
267
- export type { AssetRates as A, BalanceResponse as B, ClaimRewardsResult as C, DepositInfo as D, EarningsResult as E, FundStatusResult as F, GasMethod as G, HealthFactorResult as H, MaxBorrowResult as M, PayOptions as P, RatesResult as R, SaveResult as S, TransactionRecord as T, UnstakeVSuiResult as U, WithdrawResult as W, BorrowResult as a, GasReserve as b, MaxWithdrawResult as c, PayResult as d, PendingReward as e, PositionEntry as f, PositionsResult as g, RepayResult as h, SendResult as i, T2000Options as j, StakeVSuiResult as k, SwapResult as l, SwapQuoteResult as m, PaymentRequest as n, CompoundRewardsResult as o, FinancialSummary as p, HFAlertLevel as q };
254
+ export type { AssetRates as A, BalanceResponse as B, ClaimRewardsResult as C, DepositInfo as D, EarningsResult as E, FundStatusResult as F, GasReserve as G, HealthFactorResult as H, MaxBorrowResult as M, PayOptions as P, RatesResult as R, SaveResult as S, TransactionRecord as T, UnstakeVSuiResult as U, WithdrawResult as W, BorrowResult as a, MaxWithdrawResult as b, PayResult as c, PendingReward as d, PositionEntry as e, PositionsResult as f, RepayResult as g, SendResult as h, T2000Options as i, StakeVSuiResult as j, SwapResult as k, SwapQuoteResult as l, PaymentRequest as m, CompoundRewardsResult as n, FinancialSummary as o, HFAlertLevel as p };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@t2000/sdk",
3
- "version": "0.56.2",
3
+ "version": "1.0.1",
4
4
  "description": "TypeScript SDK for AI agent bank accounts on Sui — send, save, borrow, swap. NAVI lending + Cetus aggregator routing, sponsored gas, zkLogin compatible.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",