@t2000/sdk 0.22.1 → 0.22.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/index.cjs +22 -22
- package/dist/adapters/index.cjs.map +1 -1
- package/dist/adapters/index.js +22 -22
- package/dist/adapters/index.js.map +1 -1
- package/dist/browser.cjs +1 -1
- 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 +1 -1
- package/dist/browser.js.map +1 -1
- package/dist/index.cjs +30 -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 +28 -5
- package/dist/index.js.map +1 -1
- package/dist/{token-registry-BBAPkvGS.d.ts → token-registry-DLEKjV8I.d.ts} +17 -2
- package/dist/{token-registry-abuw6uo0.d.cts → token-registry-bf_caDsv.d.cts} +17 -2
- package/package.json +2 -1
|
@@ -84,7 +84,7 @@ interface TxMetadata {
|
|
|
84
84
|
operation: 'send' | 'save' | 'withdraw' | 'borrow' | 'repay' | 'pay';
|
|
85
85
|
amount?: number;
|
|
86
86
|
}
|
|
87
|
-
declare const OUTBOUND_OPS: Set<"save" | "borrow" | "
|
|
87
|
+
declare const OUTBOUND_OPS: Set<"save" | "borrow" | "withdraw" | "repay" | "send" | "pay">;
|
|
88
88
|
declare const DEFAULT_SAFEGUARD_CONFIG: SafeguardConfig;
|
|
89
89
|
|
|
90
90
|
declare class SafeguardEnforcer {
|
|
@@ -217,6 +217,21 @@ type SupportedAsset = keyof typeof SUPPORTED_ASSETS;
|
|
|
217
217
|
type StableAsset = 'USDC';
|
|
218
218
|
declare const STABLE_ASSETS: readonly StableAsset[];
|
|
219
219
|
declare const ALL_NAVI_ASSETS: readonly SupportedAsset[];
|
|
220
|
+
declare const OPERATION_ASSETS: {
|
|
221
|
+
readonly save: readonly ["USDC"];
|
|
222
|
+
readonly borrow: readonly ["USDC"];
|
|
223
|
+
readonly withdraw: "*";
|
|
224
|
+
readonly repay: "*";
|
|
225
|
+
readonly send: "*";
|
|
226
|
+
readonly swap: "*";
|
|
227
|
+
};
|
|
228
|
+
type Operation = keyof typeof OPERATION_ASSETS;
|
|
229
|
+
declare function isAllowedAsset(op: Operation, asset: string): boolean;
|
|
230
|
+
/**
|
|
231
|
+
* Throws if the asset is not permitted for the given operation.
|
|
232
|
+
* Passing `undefined` (omitted) is always valid — defaults to USDC.
|
|
233
|
+
*/
|
|
234
|
+
declare function assertAllowedAsset(op: Operation, asset: string | undefined): void;
|
|
220
235
|
declare const DEFAULT_NETWORK: "mainnet";
|
|
221
236
|
declare const CETUS_USDC_SUI_POOL = "0x51e883ba7c0b566a26cbc8a94cd33eb0abd418a77cc1e60ad22fd9b1f29cd2ab";
|
|
222
237
|
declare const GAS_RESERVE_MIN = 0.05;
|
|
@@ -352,4 +367,4 @@ declare const IKA_TYPE: string;
|
|
|
352
367
|
declare const LOFI_TYPE: string;
|
|
353
368
|
declare const MANIFEST_TYPE: string;
|
|
354
369
|
|
|
355
|
-
export { formatAssetAmount 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, USDSUI_TYPE as H, IKA_TYPE as I, USDT_TYPE as J, KeypairSigner as K, LOFI_TYPE as L, MANIFEST_TYPE as M, NAVX_TYPE as N, OUTBOUND_OPS as O, type ProtocolFeeInfo as P, WBTC_TYPE as Q, ZkLoginSigner as R, STABLE_ASSETS as S, T2000Error as T, USDC_DECIMALS as U, addCollectFeeToTx as V, WAL_TYPE as W, calculateFee as X, executeAutoTopUp as Y, type ZkLoginProof as Z, executeWithGas as _, type AutoTopUpResult as a, formatSui as a0, formatUsd as a1, getDecimals as a2, getDecimalsForCoinType as a3, getGasStatus as a4, getTier as a5, isSupported as a6, isTier1 as a7, isTier2 as a8, mapMoveAbortCode as a9, mapWalletError as aa, mistToSui as ab, rawToStable as ac, rawToUsdc as ad, resolveSymbol as ae, resolveTokenType as af, shouldAutoTopUp as ag, stableToRaw as ah, suiToMist as ai, truncateAddress as aj, usdcToRaw as ak, validateAddress as al, SafeguardEnforcer as am, CETUS_USDC_SUI_POOL as an,
|
|
370
|
+
export { formatAssetAmount 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, USDSUI_TYPE as H, IKA_TYPE as I, USDT_TYPE as J, KeypairSigner as K, LOFI_TYPE as L, MANIFEST_TYPE as M, NAVX_TYPE as N, OUTBOUND_OPS as O, type ProtocolFeeInfo as P, WBTC_TYPE as Q, ZkLoginSigner as R, STABLE_ASSETS as S, T2000Error as T, USDC_DECIMALS as U, addCollectFeeToTx as V, WAL_TYPE as W, calculateFee as X, executeAutoTopUp as Y, type ZkLoginProof as Z, executeWithGas as _, type AutoTopUpResult as a, formatSui as a0, formatUsd as a1, getDecimals as a2, getDecimalsForCoinType as a3, getGasStatus as a4, getTier as a5, isSupported as a6, isTier1 as a7, isTier2 as a8, mapMoveAbortCode as a9, mapWalletError as aa, mistToSui as ab, rawToStable as ac, rawToUsdc as ad, resolveSymbol as ae, resolveTokenType as af, shouldAutoTopUp as ag, stableToRaw as ah, suiToMist as ai, truncateAddress as aj, usdcToRaw as ak, validateAddress as al, SafeguardEnforcer as am, CETUS_USDC_SUI_POOL as an, OPERATION_ASSETS as ao, type Operation as ap, assertAllowedAsset as aq, isAllowedAsset as ar, simulateTransaction as as, throwIfSimulationFailed as at, COIN_REGISTRY as b, type CoinMeta as c, DEFAULT_SAFEGUARD_CONFIG as d, type GasExecutionResult as e, type GasRequestType as f, type GasSponsorResponse as g, type GasStatusResponse 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 SupportedAsset as s, type T2000ErrorCode as t, type T2000ErrorData as u, TOKEN_MAP as v, type TransactionSigner as w, type TxMetadata as x, USDC_TYPE as y, USDE_TYPE as z };
|
|
@@ -84,7 +84,7 @@ interface TxMetadata {
|
|
|
84
84
|
operation: 'send' | 'save' | 'withdraw' | 'borrow' | 'repay' | 'pay';
|
|
85
85
|
amount?: number;
|
|
86
86
|
}
|
|
87
|
-
declare const OUTBOUND_OPS: Set<"save" | "borrow" | "
|
|
87
|
+
declare const OUTBOUND_OPS: Set<"save" | "borrow" | "withdraw" | "repay" | "send" | "pay">;
|
|
88
88
|
declare const DEFAULT_SAFEGUARD_CONFIG: SafeguardConfig;
|
|
89
89
|
|
|
90
90
|
declare class SafeguardEnforcer {
|
|
@@ -217,6 +217,21 @@ type SupportedAsset = keyof typeof SUPPORTED_ASSETS;
|
|
|
217
217
|
type StableAsset = 'USDC';
|
|
218
218
|
declare const STABLE_ASSETS: readonly StableAsset[];
|
|
219
219
|
declare const ALL_NAVI_ASSETS: readonly SupportedAsset[];
|
|
220
|
+
declare const OPERATION_ASSETS: {
|
|
221
|
+
readonly save: readonly ["USDC"];
|
|
222
|
+
readonly borrow: readonly ["USDC"];
|
|
223
|
+
readonly withdraw: "*";
|
|
224
|
+
readonly repay: "*";
|
|
225
|
+
readonly send: "*";
|
|
226
|
+
readonly swap: "*";
|
|
227
|
+
};
|
|
228
|
+
type Operation = keyof typeof OPERATION_ASSETS;
|
|
229
|
+
declare function isAllowedAsset(op: Operation, asset: string): boolean;
|
|
230
|
+
/**
|
|
231
|
+
* Throws if the asset is not permitted for the given operation.
|
|
232
|
+
* Passing `undefined` (omitted) is always valid — defaults to USDC.
|
|
233
|
+
*/
|
|
234
|
+
declare function assertAllowedAsset(op: Operation, asset: string | undefined): void;
|
|
220
235
|
declare const DEFAULT_NETWORK: "mainnet";
|
|
221
236
|
declare const CETUS_USDC_SUI_POOL = "0x51e883ba7c0b566a26cbc8a94cd33eb0abd418a77cc1e60ad22fd9b1f29cd2ab";
|
|
222
237
|
declare const GAS_RESERVE_MIN = 0.05;
|
|
@@ -352,4 +367,4 @@ declare const IKA_TYPE: string;
|
|
|
352
367
|
declare const LOFI_TYPE: string;
|
|
353
368
|
declare const MANIFEST_TYPE: string;
|
|
354
369
|
|
|
355
|
-
export { formatAssetAmount 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, USDSUI_TYPE as H, IKA_TYPE as I, USDT_TYPE as J, KeypairSigner as K, LOFI_TYPE as L, MANIFEST_TYPE as M, NAVX_TYPE as N, OUTBOUND_OPS as O, type ProtocolFeeInfo as P, WBTC_TYPE as Q, ZkLoginSigner as R, STABLE_ASSETS as S, T2000Error as T, USDC_DECIMALS as U, addCollectFeeToTx as V, WAL_TYPE as W, calculateFee as X, executeAutoTopUp as Y, type ZkLoginProof as Z, executeWithGas as _, type AutoTopUpResult as a, formatSui as a0, formatUsd as a1, getDecimals as a2, getDecimalsForCoinType as a3, getGasStatus as a4, getTier as a5, isSupported as a6, isTier1 as a7, isTier2 as a8, mapMoveAbortCode as a9, mapWalletError as aa, mistToSui as ab, rawToStable as ac, rawToUsdc as ad, resolveSymbol as ae, resolveTokenType as af, shouldAutoTopUp as ag, stableToRaw as ah, suiToMist as ai, truncateAddress as aj, usdcToRaw as ak, validateAddress as al, SafeguardEnforcer as am, CETUS_USDC_SUI_POOL as an,
|
|
370
|
+
export { formatAssetAmount 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, USDSUI_TYPE as H, IKA_TYPE as I, USDT_TYPE as J, KeypairSigner as K, LOFI_TYPE as L, MANIFEST_TYPE as M, NAVX_TYPE as N, OUTBOUND_OPS as O, type ProtocolFeeInfo as P, WBTC_TYPE as Q, ZkLoginSigner as R, STABLE_ASSETS as S, T2000Error as T, USDC_DECIMALS as U, addCollectFeeToTx as V, WAL_TYPE as W, calculateFee as X, executeAutoTopUp as Y, type ZkLoginProof as Z, executeWithGas as _, type AutoTopUpResult as a, formatSui as a0, formatUsd as a1, getDecimals as a2, getDecimalsForCoinType as a3, getGasStatus as a4, getTier as a5, isSupported as a6, isTier1 as a7, isTier2 as a8, mapMoveAbortCode as a9, mapWalletError as aa, mistToSui as ab, rawToStable as ac, rawToUsdc as ad, resolveSymbol as ae, resolveTokenType as af, shouldAutoTopUp as ag, stableToRaw as ah, suiToMist as ai, truncateAddress as aj, usdcToRaw as ak, validateAddress as al, SafeguardEnforcer as am, CETUS_USDC_SUI_POOL as an, OPERATION_ASSETS as ao, type Operation as ap, assertAllowedAsset as aq, isAllowedAsset as ar, simulateTransaction as as, throwIfSimulationFailed as at, COIN_REGISTRY as b, type CoinMeta as c, DEFAULT_SAFEGUARD_CONFIG as d, type GasExecutionResult as e, type GasRequestType as f, type GasSponsorResponse as g, type GasStatusResponse 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 SupportedAsset as s, type T2000ErrorCode as t, type T2000ErrorData as u, TOKEN_MAP as v, type TransactionSigner as w, type TxMetadata as x, USDC_TYPE as y, USDE_TYPE as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@t2000/sdk",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.3",
|
|
4
4
|
"description": "TypeScript SDK for AI agent bank accounts on Sui — send, save, borrow, rebalance",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -70,6 +70,7 @@
|
|
|
70
70
|
"build": "tsup",
|
|
71
71
|
"dev": "tsup --watch",
|
|
72
72
|
"test": "vitest run",
|
|
73
|
+
"test:smoke": "SMOKE=1 vitest run",
|
|
73
74
|
"test:watch": "vitest",
|
|
74
75
|
"typecheck": "tsc --noEmit",
|
|
75
76
|
"lint": "eslint src/",
|