@t2000/sdk 3.3.0 → 4.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/README.md +19 -322
- package/dist/adapters/index.cjs.map +1 -1
- package/dist/adapters/index.js.map +1 -1
- package/dist/browser.cjs +5 -0
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.cts +2 -1
- package/dist/browser.d.ts +2 -1
- package/dist/browser.js +5 -0
- package/dist/browser.js.map +1 -1
- package/dist/index.cjs +245 -112
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +117 -16
- package/dist/index.d.ts +117 -16
- package/dist/index.js +238 -113
- package/dist/index.js.map +1 -1
- package/dist/{types-C1DH4kPA.d.cts → types-CqpN8a8R.d.cts} +55 -4
- package/dist/{types-DjeENMuV.d.ts → types-_U9XXGFR.d.ts} +55 -4
- package/package.json +7 -4
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
|
|
2
2
|
import { SuiJsonRpcClient } from '@mysten/sui/jsonRpc';
|
|
3
|
+
import { SuiGrpcClient } from '@mysten/sui/grpc';
|
|
3
4
|
import { T as TransactionLeg, k as TransactionRecord } from './types-HJGbXJ37.cjs';
|
|
4
5
|
import { Transaction, TransactionObjectArgument } from '@mysten/sui/transactions';
|
|
5
6
|
|
|
@@ -67,7 +68,7 @@ declare class ZkLoginSigner implements TransactionSigner {
|
|
|
67
68
|
isExpired(currentEpoch: number): boolean;
|
|
68
69
|
}
|
|
69
70
|
|
|
70
|
-
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' | 'SUINS_NOT_REGISTERED' | 'FACILITATOR_TIMEOUT' | 'SAFEGUARD_BLOCKED' | 'SWAP_NO_ROUTE' | 'SWAP_FAILED' | 'CHAIN_MODE_INVALID' | 'UNKNOWN';
|
|
71
|
+
type T2000ErrorCode = 'INSUFFICIENT_BALANCE' | 'INSUFFICIENT_GAS' | 'INVALID_ADDRESS' | 'INVALID_AMOUNT' | 'WALLET_NOT_FOUND' | 'WALLET_LOCKED' | 'WALLET_EXISTS' | 'WALLET_CORRUPT' | 'INVALID_KEY' | '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' | 'SUINS_NOT_REGISTERED' | 'FACILITATOR_TIMEOUT' | 'SAFEGUARD_BLOCKED' | 'SWAP_NO_ROUTE' | 'SWAP_FAILED' | 'CHAIN_MODE_INVALID' | 'UNKNOWN';
|
|
71
72
|
interface T2000ErrorData {
|
|
72
73
|
reason?: string;
|
|
73
74
|
[key: string]: unknown;
|
|
@@ -161,21 +162,71 @@ declare const OPERATION_ASSETS: {
|
|
|
161
162
|
readonly borrow: readonly ["USDC", "USDsui"];
|
|
162
163
|
readonly withdraw: "*";
|
|
163
164
|
readonly repay: "*";
|
|
164
|
-
readonly send: "
|
|
165
|
+
readonly send: readonly ["USDC", "USDsui", "SUI"];
|
|
165
166
|
readonly swap: "*";
|
|
166
167
|
};
|
|
167
168
|
type Operation = keyof typeof OPERATION_ASSETS;
|
|
168
169
|
declare function isAllowedAsset(op: Operation, asset: string): boolean;
|
|
169
170
|
/**
|
|
170
171
|
* Throws if the asset is not permitted for the given operation.
|
|
171
|
-
*
|
|
172
|
+
*
|
|
173
|
+
* [v4.0 Phase A Day 2] Pre-v4 this allowed `undefined` as a silent default
|
|
174
|
+
* to USDC. Removed because every write path now requires explicit asset
|
|
175
|
+
* (see `T2000.send` + `buildSendTx` + `composeTx.send_transfer`). Save /
|
|
176
|
+
* borrow / repay still call this with `params.asset` (which may be
|
|
177
|
+
* undefined when the caller relies on the per-method `?? 'USDC'` default
|
|
178
|
+
* before this assertion fires), so the `undefined → no-op` branch stays
|
|
179
|
+
* for back-compat; the `send_transfer` flow validates non-undefined.
|
|
172
180
|
*/
|
|
173
181
|
declare function assertAllowedAsset(op: Operation, asset: string | undefined): void;
|
|
182
|
+
/**
|
|
183
|
+
* [v4.0 Phase A Day 2] Narrow type alias for assets sendable through the
|
|
184
|
+
* Agent Wallet. Matches `OPERATION_ASSETS.send` exactly. Exported so the
|
|
185
|
+
* CLI / SDK / composeTx can share one type without re-declaring it.
|
|
186
|
+
*/
|
|
187
|
+
type SendableAsset = 'USDC' | 'USDsui' | 'SUI';
|
|
188
|
+
declare const SENDABLE_ASSETS: readonly SendableAsset[];
|
|
189
|
+
/**
|
|
190
|
+
* [v4.0 Phase A Day 2] Coin types for the two gasless-allowlisted stables.
|
|
191
|
+
* Used by `wallet/send.ts` + `composeTx.send_transfer` to construct the
|
|
192
|
+
* `0x2::balance::send_funds` Move call's `typeArguments`. SUI is excluded
|
|
193
|
+
* because SUI transfers are NOT gasless (gas-native, uses `tx.gas` split +
|
|
194
|
+
* `transferObjects` per the existing path).
|
|
195
|
+
*/
|
|
196
|
+
declare const GASLESS_STABLE_TYPES: Record<'USDC' | 'USDsui', string>;
|
|
174
197
|
declare const T2000_OVERLAY_FEE_WALLET: string;
|
|
175
198
|
declare const DEFAULT_NETWORK: "mainnet";
|
|
199
|
+
declare const DEFAULT_GRPC_URL = "https://fullnode.mainnet.sui.io:443";
|
|
200
|
+
declare const GASLESS_MIN_STABLE_AMOUNT = 0.01;
|
|
176
201
|
declare const CETUS_USDC_SUI_POOL = "0x51e883ba7c0b566a26cbc8a94cd33eb0abd418a77cc1e60ad22fd9b1f29cd2ab";
|
|
177
202
|
declare const GAS_RESERVE_MIN = 0.05;
|
|
178
203
|
|
|
204
|
+
declare function getSuiClient(rpcUrl?: string): SuiJsonRpcClient;
|
|
205
|
+
declare function createSuiClient(network?: 'mainnet' | 'testnet'): SuiJsonRpcClient;
|
|
206
|
+
/**
|
|
207
|
+
* Cached `SuiGrpcClient` for gasless stablecoin transfer builds.
|
|
208
|
+
*
|
|
209
|
+
* [v4.0 Phase A Day 2 — SPEC_AGENT_WALLET_GREENFIELD §A]
|
|
210
|
+
*
|
|
211
|
+
* Why this exists: Sui mainnet's protocol-level gasless stablecoin transfers
|
|
212
|
+
* (`0x2::balance::send_funds` on the USDC + USDsui allowlist) are detected
|
|
213
|
+
* ONLY when the transaction is built through a `SuiGrpcClient`. The gRPC
|
|
214
|
+
* client's build resolver inspects the PTB at `tx.build()` time and, if it
|
|
215
|
+
* matches the gasless pattern, sets `gasPrice=0` + `gasBudget=0` automatically.
|
|
216
|
+
* Building the SAME PTB through `SuiJsonRpcClient` produces the same bytes
|
|
217
|
+
* but with non-zero gas — the tx still works, but the user pays SUI gas.
|
|
218
|
+
*
|
|
219
|
+
* Execution stays on JSON-RPC (`SuiJsonRpcClient.executeTransactionBlock`)
|
|
220
|
+
* because (a) the rest of the SDK expects JSON-RPC and (b) Sui's docs
|
|
221
|
+
* explicitly support a "build via gRPC, execute via JSON-RPC" hybrid:
|
|
222
|
+
* https://docs.sui.io/develop/transaction-payment/gasless-stablecoin-transfers
|
|
223
|
+
*
|
|
224
|
+
* Override the endpoint with the `T2000_GRPC_URL` env var or the
|
|
225
|
+
* `grpcUrl` arg. Cache is keyed by URL so multiple endpoints can
|
|
226
|
+
* co-exist (e.g., the rare testnet smoke + production usage from the
|
|
227
|
+
* same process).
|
|
228
|
+
*/
|
|
229
|
+
declare function getSuiGrpcClient(grpcUrl?: string): SuiGrpcClient;
|
|
179
230
|
declare function validateAddress(address: string): string;
|
|
180
231
|
declare function truncateAddress(address: string): string;
|
|
181
232
|
/**
|
|
@@ -597,4 +648,4 @@ interface TxMetadata {
|
|
|
597
648
|
declare const OUTBOUND_OPS: Set<"save" | "borrow" | "withdraw" | "repay" | "send" | "pay">;
|
|
598
649
|
declare const DEFAULT_SAFEGUARD_CONFIG: SafeguardConfig;
|
|
599
650
|
|
|
600
|
-
export { ZkLoginSigner as $, ALL_NAVI_ASSETS as A, BORROW_FEE_BPS as B, CLOCK_ID as C, DEFAULT_NETWORK as D, ETH_TYPE as E, type FeeOperation as F, GAS_RESERVE_MIN as G, type TransactionSigner as H, IKA_TYPE as I, type TxDirection 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 TxMetadata as Q, USDC_TYPE as R, SAVE_FEE_BPS as S, T2000Error as T, USDC_DECIMALS as U, USDE_TYPE as V, USDSUI_TYPE as W, USDT_TYPE as X, WAL_TYPE as Y, WBTC_TYPE as Z, type ZkLoginProof as _, BPS_DENOMINATOR as a, addFeeTransfer as a0, calculateFee as a1, classifyAction as a2, classifyLabel as a3, classifyTransaction as a4, extractAllUserLegs as a5, extractTransferDetails as a6, extractTxCommands as a7, extractTxSender as a8, fallbackLabel as a9,
|
|
651
|
+
export { ZkLoginSigner as $, ALL_NAVI_ASSETS as A, BORROW_FEE_BPS as B, CLOCK_ID as C, DEFAULT_NETWORK as D, ETH_TYPE as E, type FeeOperation as F, GAS_RESERVE_MIN as G, type TransactionSigner as H, IKA_TYPE as I, type TxDirection 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 TxMetadata as Q, USDC_TYPE as R, SAVE_FEE_BPS as S, T2000Error as T, USDC_DECIMALS as U, USDE_TYPE as V, USDSUI_TYPE as W, USDT_TYPE as X, WAL_TYPE as Y, WBTC_TYPE as Z, type ZkLoginProof as _, BPS_DENOMINATOR as a, addFeeTransfer as a0, calculateFee as a1, classifyAction as a2, classifyLabel as a3, classifyTransaction as a4, extractAllUserLegs as a5, extractTransferDetails as a6, extractTxCommands as a7, extractTxSender as a8, fallbackLabel as a9, GASLESS_MIN_STABLE_AMOUNT as aA, GASLESS_STABLE_TYPES as aB, OPERATION_ASSETS as aC, type Operation as aD, SAVEABLE_ASSETS as aE, SENDABLE_ASSETS as aF, type SaveableAsset as aG, assertAllowedAsset as aH, createSuiClient as aI, getCoinMeta as aJ, getSuiClient as aK, getSuiGrpcClient as aL, isAllowedAsset as aM, isInRegistry as aN, normalizeAsset as aO, normalizeCoinType as aP, queryHistory as aQ, queryTransaction as aR, simulateTransaction as aS, throwIfSimulationFailed as aT, formatAssetAmount as aa, formatSui as ab, formatUsd as ac, getDecimals as ad, getDecimalsForCoinType as ae, getTier as af, isSupported as ag, isTier1 as ah, isTier2 as ai, mapMoveAbortCode as aj, mapWalletError as ak, mistToSui as al, parseSuiRpcTx as am, rawToStable as an, rawToUsdc as ao, refineLendingLabel as ap, resolveSymbol as aq, resolveTokenType as ar, stableToRaw as as, suiToMist as at, truncateAddress as au, usdcToRaw as av, validateAddress as aw, type SendableAsset as ax, CETUS_USDC_SUI_POOL as ay, DEFAULT_GRPC_URL 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, KeypairSigner as h, LOFI_TYPE as i, MIST_PER_SUI as j, STABLE_ASSETS as k, SUI_DECIMALS as l, SUI_TYPE as m, SUPPORTED_ASSETS as n, type SafeguardConfig as o, SafeguardError as p, type SafeguardErrorDetails as q, type SafeguardRule as r, type SimulationResult as s, type StableAsset as t, type SuiRpcTxBlock as u, type SupportedAsset as v, type T2000ErrorCode as w, type T2000ErrorData as x, T2000_OVERLAY_FEE_WALLET as y, TOKEN_MAP as z };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
|
|
2
2
|
import { SuiJsonRpcClient } from '@mysten/sui/jsonRpc';
|
|
3
|
+
import { SuiGrpcClient } from '@mysten/sui/grpc';
|
|
3
4
|
import { T as TransactionLeg, k as TransactionRecord } from './types-HJGbXJ37.js';
|
|
4
5
|
import { Transaction, TransactionObjectArgument } from '@mysten/sui/transactions';
|
|
5
6
|
|
|
@@ -67,7 +68,7 @@ declare class ZkLoginSigner implements TransactionSigner {
|
|
|
67
68
|
isExpired(currentEpoch: number): boolean;
|
|
68
69
|
}
|
|
69
70
|
|
|
70
|
-
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' | 'SUINS_NOT_REGISTERED' | 'FACILITATOR_TIMEOUT' | 'SAFEGUARD_BLOCKED' | 'SWAP_NO_ROUTE' | 'SWAP_FAILED' | 'CHAIN_MODE_INVALID' | 'UNKNOWN';
|
|
71
|
+
type T2000ErrorCode = 'INSUFFICIENT_BALANCE' | 'INSUFFICIENT_GAS' | 'INVALID_ADDRESS' | 'INVALID_AMOUNT' | 'WALLET_NOT_FOUND' | 'WALLET_LOCKED' | 'WALLET_EXISTS' | 'WALLET_CORRUPT' | 'INVALID_KEY' | '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' | 'SUINS_NOT_REGISTERED' | 'FACILITATOR_TIMEOUT' | 'SAFEGUARD_BLOCKED' | 'SWAP_NO_ROUTE' | 'SWAP_FAILED' | 'CHAIN_MODE_INVALID' | 'UNKNOWN';
|
|
71
72
|
interface T2000ErrorData {
|
|
72
73
|
reason?: string;
|
|
73
74
|
[key: string]: unknown;
|
|
@@ -161,21 +162,71 @@ declare const OPERATION_ASSETS: {
|
|
|
161
162
|
readonly borrow: readonly ["USDC", "USDsui"];
|
|
162
163
|
readonly withdraw: "*";
|
|
163
164
|
readonly repay: "*";
|
|
164
|
-
readonly send: "
|
|
165
|
+
readonly send: readonly ["USDC", "USDsui", "SUI"];
|
|
165
166
|
readonly swap: "*";
|
|
166
167
|
};
|
|
167
168
|
type Operation = keyof typeof OPERATION_ASSETS;
|
|
168
169
|
declare function isAllowedAsset(op: Operation, asset: string): boolean;
|
|
169
170
|
/**
|
|
170
171
|
* Throws if the asset is not permitted for the given operation.
|
|
171
|
-
*
|
|
172
|
+
*
|
|
173
|
+
* [v4.0 Phase A Day 2] Pre-v4 this allowed `undefined` as a silent default
|
|
174
|
+
* to USDC. Removed because every write path now requires explicit asset
|
|
175
|
+
* (see `T2000.send` + `buildSendTx` + `composeTx.send_transfer`). Save /
|
|
176
|
+
* borrow / repay still call this with `params.asset` (which may be
|
|
177
|
+
* undefined when the caller relies on the per-method `?? 'USDC'` default
|
|
178
|
+
* before this assertion fires), so the `undefined → no-op` branch stays
|
|
179
|
+
* for back-compat; the `send_transfer` flow validates non-undefined.
|
|
172
180
|
*/
|
|
173
181
|
declare function assertAllowedAsset(op: Operation, asset: string | undefined): void;
|
|
182
|
+
/**
|
|
183
|
+
* [v4.0 Phase A Day 2] Narrow type alias for assets sendable through the
|
|
184
|
+
* Agent Wallet. Matches `OPERATION_ASSETS.send` exactly. Exported so the
|
|
185
|
+
* CLI / SDK / composeTx can share one type without re-declaring it.
|
|
186
|
+
*/
|
|
187
|
+
type SendableAsset = 'USDC' | 'USDsui' | 'SUI';
|
|
188
|
+
declare const SENDABLE_ASSETS: readonly SendableAsset[];
|
|
189
|
+
/**
|
|
190
|
+
* [v4.0 Phase A Day 2] Coin types for the two gasless-allowlisted stables.
|
|
191
|
+
* Used by `wallet/send.ts` + `composeTx.send_transfer` to construct the
|
|
192
|
+
* `0x2::balance::send_funds` Move call's `typeArguments`. SUI is excluded
|
|
193
|
+
* because SUI transfers are NOT gasless (gas-native, uses `tx.gas` split +
|
|
194
|
+
* `transferObjects` per the existing path).
|
|
195
|
+
*/
|
|
196
|
+
declare const GASLESS_STABLE_TYPES: Record<'USDC' | 'USDsui', string>;
|
|
174
197
|
declare const T2000_OVERLAY_FEE_WALLET: string;
|
|
175
198
|
declare const DEFAULT_NETWORK: "mainnet";
|
|
199
|
+
declare const DEFAULT_GRPC_URL = "https://fullnode.mainnet.sui.io:443";
|
|
200
|
+
declare const GASLESS_MIN_STABLE_AMOUNT = 0.01;
|
|
176
201
|
declare const CETUS_USDC_SUI_POOL = "0x51e883ba7c0b566a26cbc8a94cd33eb0abd418a77cc1e60ad22fd9b1f29cd2ab";
|
|
177
202
|
declare const GAS_RESERVE_MIN = 0.05;
|
|
178
203
|
|
|
204
|
+
declare function getSuiClient(rpcUrl?: string): SuiJsonRpcClient;
|
|
205
|
+
declare function createSuiClient(network?: 'mainnet' | 'testnet'): SuiJsonRpcClient;
|
|
206
|
+
/**
|
|
207
|
+
* Cached `SuiGrpcClient` for gasless stablecoin transfer builds.
|
|
208
|
+
*
|
|
209
|
+
* [v4.0 Phase A Day 2 — SPEC_AGENT_WALLET_GREENFIELD §A]
|
|
210
|
+
*
|
|
211
|
+
* Why this exists: Sui mainnet's protocol-level gasless stablecoin transfers
|
|
212
|
+
* (`0x2::balance::send_funds` on the USDC + USDsui allowlist) are detected
|
|
213
|
+
* ONLY when the transaction is built through a `SuiGrpcClient`. The gRPC
|
|
214
|
+
* client's build resolver inspects the PTB at `tx.build()` time and, if it
|
|
215
|
+
* matches the gasless pattern, sets `gasPrice=0` + `gasBudget=0` automatically.
|
|
216
|
+
* Building the SAME PTB through `SuiJsonRpcClient` produces the same bytes
|
|
217
|
+
* but with non-zero gas — the tx still works, but the user pays SUI gas.
|
|
218
|
+
*
|
|
219
|
+
* Execution stays on JSON-RPC (`SuiJsonRpcClient.executeTransactionBlock`)
|
|
220
|
+
* because (a) the rest of the SDK expects JSON-RPC and (b) Sui's docs
|
|
221
|
+
* explicitly support a "build via gRPC, execute via JSON-RPC" hybrid:
|
|
222
|
+
* https://docs.sui.io/develop/transaction-payment/gasless-stablecoin-transfers
|
|
223
|
+
*
|
|
224
|
+
* Override the endpoint with the `T2000_GRPC_URL` env var or the
|
|
225
|
+
* `grpcUrl` arg. Cache is keyed by URL so multiple endpoints can
|
|
226
|
+
* co-exist (e.g., the rare testnet smoke + production usage from the
|
|
227
|
+
* same process).
|
|
228
|
+
*/
|
|
229
|
+
declare function getSuiGrpcClient(grpcUrl?: string): SuiGrpcClient;
|
|
179
230
|
declare function validateAddress(address: string): string;
|
|
180
231
|
declare function truncateAddress(address: string): string;
|
|
181
232
|
/**
|
|
@@ -597,4 +648,4 @@ interface TxMetadata {
|
|
|
597
648
|
declare const OUTBOUND_OPS: Set<"save" | "borrow" | "withdraw" | "repay" | "send" | "pay">;
|
|
598
649
|
declare const DEFAULT_SAFEGUARD_CONFIG: SafeguardConfig;
|
|
599
650
|
|
|
600
|
-
export { ZkLoginSigner as $, ALL_NAVI_ASSETS as A, BORROW_FEE_BPS as B, CLOCK_ID as C, DEFAULT_NETWORK as D, ETH_TYPE as E, type FeeOperation as F, GAS_RESERVE_MIN as G, type TransactionSigner as H, IKA_TYPE as I, type TxDirection 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 TxMetadata as Q, USDC_TYPE as R, SAVE_FEE_BPS as S, T2000Error as T, USDC_DECIMALS as U, USDE_TYPE as V, USDSUI_TYPE as W, USDT_TYPE as X, WAL_TYPE as Y, WBTC_TYPE as Z, type ZkLoginProof as _, BPS_DENOMINATOR as a, addFeeTransfer as a0, calculateFee as a1, classifyAction as a2, classifyLabel as a3, classifyTransaction as a4, extractAllUserLegs as a5, extractTransferDetails as a6, extractTxCommands as a7, extractTxSender as a8, fallbackLabel as a9,
|
|
651
|
+
export { ZkLoginSigner as $, ALL_NAVI_ASSETS as A, BORROW_FEE_BPS as B, CLOCK_ID as C, DEFAULT_NETWORK as D, ETH_TYPE as E, type FeeOperation as F, GAS_RESERVE_MIN as G, type TransactionSigner as H, IKA_TYPE as I, type TxDirection 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 TxMetadata as Q, USDC_TYPE as R, SAVE_FEE_BPS as S, T2000Error as T, USDC_DECIMALS as U, USDE_TYPE as V, USDSUI_TYPE as W, USDT_TYPE as X, WAL_TYPE as Y, WBTC_TYPE as Z, type ZkLoginProof as _, BPS_DENOMINATOR as a, addFeeTransfer as a0, calculateFee as a1, classifyAction as a2, classifyLabel as a3, classifyTransaction as a4, extractAllUserLegs as a5, extractTransferDetails as a6, extractTxCommands as a7, extractTxSender as a8, fallbackLabel as a9, GASLESS_MIN_STABLE_AMOUNT as aA, GASLESS_STABLE_TYPES as aB, OPERATION_ASSETS as aC, type Operation as aD, SAVEABLE_ASSETS as aE, SENDABLE_ASSETS as aF, type SaveableAsset as aG, assertAllowedAsset as aH, createSuiClient as aI, getCoinMeta as aJ, getSuiClient as aK, getSuiGrpcClient as aL, isAllowedAsset as aM, isInRegistry as aN, normalizeAsset as aO, normalizeCoinType as aP, queryHistory as aQ, queryTransaction as aR, simulateTransaction as aS, throwIfSimulationFailed as aT, formatAssetAmount as aa, formatSui as ab, formatUsd as ac, getDecimals as ad, getDecimalsForCoinType as ae, getTier as af, isSupported as ag, isTier1 as ah, isTier2 as ai, mapMoveAbortCode as aj, mapWalletError as ak, mistToSui as al, parseSuiRpcTx as am, rawToStable as an, rawToUsdc as ao, refineLendingLabel as ap, resolveSymbol as aq, resolveTokenType as ar, stableToRaw as as, suiToMist as at, truncateAddress as au, usdcToRaw as av, validateAddress as aw, type SendableAsset as ax, CETUS_USDC_SUI_POOL as ay, DEFAULT_GRPC_URL 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, KeypairSigner as h, LOFI_TYPE as i, MIST_PER_SUI as j, STABLE_ASSETS as k, SUI_DECIMALS as l, SUI_TYPE as m, SUPPORTED_ASSETS as n, type SafeguardConfig as o, SafeguardError as p, type SafeguardErrorDetails as q, type SafeguardRule as r, type SimulationResult as s, type StableAsset as t, type SuiRpcTxBlock as u, type SupportedAsset as v, type T2000ErrorCode as w, type T2000ErrorData as x, T2000_OVERLAY_FEE_WALLET as y, TOKEN_MAP as z };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@t2000/sdk",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "TypeScript SDK for
|
|
3
|
+
"version": "4.0.1",
|
|
4
|
+
"description": "TypeScript SDK for Agent Wallets on Sui — gasless USDC + USDsui transfers, Cetus swap routing, NAVI lending (programmatic), MPP paid API access, zkLogin compatible.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
7
7
|
"module": "./dist/index.js",
|
|
@@ -36,10 +36,13 @@
|
|
|
36
36
|
"wallet",
|
|
37
37
|
"ai",
|
|
38
38
|
"agent",
|
|
39
|
-
"defi",
|
|
40
39
|
"sdk",
|
|
41
40
|
"usdc",
|
|
42
|
-
"
|
|
41
|
+
"usdsui",
|
|
42
|
+
"gasless",
|
|
43
|
+
"cetus",
|
|
44
|
+
"navi",
|
|
45
|
+
"zklogin"
|
|
43
46
|
],
|
|
44
47
|
"author": "t2000",
|
|
45
48
|
"repository": {
|