@t2000/sdk 9.8.0 → 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.
@@ -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
- * Deployed on Sui mainnet 2026-07-17. Override via env for testnet/dev.
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 { USDC_DECIMALS as $, A2A_ESCROW_PACKAGE_ID as A, type BalanceResponse as B, CLOCK_ID as C, DEFAULT_NETWORK as D, ETH_TYPE as E, type SuiRpcTxBlock as F, GAS_RESERVE_MIN as G, type SupportedAsset 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 SwapRouteResult as Q, type T2000ErrorCode as R, STABLE_ASSETS as S, T2000Error as T, type T2000ErrorData as U, T2000_OVERLAY_FEE_WALLET as V, TOKEN_MAP as W, type TransactionLeg as X, type TransactionRecord as Y, type TransactionSigner as Z, type TxDirection as _, COIN_REGISTRY as a, CETUS_USDC_SUI_POOL as a$, USDC_TYPE as a0, USDE_TYPE as a1, USDSUI_TYPE as a2, USDT_TYPE as a3, WAL_TYPE as a4, WBTC_TYPE as a5, type ZkLoginProof as a6, ZkLoginSigner as a7, buildCreateJobTx as a8, buildDeliverJobTx as a9, mistToSui as aA, parseMppSuiChallenge as aB, parseSuiRpcTx as aC, payWithMpp as aD, preflightCreateJob as aE, preflightFail as aF, preflightPay as aG, preflightSend as aH, preflightSwap 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, verifyJobForSeller as aT, type T2000Options as aU, type SwapResult as aV, type SwapQuoteResult as aW, type PaymentRequest as aX, type SuiCoreClient as aY, type SponsoredCoinMergeCache as aZ, type SendableAsset as a_, buildRefundJobTx as aa, buildRejectJobTx as ab, buildReleaseJobTx as ac, buildSendTx as ad, buildSwapTx as ae, checkPositiveAmount as af, checkSuiAddress as ag, classifyAction as ah, classifyLabel as ai, classifyTransaction as aj, executeTx as ak, extractAllUserLegs as al, extractTransferDetails as am, extractTxCommands as an, extractTxSender as ao, fallbackLabel as ap, findSwapRoute as aq, formatAssetAmount as ar, formatSui as as, formatUsd as at, getDecimals as au, getDecimalsForCoinType as av, getJob as aw, jobActionsFor as ax, mapMoveAbortCode as ay, mapWalletError as az, type ClassifyBalanceChange as b, type CoinPage as b0, DEFAULT_GRPC_URL as b1, GASLESS_MIN_STABLE_AMOUNT as b2, GASLESS_STABLE_TYPES as b3, OPERATION_ASSETS as b4, type Operation as b5, SENDABLE_ASSETS as b6, type SelectAndSplitResult as b7, type SerializedCetusRoute as b8, type SerializedCetusRoutePath as b9, type SerializedRouterDataV3 as ba, addSendToTx as bb, addSwapToTx as bc, assertAllowedAsset as bd, deserializeCetusRoute as be, fetchAllCoins as bf, getCoinMeta as bg, getSuiClient as bh, getSuiGrpcClient as bi, isAllowedAsset as bj, isCetusRouteFresh as bk, isInRegistry as bl, normalizeAsset as bm, normalizeCoinType as bn, queryHistory as bo, queryTransaction as bp, selectAndSplitCoin as bq, selectSuiCoin as br, serializeCetusRoute as bs, simulateTransaction as bt, throwIfSimulationFailed as bu, verifyCetusRouteCoinMatch as bv, type ClassifyResult as c, type CoinMeta as d, type DepositInfo as e, type ExtractedTransfer as f, type Job as g, type JobState as h, type JobTerms as i, type JobVerification as j, KeypairSigner as k, LOFI_TYPE as l, MAX_JOB_USDC as m, MIST_PER_SUI as n, type OverlayFeeConfig as o, PREFLIGHT_OK as p, type PayOptions as q, type PayResult as r, type PreflightResult as s, SUI_DECIMALS as t, SUI_TYPE as u, SUPPORTED_ASSETS as v, type SendResult as w, type SimulationResult as x, type StableAsset as y, type SuiHolding as z };
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 };
@@ -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
- * Deployed on Sui mainnet 2026-07-17. Override via env for testnet/dev.
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 { USDC_DECIMALS as $, A2A_ESCROW_PACKAGE_ID as A, type BalanceResponse as B, CLOCK_ID as C, DEFAULT_NETWORK as D, ETH_TYPE as E, type SuiRpcTxBlock as F, GAS_RESERVE_MIN as G, type SupportedAsset 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 SwapRouteResult as Q, type T2000ErrorCode as R, STABLE_ASSETS as S, T2000Error as T, type T2000ErrorData as U, T2000_OVERLAY_FEE_WALLET as V, TOKEN_MAP as W, type TransactionLeg as X, type TransactionRecord as Y, type TransactionSigner as Z, type TxDirection as _, COIN_REGISTRY as a, CETUS_USDC_SUI_POOL as a$, USDC_TYPE as a0, USDE_TYPE as a1, USDSUI_TYPE as a2, USDT_TYPE as a3, WAL_TYPE as a4, WBTC_TYPE as a5, type ZkLoginProof as a6, ZkLoginSigner as a7, buildCreateJobTx as a8, buildDeliverJobTx as a9, mistToSui as aA, parseMppSuiChallenge as aB, parseSuiRpcTx as aC, payWithMpp as aD, preflightCreateJob as aE, preflightFail as aF, preflightPay as aG, preflightSend as aH, preflightSwap 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, verifyJobForSeller as aT, type T2000Options as aU, type SwapResult as aV, type SwapQuoteResult as aW, type PaymentRequest as aX, type SuiCoreClient as aY, type SponsoredCoinMergeCache as aZ, type SendableAsset as a_, buildRefundJobTx as aa, buildRejectJobTx as ab, buildReleaseJobTx as ac, buildSendTx as ad, buildSwapTx as ae, checkPositiveAmount as af, checkSuiAddress as ag, classifyAction as ah, classifyLabel as ai, classifyTransaction as aj, executeTx as ak, extractAllUserLegs as al, extractTransferDetails as am, extractTxCommands as an, extractTxSender as ao, fallbackLabel as ap, findSwapRoute as aq, formatAssetAmount as ar, formatSui as as, formatUsd as at, getDecimals as au, getDecimalsForCoinType as av, getJob as aw, jobActionsFor as ax, mapMoveAbortCode as ay, mapWalletError as az, type ClassifyBalanceChange as b, type CoinPage as b0, DEFAULT_GRPC_URL as b1, GASLESS_MIN_STABLE_AMOUNT as b2, GASLESS_STABLE_TYPES as b3, OPERATION_ASSETS as b4, type Operation as b5, SENDABLE_ASSETS as b6, type SelectAndSplitResult as b7, type SerializedCetusRoute as b8, type SerializedCetusRoutePath as b9, type SerializedRouterDataV3 as ba, addSendToTx as bb, addSwapToTx as bc, assertAllowedAsset as bd, deserializeCetusRoute as be, fetchAllCoins as bf, getCoinMeta as bg, getSuiClient as bh, getSuiGrpcClient as bi, isAllowedAsset as bj, isCetusRouteFresh as bk, isInRegistry as bl, normalizeAsset as bm, normalizeCoinType as bn, queryHistory as bo, queryTransaction as bp, selectAndSplitCoin as bq, selectSuiCoin as br, serializeCetusRoute as bs, simulateTransaction as bt, throwIfSimulationFailed as bu, verifyCetusRouteCoinMatch as bv, type ClassifyResult as c, type CoinMeta as d, type DepositInfo as e, type ExtractedTransfer as f, type Job as g, type JobState as h, type JobTerms as i, type JobVerification as j, KeypairSigner as k, LOFI_TYPE as l, MAX_JOB_USDC as m, MIST_PER_SUI as n, type OverlayFeeConfig as o, PREFLIGHT_OK as p, type PayOptions as q, type PayResult as r, type PreflightResult as s, SUI_DECIMALS as t, SUI_TYPE as u, SUPPORTED_ASSETS as v, type SendResult as w, type SimulationResult as x, type StableAsset as y, type SuiHolding as z };
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.8.0",
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",