@t2000/sdk 9.13.0 → 10.0.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/README.md +1 -1
- package/dist/browser.cjs +10 -10
- 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 +9 -9
- package/dist/browser.js.map +1 -1
- package/dist/{commerce-gxlqmkX7.d.cts → commerce-CUGyTRcv.d.cts} +10 -10
- package/dist/{commerce-gxlqmkX7.d.ts → commerce-CUGyTRcv.d.ts} +10 -10
- package/dist/index.cjs +10 -10
- 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 +9 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1383,7 +1383,7 @@ declare function addSendToTx(tx: Transaction, coin: TransactionObjectArgument, r
|
|
|
1383
1383
|
* buyer-side legs on a zkLogin session key.
|
|
1384
1384
|
*
|
|
1385
1385
|
* Deployed on Sui mainnet 2026-07-18 (fresh publish after the contract
|
|
1386
|
-
* review —
|
|
1386
|
+
* review — in-contract protocol fee (5% since 2026-07-19; D-1, SPEC_ACP_SUI §7) snapshotted
|
|
1387
1387
|
* onto the Job at create, FeeConfig versioning, bounded windows). Override
|
|
1388
1388
|
* via env for testnet/dev.
|
|
1389
1389
|
*/
|
|
@@ -1488,8 +1488,8 @@ declare function verifyJobForSeller({ client, jobId, seller, minAmountUsdc, minR
|
|
|
1488
1488
|
}): Promise<JobVerification>;
|
|
1489
1489
|
|
|
1490
1490
|
declare const DEFAULT_COMMERCE_API_BASE = "https://api.t2000.ai/v1";
|
|
1491
|
-
/** The shape the API returns from GET /v1/
|
|
1492
|
-
interface
|
|
1491
|
+
/** The shape the API returns from GET /v1/services. */
|
|
1492
|
+
interface ServiceListing {
|
|
1493
1493
|
agent: string;
|
|
1494
1494
|
agentName: string | null;
|
|
1495
1495
|
agentNumericId: number | null;
|
|
@@ -1504,17 +1504,17 @@ interface OfferingListing {
|
|
|
1504
1504
|
deliverable: string;
|
|
1505
1505
|
retired: boolean;
|
|
1506
1506
|
}
|
|
1507
|
-
/** Browse / list
|
|
1508
|
-
* agent's full catalog (retired included) via `agent`. */
|
|
1509
|
-
declare function
|
|
1507
|
+
/** Browse / list agent services — free-text `query` across every agent, or
|
|
1508
|
+
* one agent's full catalog (retired included) via `agent`. */
|
|
1509
|
+
declare function listServices(base: string, filter?: {
|
|
1510
1510
|
agent?: string;
|
|
1511
1511
|
query?: string;
|
|
1512
1512
|
}): Promise<{
|
|
1513
1513
|
total: number;
|
|
1514
|
-
|
|
1514
|
+
services: ServiceListing[];
|
|
1515
1515
|
}>;
|
|
1516
|
-
/** Fetch one agent's live
|
|
1517
|
-
declare function
|
|
1516
|
+
/** Fetch one agent's live service by slug (the buy-path resolver). */
|
|
1517
|
+
declare function fetchService(base: string, agent: string, slug: string): Promise<ServiceListing>;
|
|
1518
1518
|
/** Upload a job-spec payload to the content-addressed store; returns the
|
|
1519
1519
|
* sha256 (no 0x) the chain pins as `spec_hash`. */
|
|
1520
1520
|
declare function putJobSpec(base: string, content: string): Promise<string>;
|
|
@@ -1522,4 +1522,4 @@ declare function putJobSpec(base: string, content: string): Promise<string>;
|
|
|
1522
1522
|
* the store is untrusted; the chain hash is the authority). */
|
|
1523
1523
|
declare function getJobSpec(base: string, hash: string): Promise<string>;
|
|
1524
1524
|
|
|
1525
|
-
export { TOKEN_MAP as $, A2A_ESCROW_FEE_CONFIG_ID as A, type BalanceResponse as B, CLOCK_ID as C, DEFAULT_COMMERCE_API_BASE as D, ETH_TYPE as E,
|
|
1525
|
+
export { TOKEN_MAP as $, A2A_ESCROW_FEE_CONFIG_ID as A, type BalanceResponse as B, CLOCK_ID as C, DEFAULT_COMMERCE_API_BASE as D, ETH_TYPE as E, type SendResult as F, GAS_RESERVE_MIN as G, type ServiceListing 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 SimulationResult as Q, type StableAsset as R, STABLE_ASSETS as S, type SuiHolding as T, type SuiRpcTxBlock as U, type SupportedAsset as V, type SwapRouteResult as W, T2000Error as X, type T2000ErrorCode as Y, type T2000ErrorData as Z, T2000_OVERLAY_FEE_WALLET as _, A2A_ESCROW_PACKAGE_ID as a, validateAddress as a$, type TransactionLeg as a0, type TransactionRecord as a1, type TransactionSigner as a2, type TxDirection as a3, USDC_DECIMALS as a4, USDC_TYPE as a5, USDE_TYPE as a6, USDSUI_TYPE as a7, USDT_TYPE as a8, WAL_TYPE as a9, getDecimals as aA, getDecimalsForCoinType as aB, getJob as aC, getJobSpec as aD, jobActionsFor as aE, listServices as aF, mapMoveAbortCode as aG, mapWalletError as aH, mistToSui as aI, parseMppSuiChallenge as aJ, parseSuiRpcTx as aK, payWithMpp as aL, preflightCreateJob as aM, preflightFail as aN, preflightPay as aO, preflightSend as aP, preflightSwap as aQ, putJobSpec as aR, rawToStable as aS, rawToUsdc as aT, refineLendingLabel as aU, resolveSymbol as aV, resolveTokenType as aW, stableToRaw as aX, suiToMist as aY, truncateAddress as aZ, usdcToRaw as a_, WBTC_TYPE as aa, type ZkLoginProof as ab, ZkLoginSigner as ac, buildCreateJobTx as ad, buildDeliverJobTx as ae, buildRefundJobTx as af, buildRejectJobTx as ag, buildReleaseJobTx as ah, buildSendTx as ai, buildSwapTx as aj, checkPositiveAmount as ak, checkSuiAddress as al, classifyAction as am, classifyLabel as an, classifyTransaction as ao, executeTx as ap, extractAllUserLegs as aq, extractTransferDetails as ar, extractTxCommands as as, extractTxSender as at, fallbackLabel as au, fetchService as av, findSwapRoute as aw, formatAssetAmount as ax, formatSui as ay, formatUsd as az, COIN_REGISTRY as b, verifyJobForSeller as b0, type T2000Options as b1, type SwapResult as b2, type SwapQuoteResult as b3, type PaymentRequest as b4, type SuiCoreClient as b5, type SponsoredCoinMergeCache as b6, type SendableAsset as b7, CETUS_USDC_SUI_POOL as b8, type CoinPage as b9, selectSuiCoin as bA, serializeCetusRoute as bB, simulateTransaction as bC, throwIfSimulationFailed as bD, verifyCetusRouteCoinMatch as bE, DEFAULT_GRPC_URL as ba, GASLESS_MIN_STABLE_AMOUNT as bb, GASLESS_STABLE_TYPES as bc, OPERATION_ASSETS as bd, type Operation as be, SENDABLE_ASSETS as bf, type SelectAndSplitResult as bg, type SerializedCetusRoute as bh, type SerializedCetusRoutePath as bi, type SerializedRouterDataV3 as bj, addSendToTx as bk, addSwapToTx as bl, assertAllowedAsset as bm, deserializeCetusRoute as bn, fetchAllCoins as bo, getCoinMeta as bp, getSuiClient as bq, getSuiGrpcClient as br, isAllowedAsset as bs, isCetusRouteFresh as bt, isInRegistry as bu, normalizeAsset as bv, normalizeCoinType as bw, queryHistory as bx, queryTransaction as by, selectAndSplitCoin as bz, type ClassifyBalanceChange as c, type ClassifyResult as d, type CoinMeta as e, DEFAULT_NETWORK as f, type DepositInfo as g, type ExtractedTransfer as h, type Job as i, type JobState as j, type JobTerms as k, type JobVerification as l, KeypairSigner as m, LOFI_TYPE as n, MAX_DELIVER_HORIZON_MS as o, MAX_JOB_USDC as p, MAX_REVIEW_WINDOW_MS as q, MIST_PER_SUI as r, type OverlayFeeConfig as s, PREFLIGHT_OK as t, type PayOptions as u, type PayResult as v, type PreflightResult as w, SUI_DECIMALS as x, SUI_TYPE as y, SUPPORTED_ASSETS as z };
|
|
@@ -1383,7 +1383,7 @@ declare function addSendToTx(tx: Transaction, coin: TransactionObjectArgument, r
|
|
|
1383
1383
|
* buyer-side legs on a zkLogin session key.
|
|
1384
1384
|
*
|
|
1385
1385
|
* Deployed on Sui mainnet 2026-07-18 (fresh publish after the contract
|
|
1386
|
-
* review —
|
|
1386
|
+
* review — in-contract protocol fee (5% since 2026-07-19; D-1, SPEC_ACP_SUI §7) snapshotted
|
|
1387
1387
|
* onto the Job at create, FeeConfig versioning, bounded windows). Override
|
|
1388
1388
|
* via env for testnet/dev.
|
|
1389
1389
|
*/
|
|
@@ -1488,8 +1488,8 @@ declare function verifyJobForSeller({ client, jobId, seller, minAmountUsdc, minR
|
|
|
1488
1488
|
}): Promise<JobVerification>;
|
|
1489
1489
|
|
|
1490
1490
|
declare const DEFAULT_COMMERCE_API_BASE = "https://api.t2000.ai/v1";
|
|
1491
|
-
/** The shape the API returns from GET /v1/
|
|
1492
|
-
interface
|
|
1491
|
+
/** The shape the API returns from GET /v1/services. */
|
|
1492
|
+
interface ServiceListing {
|
|
1493
1493
|
agent: string;
|
|
1494
1494
|
agentName: string | null;
|
|
1495
1495
|
agentNumericId: number | null;
|
|
@@ -1504,17 +1504,17 @@ interface OfferingListing {
|
|
|
1504
1504
|
deliverable: string;
|
|
1505
1505
|
retired: boolean;
|
|
1506
1506
|
}
|
|
1507
|
-
/** Browse / list
|
|
1508
|
-
* agent's full catalog (retired included) via `agent`. */
|
|
1509
|
-
declare function
|
|
1507
|
+
/** Browse / list agent services — free-text `query` across every agent, or
|
|
1508
|
+
* one agent's full catalog (retired included) via `agent`. */
|
|
1509
|
+
declare function listServices(base: string, filter?: {
|
|
1510
1510
|
agent?: string;
|
|
1511
1511
|
query?: string;
|
|
1512
1512
|
}): Promise<{
|
|
1513
1513
|
total: number;
|
|
1514
|
-
|
|
1514
|
+
services: ServiceListing[];
|
|
1515
1515
|
}>;
|
|
1516
|
-
/** Fetch one agent's live
|
|
1517
|
-
declare function
|
|
1516
|
+
/** Fetch one agent's live service by slug (the buy-path resolver). */
|
|
1517
|
+
declare function fetchService(base: string, agent: string, slug: string): Promise<ServiceListing>;
|
|
1518
1518
|
/** Upload a job-spec payload to the content-addressed store; returns the
|
|
1519
1519
|
* sha256 (no 0x) the chain pins as `spec_hash`. */
|
|
1520
1520
|
declare function putJobSpec(base: string, content: string): Promise<string>;
|
|
@@ -1522,4 +1522,4 @@ declare function putJobSpec(base: string, content: string): Promise<string>;
|
|
|
1522
1522
|
* the store is untrusted; the chain hash is the authority). */
|
|
1523
1523
|
declare function getJobSpec(base: string, hash: string): Promise<string>;
|
|
1524
1524
|
|
|
1525
|
-
export { TOKEN_MAP as $, A2A_ESCROW_FEE_CONFIG_ID as A, type BalanceResponse as B, CLOCK_ID as C, DEFAULT_COMMERCE_API_BASE as D, ETH_TYPE as E,
|
|
1525
|
+
export { TOKEN_MAP as $, A2A_ESCROW_FEE_CONFIG_ID as A, type BalanceResponse as B, CLOCK_ID as C, DEFAULT_COMMERCE_API_BASE as D, ETH_TYPE as E, type SendResult as F, GAS_RESERVE_MIN as G, type ServiceListing 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 SimulationResult as Q, type StableAsset as R, STABLE_ASSETS as S, type SuiHolding as T, type SuiRpcTxBlock as U, type SupportedAsset as V, type SwapRouteResult as W, T2000Error as X, type T2000ErrorCode as Y, type T2000ErrorData as Z, T2000_OVERLAY_FEE_WALLET as _, A2A_ESCROW_PACKAGE_ID as a, validateAddress as a$, type TransactionLeg as a0, type TransactionRecord as a1, type TransactionSigner as a2, type TxDirection as a3, USDC_DECIMALS as a4, USDC_TYPE as a5, USDE_TYPE as a6, USDSUI_TYPE as a7, USDT_TYPE as a8, WAL_TYPE as a9, getDecimals as aA, getDecimalsForCoinType as aB, getJob as aC, getJobSpec as aD, jobActionsFor as aE, listServices as aF, mapMoveAbortCode as aG, mapWalletError as aH, mistToSui as aI, parseMppSuiChallenge as aJ, parseSuiRpcTx as aK, payWithMpp as aL, preflightCreateJob as aM, preflightFail as aN, preflightPay as aO, preflightSend as aP, preflightSwap as aQ, putJobSpec as aR, rawToStable as aS, rawToUsdc as aT, refineLendingLabel as aU, resolveSymbol as aV, resolveTokenType as aW, stableToRaw as aX, suiToMist as aY, truncateAddress as aZ, usdcToRaw as a_, WBTC_TYPE as aa, type ZkLoginProof as ab, ZkLoginSigner as ac, buildCreateJobTx as ad, buildDeliverJobTx as ae, buildRefundJobTx as af, buildRejectJobTx as ag, buildReleaseJobTx as ah, buildSendTx as ai, buildSwapTx as aj, checkPositiveAmount as ak, checkSuiAddress as al, classifyAction as am, classifyLabel as an, classifyTransaction as ao, executeTx as ap, extractAllUserLegs as aq, extractTransferDetails as ar, extractTxCommands as as, extractTxSender as at, fallbackLabel as au, fetchService as av, findSwapRoute as aw, formatAssetAmount as ax, formatSui as ay, formatUsd as az, COIN_REGISTRY as b, verifyJobForSeller as b0, type T2000Options as b1, type SwapResult as b2, type SwapQuoteResult as b3, type PaymentRequest as b4, type SuiCoreClient as b5, type SponsoredCoinMergeCache as b6, type SendableAsset as b7, CETUS_USDC_SUI_POOL as b8, type CoinPage as b9, selectSuiCoin as bA, serializeCetusRoute as bB, simulateTransaction as bC, throwIfSimulationFailed as bD, verifyCetusRouteCoinMatch as bE, DEFAULT_GRPC_URL as ba, GASLESS_MIN_STABLE_AMOUNT as bb, GASLESS_STABLE_TYPES as bc, OPERATION_ASSETS as bd, type Operation as be, SENDABLE_ASSETS as bf, type SelectAndSplitResult as bg, type SerializedCetusRoute as bh, type SerializedCetusRoutePath as bi, type SerializedRouterDataV3 as bj, addSendToTx as bk, addSwapToTx as bl, assertAllowedAsset as bm, deserializeCetusRoute as bn, fetchAllCoins as bo, getCoinMeta as bp, getSuiClient as bq, getSuiGrpcClient as br, isAllowedAsset as bs, isCetusRouteFresh as bt, isInRegistry as bu, normalizeAsset as bv, normalizeCoinType as bw, queryHistory as bx, queryTransaction as by, selectAndSplitCoin as bz, type ClassifyBalanceChange as c, type ClassifyResult as d, type CoinMeta as e, DEFAULT_NETWORK as f, type DepositInfo as g, type ExtractedTransfer as h, type Job as i, type JobState as j, type JobTerms as k, type JobVerification as l, KeypairSigner as m, LOFI_TYPE as n, MAX_DELIVER_HORIZON_MS as o, MAX_JOB_USDC as p, MAX_REVIEW_WINDOW_MS as q, MIST_PER_SUI as r, type OverlayFeeConfig as s, PREFLIGHT_OK as t, type PayOptions as u, type PayResult as v, type PreflightResult as w, SUI_DECIMALS as x, SUI_TYPE as y, SUPPORTED_ASSETS as z };
|
package/dist/index.cjs
CHANGED
|
@@ -3394,27 +3394,27 @@ async function commerceFetchJson(url, init) {
|
|
|
3394
3394
|
}
|
|
3395
3395
|
return json;
|
|
3396
3396
|
}
|
|
3397
|
-
async function
|
|
3397
|
+
async function listServices(base, filter = {}) {
|
|
3398
3398
|
const params = new URLSearchParams();
|
|
3399
3399
|
if (filter.agent) params.set("agent", filter.agent);
|
|
3400
3400
|
if (filter.query) params.set("q", filter.query);
|
|
3401
3401
|
const qs = params.size > 0 ? `?${params.toString()}` : "";
|
|
3402
|
-
const json = await commerceFetchJson(`${base}/
|
|
3403
|
-
const
|
|
3404
|
-
return { total: json.total ??
|
|
3402
|
+
const json = await commerceFetchJson(`${base}/services${qs}`);
|
|
3403
|
+
const services = json.services ?? [];
|
|
3404
|
+
return { total: json.total ?? services.length, services };
|
|
3405
3405
|
}
|
|
3406
|
-
async function
|
|
3407
|
-
const {
|
|
3406
|
+
async function fetchService(base, agent, slug) {
|
|
3407
|
+
const { services: rows } = await listServices(base, { agent });
|
|
3408
3408
|
const match = rows.find((o) => o.slug === slug.trim().toLowerCase());
|
|
3409
3409
|
if (!match) {
|
|
3410
3410
|
const live = rows.filter((o) => !o.retired).map((o) => o.slug);
|
|
3411
3411
|
throw new Error(
|
|
3412
|
-
`Agent ${truncateAddress(agent)} has no
|
|
3412
|
+
`Agent ${truncateAddress(agent)} has no service "${slug}".` + (live.length > 0 ? ` Live services: ${live.join(", ")}` : "")
|
|
3413
3413
|
);
|
|
3414
3414
|
}
|
|
3415
3415
|
if (match.retired) {
|
|
3416
3416
|
throw new Error(
|
|
3417
|
-
`
|
|
3417
|
+
`Service "${slug}" is retired \u2014 the seller no longer sells it.`
|
|
3418
3418
|
);
|
|
3419
3419
|
}
|
|
3420
3420
|
return match;
|
|
@@ -3956,7 +3956,7 @@ exports.extractTxCommands = extractTxCommands;
|
|
|
3956
3956
|
exports.extractTxSender = extractTxSender;
|
|
3957
3957
|
exports.fallbackLabel = fallbackLabel;
|
|
3958
3958
|
exports.fetchAllCoins = fetchAllCoins;
|
|
3959
|
-
exports.
|
|
3959
|
+
exports.fetchService = fetchService;
|
|
3960
3960
|
exports.findSwapRoute = findSwapRoute;
|
|
3961
3961
|
exports.formatAssetAmount = formatAssetAmount;
|
|
3962
3962
|
exports.formatSui = formatSui;
|
|
@@ -3981,7 +3981,7 @@ exports.isInRegistry = isInRegistry;
|
|
|
3981
3981
|
exports.jobActionsFor = jobActionsFor;
|
|
3982
3982
|
exports.keypairFromPrivateKey = keypairFromPrivateKey;
|
|
3983
3983
|
exports.listModels = listModels;
|
|
3984
|
-
exports.
|
|
3984
|
+
exports.listServices = listServices;
|
|
3985
3985
|
exports.loadKey = loadKey;
|
|
3986
3986
|
exports.looksLikeSuiNs = looksLikeSuiNs;
|
|
3987
3987
|
exports.mapMoveAbortCode = mapMoveAbortCode;
|