@t2000/sdk 9.7.1 → 9.9.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/dist/browser.cjs +39 -4
- 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 +37 -5
- package/dist/browser.js.map +1 -1
- package/dist/index.cjs +39 -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 +37 -5
- package/dist/index.js.map +1 -1
- package/dist/{job-CSq0DRsC.d.cts → job-DXi8e8eA.d.cts} +16 -4
- package/dist/{job-CSq0DRsC.d.ts → job-DXi8e8eA.d.ts} +16 -4
- package/package.json +2 -2
|
@@ -299,7 +299,7 @@ type SponsoredCoinMergeCache = Map<string, {
|
|
|
299
299
|
*/
|
|
300
300
|
declare function selectSuiCoin(tx: Transaction, client: SuiCoreClient, owner: string, amountMist: bigint, sponsoredContext: boolean, mergeCache?: SponsoredCoinMergeCache): Promise<SelectAndSplitResult>;
|
|
301
301
|
|
|
302
|
-
type T2000ErrorCode = 'INSUFFICIENT_BALANCE' | 'ADDRESS_BALANCE_UNSPONSORABLE' | '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' | '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' | 'DIALECT_UNSUPPORTED' | 'CHAIN_MODE_INVALID' | 'INFERENCE_FAILED' | 'UNKNOWN';
|
|
302
|
+
type T2000ErrorCode = 'INSUFFICIENT_BALANCE' | 'ADDRESS_BALANCE_UNSPONSORABLE' | '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' | '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' | 'DIALECT_UNSUPPORTED' | 'ESCROW_REQUIRED' | 'CHAIN_MODE_INVALID' | 'INFERENCE_FAILED' | 'UNKNOWN';
|
|
303
303
|
interface T2000ErrorData {
|
|
304
304
|
reason?: string;
|
|
305
305
|
[key: string]: unknown;
|
|
@@ -1382,14 +1382,23 @@ declare function addSendToTx(tx: Transaction, coin: TransactionObjectArgument, r
|
|
|
1382
1382
|
* Browser-safe (no fs / keyManager imports) so store surfaces can build the
|
|
1383
1383
|
* buyer-side legs on a zkLogin session key.
|
|
1384
1384
|
*
|
|
1385
|
-
*
|
|
1385
|
+
* v2 deployed FRESH on Sui mainnet 2026-07-18 (fix-and-redeploy over upgrade —
|
|
1386
|
+
* v1 had no users). v2 adds the 2.5% in-contract protocol fee (D-1,
|
|
1387
|
+
* SPEC_ACP_SUI §7) snapshotted onto the Job at create, FeeConfig versioning,
|
|
1388
|
+
* and bounded windows. Override via env for testnet/dev.
|
|
1386
1389
|
*/
|
|
1387
|
-
/** The published `a2a_escrow` package id (mainnet). */
|
|
1390
|
+
/** The published `a2a_escrow` package id (mainnet, v2). */
|
|
1388
1391
|
declare const A2A_ESCROW_PACKAGE_ID: string;
|
|
1392
|
+
/** The shared `FeeConfig` object every escrow entry reads (mainnet, v2). */
|
|
1393
|
+
declare const A2A_ESCROW_FEE_CONFIG_ID: string;
|
|
1389
1394
|
/** v1 job-value cap in USDC — same instinct as the catalog price cap: the
|
|
1390
1395
|
* no-arbitration reject-split is only fair at sizes where neither side is
|
|
1391
1396
|
* incentivized to game it (SPEC_A2A_ESCROW §2). */
|
|
1392
1397
|
declare const MAX_JOB_USDC = 50;
|
|
1398
|
+
/** Contract-enforced create bounds (mirror `escrow.move` v2 — the caps that
|
|
1399
|
+
* close the v1 unbounded-window overflow lock). */
|
|
1400
|
+
declare const MAX_REVIEW_WINDOW_MS = 2592000000;
|
|
1401
|
+
declare const MAX_DELIVER_HORIZON_MS = 31536000000;
|
|
1393
1402
|
/** Job lifecycle states, mirroring the Move constants. */
|
|
1394
1403
|
declare const JOB_STATES: readonly ["funded", "delivered", "released", "refunded", "rejected"];
|
|
1395
1404
|
type JobState = (typeof JOB_STATES)[number];
|
|
@@ -1416,6 +1425,9 @@ interface Job {
|
|
|
1416
1425
|
amountUsdc: number;
|
|
1417
1426
|
/** What's still in the object — 0 after settlement. */
|
|
1418
1427
|
escrowUsdc: number;
|
|
1428
|
+
/** Protocol fee bps snapshotted at create (taken from seller-bound funds
|
|
1429
|
+
* at settlement; refunds are fee-free). */
|
|
1430
|
+
feeBps: number;
|
|
1419
1431
|
specHash: string;
|
|
1420
1432
|
deliverByMs: number;
|
|
1421
1433
|
reviewWindowMs: number;
|
|
@@ -1475,4 +1487,4 @@ declare function verifyJobForSeller({ client, jobId, seller, minAmountUsdc, minR
|
|
|
1475
1487
|
minRunwayMs?: number;
|
|
1476
1488
|
}): Promise<JobVerification>;
|
|
1477
1489
|
|
|
1478
|
-
export {
|
|
1490
|
+
export { type TransactionRecord as $, A2A_ESCROW_FEE_CONFIG_ID as A, type BalanceResponse as B, CLOCK_ID as C, DEFAULT_NETWORK as D, ETH_TYPE as E, type SimulationResult as F, GAS_RESERVE_MIN as G, type StableAsset as H, IKA_TYPE as I, JOB_STATES as J, KNOWN_TARGETS as K, LABEL_PATTERNS as L, MANIFEST_TYPE as M, NAVX_TYPE as N, OVERLAY_FEE_RATE as O, PREFLIGHT_MAX_AMOUNT as P, type SuiHolding as Q, type SuiRpcTxBlock as R, STABLE_ASSETS as S, type SupportedAsset as T, type SwapRouteResult as U, T2000Error as V, type T2000ErrorCode as W, type T2000ErrorData as X, T2000_OVERLAY_FEE_WALLET as Y, TOKEN_MAP as Z, type TransactionLeg as _, A2A_ESCROW_PACKAGE_ID as a, type SuiCoreClient as a$, type TransactionSigner as a0, type TxDirection as a1, USDC_DECIMALS as a2, USDC_TYPE as a3, USDE_TYPE as a4, USDSUI_TYPE as a5, USDT_TYPE as a6, WAL_TYPE as a7, WBTC_TYPE as a8, type ZkLoginProof as a9, jobActionsFor as aA, mapMoveAbortCode as aB, mapWalletError as aC, mistToSui as aD, parseMppSuiChallenge as aE, parseSuiRpcTx as aF, payWithMpp as aG, preflightCreateJob as aH, preflightFail as aI, preflightPay as aJ, preflightSend as aK, preflightSwap as aL, rawToStable as aM, rawToUsdc as aN, refineLendingLabel as aO, resolveSymbol as aP, resolveTokenType as aQ, stableToRaw as aR, suiToMist as aS, truncateAddress as aT, usdcToRaw as aU, validateAddress as aV, verifyJobForSeller as aW, type T2000Options as aX, type SwapResult as aY, type SwapQuoteResult as aZ, type PaymentRequest as a_, ZkLoginSigner as aa, buildCreateJobTx as ab, buildDeliverJobTx as ac, buildRefundJobTx as ad, buildRejectJobTx as ae, buildReleaseJobTx as af, buildSendTx as ag, buildSwapTx as ah, checkPositiveAmount as ai, checkSuiAddress as aj, classifyAction as ak, classifyLabel as al, classifyTransaction as am, executeTx as an, extractAllUserLegs as ao, extractTransferDetails as ap, extractTxCommands as aq, extractTxSender as ar, fallbackLabel as as, findSwapRoute as at, formatAssetAmount as au, formatSui as av, formatUsd as aw, getDecimals as ax, getDecimalsForCoinType as ay, getJob as az, COIN_REGISTRY as b, type SponsoredCoinMergeCache as b0, type SendableAsset as b1, CETUS_USDC_SUI_POOL as b2, type CoinPage as b3, DEFAULT_GRPC_URL as b4, GASLESS_MIN_STABLE_AMOUNT as b5, GASLESS_STABLE_TYPES as b6, OPERATION_ASSETS as b7, type Operation as b8, SENDABLE_ASSETS as b9, type SelectAndSplitResult as ba, type SerializedCetusRoute as bb, type SerializedCetusRoutePath as bc, type SerializedRouterDataV3 as bd, addSendToTx as be, addSwapToTx as bf, assertAllowedAsset as bg, deserializeCetusRoute as bh, fetchAllCoins as bi, getCoinMeta as bj, getSuiClient as bk, getSuiGrpcClient as bl, isAllowedAsset as bm, isCetusRouteFresh as bn, isInRegistry as bo, normalizeAsset as bp, normalizeCoinType as bq, queryHistory as br, queryTransaction as bs, selectAndSplitCoin as bt, selectSuiCoin as bu, serializeCetusRoute as bv, simulateTransaction as bw, throwIfSimulationFailed as bx, verifyCetusRouteCoinMatch as by, type ClassifyBalanceChange as c, type ClassifyResult as d, type CoinMeta as e, type DepositInfo as f, type ExtractedTransfer as g, type Job as h, type JobState as i, type JobTerms as j, type JobVerification as k, KeypairSigner as l, LOFI_TYPE as m, MAX_DELIVER_HORIZON_MS as n, MAX_JOB_USDC as o, MAX_REVIEW_WINDOW_MS as p, MIST_PER_SUI as q, type OverlayFeeConfig as r, PREFLIGHT_OK as s, type PayOptions as t, type PayResult as u, type PreflightResult as v, SUI_DECIMALS as w, SUI_TYPE as x, SUPPORTED_ASSETS as y, type SendResult as z };
|
|
@@ -299,7 +299,7 @@ type SponsoredCoinMergeCache = Map<string, {
|
|
|
299
299
|
*/
|
|
300
300
|
declare function selectSuiCoin(tx: Transaction, client: SuiCoreClient, owner: string, amountMist: bigint, sponsoredContext: boolean, mergeCache?: SponsoredCoinMergeCache): Promise<SelectAndSplitResult>;
|
|
301
301
|
|
|
302
|
-
type T2000ErrorCode = 'INSUFFICIENT_BALANCE' | 'ADDRESS_BALANCE_UNSPONSORABLE' | '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' | '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' | 'DIALECT_UNSUPPORTED' | 'CHAIN_MODE_INVALID' | 'INFERENCE_FAILED' | 'UNKNOWN';
|
|
302
|
+
type T2000ErrorCode = 'INSUFFICIENT_BALANCE' | 'ADDRESS_BALANCE_UNSPONSORABLE' | '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' | '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' | 'DIALECT_UNSUPPORTED' | 'ESCROW_REQUIRED' | 'CHAIN_MODE_INVALID' | 'INFERENCE_FAILED' | 'UNKNOWN';
|
|
303
303
|
interface T2000ErrorData {
|
|
304
304
|
reason?: string;
|
|
305
305
|
[key: string]: unknown;
|
|
@@ -1382,14 +1382,23 @@ declare function addSendToTx(tx: Transaction, coin: TransactionObjectArgument, r
|
|
|
1382
1382
|
* Browser-safe (no fs / keyManager imports) so store surfaces can build the
|
|
1383
1383
|
* buyer-side legs on a zkLogin session key.
|
|
1384
1384
|
*
|
|
1385
|
-
*
|
|
1385
|
+
* v2 deployed FRESH on Sui mainnet 2026-07-18 (fix-and-redeploy over upgrade —
|
|
1386
|
+
* v1 had no users). v2 adds the 2.5% in-contract protocol fee (D-1,
|
|
1387
|
+
* SPEC_ACP_SUI §7) snapshotted onto the Job at create, FeeConfig versioning,
|
|
1388
|
+
* and bounded windows. Override via env for testnet/dev.
|
|
1386
1389
|
*/
|
|
1387
|
-
/** The published `a2a_escrow` package id (mainnet). */
|
|
1390
|
+
/** The published `a2a_escrow` package id (mainnet, v2). */
|
|
1388
1391
|
declare const A2A_ESCROW_PACKAGE_ID: string;
|
|
1392
|
+
/** The shared `FeeConfig` object every escrow entry reads (mainnet, v2). */
|
|
1393
|
+
declare const A2A_ESCROW_FEE_CONFIG_ID: string;
|
|
1389
1394
|
/** v1 job-value cap in USDC — same instinct as the catalog price cap: the
|
|
1390
1395
|
* no-arbitration reject-split is only fair at sizes where neither side is
|
|
1391
1396
|
* incentivized to game it (SPEC_A2A_ESCROW §2). */
|
|
1392
1397
|
declare const MAX_JOB_USDC = 50;
|
|
1398
|
+
/** Contract-enforced create bounds (mirror `escrow.move` v2 — the caps that
|
|
1399
|
+
* close the v1 unbounded-window overflow lock). */
|
|
1400
|
+
declare const MAX_REVIEW_WINDOW_MS = 2592000000;
|
|
1401
|
+
declare const MAX_DELIVER_HORIZON_MS = 31536000000;
|
|
1393
1402
|
/** Job lifecycle states, mirroring the Move constants. */
|
|
1394
1403
|
declare const JOB_STATES: readonly ["funded", "delivered", "released", "refunded", "rejected"];
|
|
1395
1404
|
type JobState = (typeof JOB_STATES)[number];
|
|
@@ -1416,6 +1425,9 @@ interface Job {
|
|
|
1416
1425
|
amountUsdc: number;
|
|
1417
1426
|
/** What's still in the object — 0 after settlement. */
|
|
1418
1427
|
escrowUsdc: number;
|
|
1428
|
+
/** Protocol fee bps snapshotted at create (taken from seller-bound funds
|
|
1429
|
+
* at settlement; refunds are fee-free). */
|
|
1430
|
+
feeBps: number;
|
|
1419
1431
|
specHash: string;
|
|
1420
1432
|
deliverByMs: number;
|
|
1421
1433
|
reviewWindowMs: number;
|
|
@@ -1475,4 +1487,4 @@ declare function verifyJobForSeller({ client, jobId, seller, minAmountUsdc, minR
|
|
|
1475
1487
|
minRunwayMs?: number;
|
|
1476
1488
|
}): Promise<JobVerification>;
|
|
1477
1489
|
|
|
1478
|
-
export {
|
|
1490
|
+
export { type TransactionRecord as $, A2A_ESCROW_FEE_CONFIG_ID as A, type BalanceResponse as B, CLOCK_ID as C, DEFAULT_NETWORK as D, ETH_TYPE as E, type SimulationResult as F, GAS_RESERVE_MIN as G, type StableAsset as H, IKA_TYPE as I, JOB_STATES as J, KNOWN_TARGETS as K, LABEL_PATTERNS as L, MANIFEST_TYPE as M, NAVX_TYPE as N, OVERLAY_FEE_RATE as O, PREFLIGHT_MAX_AMOUNT as P, type SuiHolding as Q, type SuiRpcTxBlock as R, STABLE_ASSETS as S, type SupportedAsset as T, type SwapRouteResult as U, T2000Error as V, type T2000ErrorCode as W, type T2000ErrorData as X, T2000_OVERLAY_FEE_WALLET as Y, TOKEN_MAP as Z, type TransactionLeg as _, A2A_ESCROW_PACKAGE_ID as a, type SuiCoreClient as a$, type TransactionSigner as a0, type TxDirection as a1, USDC_DECIMALS as a2, USDC_TYPE as a3, USDE_TYPE as a4, USDSUI_TYPE as a5, USDT_TYPE as a6, WAL_TYPE as a7, WBTC_TYPE as a8, type ZkLoginProof as a9, jobActionsFor as aA, mapMoveAbortCode as aB, mapWalletError as aC, mistToSui as aD, parseMppSuiChallenge as aE, parseSuiRpcTx as aF, payWithMpp as aG, preflightCreateJob as aH, preflightFail as aI, preflightPay as aJ, preflightSend as aK, preflightSwap as aL, rawToStable as aM, rawToUsdc as aN, refineLendingLabel as aO, resolveSymbol as aP, resolveTokenType as aQ, stableToRaw as aR, suiToMist as aS, truncateAddress as aT, usdcToRaw as aU, validateAddress as aV, verifyJobForSeller as aW, type T2000Options as aX, type SwapResult as aY, type SwapQuoteResult as aZ, type PaymentRequest as a_, ZkLoginSigner as aa, buildCreateJobTx as ab, buildDeliverJobTx as ac, buildRefundJobTx as ad, buildRejectJobTx as ae, buildReleaseJobTx as af, buildSendTx as ag, buildSwapTx as ah, checkPositiveAmount as ai, checkSuiAddress as aj, classifyAction as ak, classifyLabel as al, classifyTransaction as am, executeTx as an, extractAllUserLegs as ao, extractTransferDetails as ap, extractTxCommands as aq, extractTxSender as ar, fallbackLabel as as, findSwapRoute as at, formatAssetAmount as au, formatSui as av, formatUsd as aw, getDecimals as ax, getDecimalsForCoinType as ay, getJob as az, COIN_REGISTRY as b, type SponsoredCoinMergeCache as b0, type SendableAsset as b1, CETUS_USDC_SUI_POOL as b2, type CoinPage as b3, DEFAULT_GRPC_URL as b4, GASLESS_MIN_STABLE_AMOUNT as b5, GASLESS_STABLE_TYPES as b6, OPERATION_ASSETS as b7, type Operation as b8, SENDABLE_ASSETS as b9, type SelectAndSplitResult as ba, type SerializedCetusRoute as bb, type SerializedCetusRoutePath as bc, type SerializedRouterDataV3 as bd, addSendToTx as be, addSwapToTx as bf, assertAllowedAsset as bg, deserializeCetusRoute as bh, fetchAllCoins as bi, getCoinMeta as bj, getSuiClient as bk, getSuiGrpcClient as bl, isAllowedAsset as bm, isCetusRouteFresh as bn, isInRegistry as bo, normalizeAsset as bp, normalizeCoinType as bq, queryHistory as br, queryTransaction as bs, selectAndSplitCoin as bt, selectSuiCoin as bu, serializeCetusRoute as bv, simulateTransaction as bw, throwIfSimulationFailed as bx, verifyCetusRouteCoinMatch as by, type ClassifyBalanceChange as c, type ClassifyResult as d, type CoinMeta as e, type DepositInfo as f, type ExtractedTransfer as g, type Job as h, type JobState as i, type JobTerms as j, type JobVerification as k, KeypairSigner as l, LOFI_TYPE as m, MAX_DELIVER_HORIZON_MS as n, MAX_JOB_USDC as o, MAX_REVIEW_WINDOW_MS as p, MIST_PER_SUI as q, type OverlayFeeConfig as r, PREFLIGHT_OK as s, type PayOptions as t, type PayResult as u, type PreflightResult as v, SUI_DECIMALS as w, SUI_TYPE as x, SUPPORTED_ASSETS as y, type SendResult as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@t2000/sdk",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.9.0",
|
|
4
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",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@noble/curves": "^1.9.0",
|
|
51
51
|
"@noble/hashes": "^1.8.0",
|
|
52
52
|
"@phala/dcap-qvl": "^0.5.2",
|
|
53
|
-
"@suimpp/mpp": "^0.
|
|
53
|
+
"@suimpp/mpp": "^0.9.0",
|
|
54
54
|
"bn.js": "^5.2.1",
|
|
55
55
|
"eventemitter3": "^5",
|
|
56
56
|
"mppx": "^0.4.9"
|