@t2000/sdk 10.39.0 → 10.40.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/dist/browser.cjs +107 -1
- package/dist/browser.d.cts +1 -1
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +103 -2
- package/dist/{commerce-C_1GwUoT.d.cts → commerce-3ztE5Gg3.d.cts} +88 -8
- package/dist/{commerce-C_1GwUoT.d.ts → commerce-3ztE5Gg3.d.ts} +88 -8
- package/dist/index.cjs +108 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +103 -2
- package/package.json +2 -2
package/dist/browser.cjs
CHANGED
|
@@ -1351,13 +1351,14 @@ init_coinSelection();
|
|
|
1351
1351
|
init_errors();
|
|
1352
1352
|
init_token_registry();
|
|
1353
1353
|
init_coinSelection();
|
|
1354
|
-
var MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID = "
|
|
1354
|
+
var MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID = "0x1f88ca77b1980e3d0750e83d1363c6025cd677c2f420cae51a86d4a0bddf93c5";
|
|
1355
1355
|
var A2A_ESCROW_LATEST_PACKAGE_ID = process.env.A2A_ESCROW_OPENING_PACKAGE_ID ?? process.env.A2A_ESCROW_PACKAGE_ID ?? MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID;
|
|
1356
1356
|
var A2A_ESCROW_OPENING_PACKAGE_ID = A2A_ESCROW_LATEST_PACKAGE_ID;
|
|
1357
1357
|
var A2A_ESCROW_PACKAGE_V7_ID = "0x4249f0b242c47c7baf0c37304365bc4bbe769bcedf11f3525e84682d59a3b23e";
|
|
1358
1358
|
var A2A_ESCROW_PACKAGE_V8_ID = "0x1595b80bc05a03607f3908702c866ca63cf961025b4263b5ecbe419e07f8ff31";
|
|
1359
1359
|
var A2A_ESCROW_PACKAGE_V10_ID = process.env.A2A_ESCROW_PACKAGE_V10_ID ?? "0x5c90ec07da01bf885a4e65247ce98b75ab8a042cd965d30d7213856d579c4afa";
|
|
1360
1360
|
process.env.A2A_ESCROW_PACKAGE_V11_ID ?? "0x2a928916c859a159e6d6f4841073a31397d01336c1ea689ce74344e456463c8d";
|
|
1361
|
+
process.env.A2A_ESCROW_PACKAGE_V12_ID ?? "0x1f88ca77b1980e3d0750e83d1363c6025cd677c2f420cae51a86d4a0bddf93c5";
|
|
1361
1362
|
var SHA256_HEX_RE = /^(0x)?[0-9a-fA-F]{64}$/;
|
|
1362
1363
|
var OPENING_CLAIM_POLICY_ANY_ACTIVE = 0;
|
|
1363
1364
|
var OPENING_CLAIM_POLICY_PROVEN = 1;
|
|
@@ -1551,6 +1552,29 @@ async function buildCreateJobTx({
|
|
|
1551
1552
|
}
|
|
1552
1553
|
function buildRejectJobTx(jobId, v2) {
|
|
1553
1554
|
const tx = new transactions.Transaction();
|
|
1555
|
+
if (v2.batchId) {
|
|
1556
|
+
tx.moveCall({
|
|
1557
|
+
target: `${A2A_ESCROW_LATEST_PACKAGE_ID}::batch::${v2.buyerScoreId ? "batch_reject_agent_buyer" : "batch_reject"}`,
|
|
1558
|
+
typeArguments: [exports.USDC_TYPE],
|
|
1559
|
+
arguments: v2.buyerScoreId ? [
|
|
1560
|
+
tx.object(v2.batchId),
|
|
1561
|
+
tx.object(jobId),
|
|
1562
|
+
tx.object(v2.sellerScoreId),
|
|
1563
|
+
tx.object(v2.buyerScoreId),
|
|
1564
|
+
tx.object(v2.registryId),
|
|
1565
|
+
feeConfigArg2(tx),
|
|
1566
|
+
tx.object(CLOCK_ID2)
|
|
1567
|
+
] : [
|
|
1568
|
+
tx.object(v2.batchId),
|
|
1569
|
+
tx.object(jobId),
|
|
1570
|
+
tx.object(v2.sellerScoreId),
|
|
1571
|
+
tx.object(v2.registryId),
|
|
1572
|
+
feeConfigArg2(tx),
|
|
1573
|
+
tx.object(CLOCK_ID2)
|
|
1574
|
+
]
|
|
1575
|
+
});
|
|
1576
|
+
return tx;
|
|
1577
|
+
}
|
|
1554
1578
|
tx.moveCall({
|
|
1555
1579
|
target: `${A2A_ESCROW_LATEST_PACKAGE_ID}::reputation::${v2.buyerScoreId ? "reject_v2_agent_buyer" : "reject_v2"}`,
|
|
1556
1580
|
typeArguments: [exports.USDC_TYPE],
|
|
@@ -1573,6 +1597,20 @@ function buildRejectJobTx(jobId, v2) {
|
|
|
1573
1597
|
}
|
|
1574
1598
|
function buildRefundJobTx(jobId, v2) {
|
|
1575
1599
|
const tx = new transactions.Transaction();
|
|
1600
|
+
if (v2.batchId) {
|
|
1601
|
+
tx.moveCall({
|
|
1602
|
+
target: `${A2A_ESCROW_LATEST_PACKAGE_ID}::batch::batch_refund`,
|
|
1603
|
+
typeArguments: [exports.USDC_TYPE],
|
|
1604
|
+
arguments: [
|
|
1605
|
+
tx.object(v2.batchId),
|
|
1606
|
+
tx.object(jobId),
|
|
1607
|
+
tx.object(v2.sellerScoreId),
|
|
1608
|
+
feeConfigArg2(tx),
|
|
1609
|
+
tx.object(CLOCK_ID2)
|
|
1610
|
+
]
|
|
1611
|
+
});
|
|
1612
|
+
return tx;
|
|
1613
|
+
}
|
|
1576
1614
|
tx.moveCall({
|
|
1577
1615
|
target: `${A2A_ESCROW_LATEST_PACKAGE_ID}::reputation::refund_v2`,
|
|
1578
1616
|
typeArguments: [exports.USDC_TYPE],
|
|
@@ -1601,6 +1639,20 @@ function buildDeliverJobTx(jobId, deliveryHash) {
|
|
|
1601
1639
|
}
|
|
1602
1640
|
function buildReleaseJobTx(jobId, v2) {
|
|
1603
1641
|
const tx = new transactions.Transaction();
|
|
1642
|
+
if (v2.batchId) {
|
|
1643
|
+
tx.moveCall({
|
|
1644
|
+
target: `${A2A_ESCROW_LATEST_PACKAGE_ID}::batch::batch_release`,
|
|
1645
|
+
typeArguments: [exports.USDC_TYPE],
|
|
1646
|
+
arguments: [
|
|
1647
|
+
tx.object(v2.batchId),
|
|
1648
|
+
tx.object(jobId),
|
|
1649
|
+
tx.object(v2.sellerScoreId),
|
|
1650
|
+
feeConfigArg2(tx),
|
|
1651
|
+
tx.object(CLOCK_ID2)
|
|
1652
|
+
]
|
|
1653
|
+
});
|
|
1654
|
+
return tx;
|
|
1655
|
+
}
|
|
1604
1656
|
tx.moveCall({
|
|
1605
1657
|
target: `${A2A_ESCROW_LATEST_PACKAGE_ID}::reputation::release_v2`,
|
|
1606
1658
|
typeArguments: [exports.USDC_TYPE],
|
|
@@ -1650,6 +1702,26 @@ async function getJob(client, jobId) {
|
|
|
1650
1702
|
createdAtMs: Number(json.created_at_ms)
|
|
1651
1703
|
};
|
|
1652
1704
|
}
|
|
1705
|
+
var BATCH_ORIGIN_KEY_TYPE_SUFFIX = "::escrow::BatchOriginKey";
|
|
1706
|
+
async function getJobBatchOrigin(client, jobId) {
|
|
1707
|
+
let cursor = null;
|
|
1708
|
+
do {
|
|
1709
|
+
const page = await client.core.listDynamicFields({
|
|
1710
|
+
parentId: jobId,
|
|
1711
|
+
cursor: cursor ?? void 0
|
|
1712
|
+
});
|
|
1713
|
+
for (const field of page.dynamicFields) {
|
|
1714
|
+
if (!field.name.type.endsWith(BATCH_ORIGIN_KEY_TYPE_SUFFIX)) continue;
|
|
1715
|
+
const resp = await client.core.getDynamicField({
|
|
1716
|
+
parentId: jobId,
|
|
1717
|
+
name: field.name
|
|
1718
|
+
});
|
|
1719
|
+
return bcs.bcs.Address.parse(resp.dynamicField.value.bcs);
|
|
1720
|
+
}
|
|
1721
|
+
cursor = page.hasNextPage ? page.cursor : null;
|
|
1722
|
+
} while (cursor);
|
|
1723
|
+
return null;
|
|
1724
|
+
}
|
|
1653
1725
|
function jobActionsFor(job, caller, nowMs = Date.now()) {
|
|
1654
1726
|
const me = validateAddress(caller);
|
|
1655
1727
|
const isBuyer = me === job.buyer;
|
|
@@ -1847,6 +1919,35 @@ var MODULE3 = "batch";
|
|
|
1847
1919
|
var CLOCK_ID3 = "0x6";
|
|
1848
1920
|
var MAX_BATCH_SLOTS_DEFAULT = 250;
|
|
1849
1921
|
var BATCH_OPENING_TYPE_MARKER = "::batch::BatchOpening<";
|
|
1922
|
+
var BATCH_ABORT_CODES = {
|
|
1923
|
+
/** At your wave cap RIGHT NOW — min(buyer ceiling, level cap) active
|
|
1924
|
+
* holds. Settle one to reclaim; never "lifetime". */
|
|
1925
|
+
EMaxClaimsReached: 12,
|
|
1926
|
+
/** Pre-S.1202 wave — lifetime rows never free, so new claims refuse.
|
|
1927
|
+
* The wave's cancel / expired-refund still work. */
|
|
1928
|
+
ELegacyBatch: 22,
|
|
1929
|
+
/** The Job passed to a batch settle door has no BatchOriginKey. */
|
|
1930
|
+
ENotBatchJob: 23,
|
|
1931
|
+
/** The attached wave is not this Job's origin batch. */
|
|
1932
|
+
EWrongBatch: 24,
|
|
1933
|
+
EWrongSellerScore: 25,
|
|
1934
|
+
EWrongBuyerScore: 26,
|
|
1935
|
+
/** Registered Agent-ID buyer must reject via the agent-buyer variant. */
|
|
1936
|
+
EBuyerIsAgent: 27,
|
|
1937
|
+
EBuyerNotAgent: 28
|
|
1938
|
+
};
|
|
1939
|
+
var REPUTATION_ABORT_CODES = {
|
|
1940
|
+
/** A bare v2 door (release_v2 / reject_v2 variants / refund_v2) on a
|
|
1941
|
+
* batch-origin Job — the client must attach the batch and settle via
|
|
1942
|
+
* the batch doors. */
|
|
1943
|
+
EUseBatchSettle: 9
|
|
1944
|
+
};
|
|
1945
|
+
var ESCROW_ABORT_CODES = {
|
|
1946
|
+
/** Stale package flow (FeeConfig VERSION moved) — update @t2000/*. */
|
|
1947
|
+
EWrongVersion: 13,
|
|
1948
|
+
/** Second wave-hold free on one Job (unreachable via the doors). */
|
|
1949
|
+
EBatchHoldReleased: 23
|
|
1950
|
+
};
|
|
1850
1951
|
function preflightCreateBatchOpening(terms) {
|
|
1851
1952
|
const single = preflightCreateOpening(terms);
|
|
1852
1953
|
if (!single.valid) return single;
|
|
@@ -2109,11 +2210,14 @@ init_token_registry();
|
|
|
2109
2210
|
|
|
2110
2211
|
exports.A2A_ESCROW_FEE_CONFIG_ID = A2A_ESCROW_FEE_CONFIG_ID;
|
|
2111
2212
|
exports.A2A_ESCROW_PACKAGE_ID = A2A_ESCROW_PACKAGE_ID;
|
|
2213
|
+
exports.BATCH_ABORT_CODES = BATCH_ABORT_CODES;
|
|
2112
2214
|
exports.BATCH_OPENING_TYPE_MARKER = BATCH_OPENING_TYPE_MARKER;
|
|
2215
|
+
exports.BATCH_ORIGIN_KEY_TYPE_SUFFIX = BATCH_ORIGIN_KEY_TYPE_SUFFIX;
|
|
2113
2216
|
exports.CLOCK_ID = CLOCK_ID;
|
|
2114
2217
|
exports.DEFAULT_ACTIVITY_REPORT_URL = DEFAULT_ACTIVITY_REPORT_URL;
|
|
2115
2218
|
exports.DEFAULT_COMMERCE_API_BASE = DEFAULT_COMMERCE_API_BASE;
|
|
2116
2219
|
exports.DEFAULT_NETWORK = DEFAULT_NETWORK;
|
|
2220
|
+
exports.ESCROW_ABORT_CODES = ESCROW_ABORT_CODES;
|
|
2117
2221
|
exports.GAS_RESERVE_MIN = GAS_RESERVE_MIN;
|
|
2118
2222
|
exports.JOB_STATES = JOB_STATES;
|
|
2119
2223
|
exports.KNOWN_TARGETS = KNOWN_TARGETS;
|
|
@@ -2137,6 +2241,7 @@ exports.PREFLIGHT_MAX_AMOUNT = PREFLIGHT_MAX_AMOUNT;
|
|
|
2137
2241
|
exports.PREFLIGHT_OK = PREFLIGHT_OK;
|
|
2138
2242
|
exports.PROVEN_MIN_AVG_STARS_X10 = PROVEN_MIN_AVG_STARS_X10;
|
|
2139
2243
|
exports.PROVEN_MIN_REVIEWS = PROVEN_MIN_REVIEWS;
|
|
2244
|
+
exports.REPUTATION_ABORT_CODES = REPUTATION_ABORT_CODES;
|
|
2140
2245
|
exports.REVIEW_MAX_STARS = REVIEW_MAX_STARS;
|
|
2141
2246
|
exports.REVIEW_MIN_STARS = REVIEW_MIN_STARS;
|
|
2142
2247
|
exports.SELLER_LEVEL_ACTIVE_CAPS = SELLER_LEVEL_ACTIVE_CAPS;
|
|
@@ -2186,6 +2291,7 @@ exports.getBatchOpening = getBatchOpening;
|
|
|
2186
2291
|
exports.getDecimals = getDecimals;
|
|
2187
2292
|
exports.getDecimalsForCoinType = getDecimalsForCoinType;
|
|
2188
2293
|
exports.getJob = getJob;
|
|
2294
|
+
exports.getJobBatchOrigin = getJobBatchOrigin;
|
|
2189
2295
|
exports.getJobSpec = getJobSpec;
|
|
2190
2296
|
exports.invalidSendAssetMessage = invalidSendAssetMessage;
|
|
2191
2297
|
exports.jobActionsFor = jobActionsFor;
|
package/dist/browser.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as A2A_ESCROW_FEE_CONFIG_ID, a as A2A_ESCROW_PACKAGE_ID, b as ActivityReportConfig, c as AgentScore, B as
|
|
1
|
+
export { A as A2A_ESCROW_FEE_CONFIG_ID, a as A2A_ESCROW_PACKAGE_ID, b as ActivityReportConfig, c as AgentScore, B as BATCH_ABORT_CODES, d as BATCH_OPENING_TYPE_MARKER, e as BATCH_ORIGIN_KEY_TYPE_SUFFIX, f as BalanceResponse, g as BatchOpening, h as BatchOpeningTerms, C as CLOCK_ID, i as COIN_REGISTRY, j as ClassifyBalanceChange, k as ClassifyResult, l as CoinMeta, D as DEFAULT_ACTIVITY_REPORT_URL, m as DEFAULT_COMMERCE_API_BASE, n as DEFAULT_NETWORK, o as DepositInfo, E as ESCROW_ABORT_CODES, p as ETH_TYPE, q as ExtractedTransfer, G as GAS_RESERVE_MIN, I as IKA_TYPE, J as JOB_STATES, r as Job, s as JobState, t as JobTerms, u as JobVerification, K as KNOWN_TARGETS, v as KeypairSigner, L as LABEL_PATTERNS, w as LEVEL4_MAX_NO_DELIVERY, x as LEVEL4_MIN_REVIEWS, y as LOFI_TYPE, M as MANIFEST_TYPE, z as MAX_BATCH_SLOTS_DEFAULT, F as MAX_DELIVER_HORIZON_MS, H as MAX_JOB_USDC, N as MAX_REVIEW_WINDOW_MS, O as MIN_JOB_USDC, P as MIST_PER_SUI, Q as NAVX_TYPE, R as NO_DELIVERY_REGRESSION_FLOOR, S as OPENING_CLAIM_POLICIES, T as OPENING_CLAIM_POLICY_ANY_ACTIVE, U as OPENING_CLAIM_POLICY_PROVEN, V as OPENING_CLAIM_POLICY_PROVEN_4STAR, W as OVERLAY_FEE_RATE, X as OverlayFeeConfig, Y as PREFLIGHT_MAX_AMOUNT, Z as PREFLIGHT_OK, _ as PROVEN_MIN_AVG_STARS_X10, $ as PROVEN_MIN_REVIEWS, a0 as PayOptions, a1 as PayResult, a2 as PreflightResult, a3 as REPUTATION_ABORT_CODES, a4 as REVIEW_MAX_STARS, a5 as REVIEW_MIN_STARS, a6 as SELLER_LEVEL_ACTIVE_CAPS, a7 as STABLE_ASSETS, a8 as SUI_DECIMALS, a9 as SUI_TYPE, aa as SUPPORTED_ASSETS, ab as SellerLevel, ac as SendAssetClass, ad as SendResult, ae as ServiceListing, af as SimulationResult, ag as StableAsset, ah as SuiHolding, ai as SuiRpcTxBlock, aj as SupportedAsset, ak as SwapRouteResult, al as T2000Error, am as T2000ErrorCode, an as T2000ErrorData, ao as T2000_OVERLAY_FEE_WALLET, ap as TOKEN_MAP, aq as TransactionLeg, ar as TransactionRecord, as as TransactionSigner, at as TxDirection, au as USDC_DECIMALS, av as USDC_TYPE, aw as USDE_TYPE, ax as USDSUI_TYPE, ay as USDT_TYPE, az as WAL_TYPE, aA as WBTC_TYPE, aB as X402ActivityPayload, aC as ZkLoginProof, aD as ZkLoginSigner, aE as activeCapForLevel, aF as buildBatchClaimTx, aG as buildCancelBatchOpeningTx, aH as buildCreateBatchOpeningTx, aI as buildCreateJobTx, aJ as buildDeliverJobTx, aK as buildRefundBatchExpiredTx, aL as buildRefundJobTx, aM as buildRejectJobTx, aN as buildReleaseJobTx, aO as buildSendTx, aP as buildSwapTx, aQ as checkPositiveAmount, aR as checkSuiAddress, aS as claimPolicyLabel, aT as claimPolicyRequirement, aU as classifyAction, aV as classifyLabel, aW as classifySendAsset, aX as classifyTransaction, aY as deriveAgentScoreId, aZ as effectiveSellerLevel, a_ as executeTx, a$ as extractAllUserLegs, b0 as extractTransferDetails, b1 as extractTxCommands, b2 as extractTxSender, b3 as fallbackLabel, b4 as fetchService, b5 as findSwapRoute, b6 as formatAssetAmount, b7 as formatSui, b8 as formatUsd, b9 as getAgentScore, ba as getBatchClaimsByAgent, bb as getBatchOpening, bc as getDecimals, bd as getDecimalsForCoinType, be as getJob, bf as getJobBatchOrigin, bg as getJobSpec, bh as invalidSendAssetMessage, bi as jobActionsFor, bj as listServices, bk as mapMoveAbortCode, bl as mapWalletError, bm as meetsClaimPolicy, bn as meetsMinSellerLevel, bo as mistToSui, bp as parseSuiRpcTx, bq as payWithX402, br as preflightBatchClaim, bs as preflightClaimOpening, bt as preflightCreateBatchOpening, bu as preflightCreateJob, bv as preflightFail, bw as preflightPay, bx as preflightSend, by as preflightSwap, bz as putJobSpec, bA as rawToStable, bB as rawToUsdc, bC as refineLendingLabel, bD as reportX402Activity, bE as resolveSymbol, bF as resolveTokenType, bG as sellerLevel, bH as sellerLevelLabel, bI as stableToRaw, bJ as suiToMist, bK as truncateAddress, bL as usdcToRaw, bM as validateAddress, bN as verifyJobForSeller } from './commerce-3ztE5Gg3.cjs';
|
|
2
2
|
import '@mysten/sui/keypairs/ed25519';
|
|
3
3
|
import '@mysten/sui/grpc';
|
|
4
4
|
import '@mysten/sui/client';
|
package/dist/browser.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as A2A_ESCROW_FEE_CONFIG_ID, a as A2A_ESCROW_PACKAGE_ID, b as ActivityReportConfig, c as AgentScore, B as
|
|
1
|
+
export { A as A2A_ESCROW_FEE_CONFIG_ID, a as A2A_ESCROW_PACKAGE_ID, b as ActivityReportConfig, c as AgentScore, B as BATCH_ABORT_CODES, d as BATCH_OPENING_TYPE_MARKER, e as BATCH_ORIGIN_KEY_TYPE_SUFFIX, f as BalanceResponse, g as BatchOpening, h as BatchOpeningTerms, C as CLOCK_ID, i as COIN_REGISTRY, j as ClassifyBalanceChange, k as ClassifyResult, l as CoinMeta, D as DEFAULT_ACTIVITY_REPORT_URL, m as DEFAULT_COMMERCE_API_BASE, n as DEFAULT_NETWORK, o as DepositInfo, E as ESCROW_ABORT_CODES, p as ETH_TYPE, q as ExtractedTransfer, G as GAS_RESERVE_MIN, I as IKA_TYPE, J as JOB_STATES, r as Job, s as JobState, t as JobTerms, u as JobVerification, K as KNOWN_TARGETS, v as KeypairSigner, L as LABEL_PATTERNS, w as LEVEL4_MAX_NO_DELIVERY, x as LEVEL4_MIN_REVIEWS, y as LOFI_TYPE, M as MANIFEST_TYPE, z as MAX_BATCH_SLOTS_DEFAULT, F as MAX_DELIVER_HORIZON_MS, H as MAX_JOB_USDC, N as MAX_REVIEW_WINDOW_MS, O as MIN_JOB_USDC, P as MIST_PER_SUI, Q as NAVX_TYPE, R as NO_DELIVERY_REGRESSION_FLOOR, S as OPENING_CLAIM_POLICIES, T as OPENING_CLAIM_POLICY_ANY_ACTIVE, U as OPENING_CLAIM_POLICY_PROVEN, V as OPENING_CLAIM_POLICY_PROVEN_4STAR, W as OVERLAY_FEE_RATE, X as OverlayFeeConfig, Y as PREFLIGHT_MAX_AMOUNT, Z as PREFLIGHT_OK, _ as PROVEN_MIN_AVG_STARS_X10, $ as PROVEN_MIN_REVIEWS, a0 as PayOptions, a1 as PayResult, a2 as PreflightResult, a3 as REPUTATION_ABORT_CODES, a4 as REVIEW_MAX_STARS, a5 as REVIEW_MIN_STARS, a6 as SELLER_LEVEL_ACTIVE_CAPS, a7 as STABLE_ASSETS, a8 as SUI_DECIMALS, a9 as SUI_TYPE, aa as SUPPORTED_ASSETS, ab as SellerLevel, ac as SendAssetClass, ad as SendResult, ae as ServiceListing, af as SimulationResult, ag as StableAsset, ah as SuiHolding, ai as SuiRpcTxBlock, aj as SupportedAsset, ak as SwapRouteResult, al as T2000Error, am as T2000ErrorCode, an as T2000ErrorData, ao as T2000_OVERLAY_FEE_WALLET, ap as TOKEN_MAP, aq as TransactionLeg, ar as TransactionRecord, as as TransactionSigner, at as TxDirection, au as USDC_DECIMALS, av as USDC_TYPE, aw as USDE_TYPE, ax as USDSUI_TYPE, ay as USDT_TYPE, az as WAL_TYPE, aA as WBTC_TYPE, aB as X402ActivityPayload, aC as ZkLoginProof, aD as ZkLoginSigner, aE as activeCapForLevel, aF as buildBatchClaimTx, aG as buildCancelBatchOpeningTx, aH as buildCreateBatchOpeningTx, aI as buildCreateJobTx, aJ as buildDeliverJobTx, aK as buildRefundBatchExpiredTx, aL as buildRefundJobTx, aM as buildRejectJobTx, aN as buildReleaseJobTx, aO as buildSendTx, aP as buildSwapTx, aQ as checkPositiveAmount, aR as checkSuiAddress, aS as claimPolicyLabel, aT as claimPolicyRequirement, aU as classifyAction, aV as classifyLabel, aW as classifySendAsset, aX as classifyTransaction, aY as deriveAgentScoreId, aZ as effectiveSellerLevel, a_ as executeTx, a$ as extractAllUserLegs, b0 as extractTransferDetails, b1 as extractTxCommands, b2 as extractTxSender, b3 as fallbackLabel, b4 as fetchService, b5 as findSwapRoute, b6 as formatAssetAmount, b7 as formatSui, b8 as formatUsd, b9 as getAgentScore, ba as getBatchClaimsByAgent, bb as getBatchOpening, bc as getDecimals, bd as getDecimalsForCoinType, be as getJob, bf as getJobBatchOrigin, bg as getJobSpec, bh as invalidSendAssetMessage, bi as jobActionsFor, bj as listServices, bk as mapMoveAbortCode, bl as mapWalletError, bm as meetsClaimPolicy, bn as meetsMinSellerLevel, bo as mistToSui, bp as parseSuiRpcTx, bq as payWithX402, br as preflightBatchClaim, bs as preflightClaimOpening, bt as preflightCreateBatchOpening, bu as preflightCreateJob, bv as preflightFail, bw as preflightPay, bx as preflightSend, by as preflightSwap, bz as putJobSpec, bA as rawToStable, bB as rawToUsdc, bC as refineLendingLabel, bD as reportX402Activity, bE as resolveSymbol, bF as resolveTokenType, bG as sellerLevel, bH as sellerLevelLabel, bI as stableToRaw, bJ as suiToMist, bK as truncateAddress, bL as usdcToRaw, bM as validateAddress, bN as verifyJobForSeller } from './commerce-3ztE5Gg3.js';
|
|
2
2
|
import '@mysten/sui/keypairs/ed25519';
|
|
3
3
|
import '@mysten/sui/grpc';
|
|
4
4
|
import '@mysten/sui/client';
|
package/dist/browser.js
CHANGED
|
@@ -1349,13 +1349,14 @@ init_coinSelection();
|
|
|
1349
1349
|
init_errors();
|
|
1350
1350
|
init_token_registry();
|
|
1351
1351
|
init_coinSelection();
|
|
1352
|
-
var MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID = "
|
|
1352
|
+
var MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID = "0x1f88ca77b1980e3d0750e83d1363c6025cd677c2f420cae51a86d4a0bddf93c5";
|
|
1353
1353
|
var A2A_ESCROW_LATEST_PACKAGE_ID = process.env.A2A_ESCROW_OPENING_PACKAGE_ID ?? process.env.A2A_ESCROW_PACKAGE_ID ?? MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID;
|
|
1354
1354
|
var A2A_ESCROW_OPENING_PACKAGE_ID = A2A_ESCROW_LATEST_PACKAGE_ID;
|
|
1355
1355
|
var A2A_ESCROW_PACKAGE_V7_ID = "0x4249f0b242c47c7baf0c37304365bc4bbe769bcedf11f3525e84682d59a3b23e";
|
|
1356
1356
|
var A2A_ESCROW_PACKAGE_V8_ID = "0x1595b80bc05a03607f3908702c866ca63cf961025b4263b5ecbe419e07f8ff31";
|
|
1357
1357
|
var A2A_ESCROW_PACKAGE_V10_ID = process.env.A2A_ESCROW_PACKAGE_V10_ID ?? "0x5c90ec07da01bf885a4e65247ce98b75ab8a042cd965d30d7213856d579c4afa";
|
|
1358
1358
|
process.env.A2A_ESCROW_PACKAGE_V11_ID ?? "0x2a928916c859a159e6d6f4841073a31397d01336c1ea689ce74344e456463c8d";
|
|
1359
|
+
process.env.A2A_ESCROW_PACKAGE_V12_ID ?? "0x1f88ca77b1980e3d0750e83d1363c6025cd677c2f420cae51a86d4a0bddf93c5";
|
|
1359
1360
|
var SHA256_HEX_RE = /^(0x)?[0-9a-fA-F]{64}$/;
|
|
1360
1361
|
var OPENING_CLAIM_POLICY_ANY_ACTIVE = 0;
|
|
1361
1362
|
var OPENING_CLAIM_POLICY_PROVEN = 1;
|
|
@@ -1549,6 +1550,29 @@ async function buildCreateJobTx({
|
|
|
1549
1550
|
}
|
|
1550
1551
|
function buildRejectJobTx(jobId, v2) {
|
|
1551
1552
|
const tx = new Transaction();
|
|
1553
|
+
if (v2.batchId) {
|
|
1554
|
+
tx.moveCall({
|
|
1555
|
+
target: `${A2A_ESCROW_LATEST_PACKAGE_ID}::batch::${v2.buyerScoreId ? "batch_reject_agent_buyer" : "batch_reject"}`,
|
|
1556
|
+
typeArguments: [USDC_TYPE],
|
|
1557
|
+
arguments: v2.buyerScoreId ? [
|
|
1558
|
+
tx.object(v2.batchId),
|
|
1559
|
+
tx.object(jobId),
|
|
1560
|
+
tx.object(v2.sellerScoreId),
|
|
1561
|
+
tx.object(v2.buyerScoreId),
|
|
1562
|
+
tx.object(v2.registryId),
|
|
1563
|
+
feeConfigArg2(tx),
|
|
1564
|
+
tx.object(CLOCK_ID2)
|
|
1565
|
+
] : [
|
|
1566
|
+
tx.object(v2.batchId),
|
|
1567
|
+
tx.object(jobId),
|
|
1568
|
+
tx.object(v2.sellerScoreId),
|
|
1569
|
+
tx.object(v2.registryId),
|
|
1570
|
+
feeConfigArg2(tx),
|
|
1571
|
+
tx.object(CLOCK_ID2)
|
|
1572
|
+
]
|
|
1573
|
+
});
|
|
1574
|
+
return tx;
|
|
1575
|
+
}
|
|
1552
1576
|
tx.moveCall({
|
|
1553
1577
|
target: `${A2A_ESCROW_LATEST_PACKAGE_ID}::reputation::${v2.buyerScoreId ? "reject_v2_agent_buyer" : "reject_v2"}`,
|
|
1554
1578
|
typeArguments: [USDC_TYPE],
|
|
@@ -1571,6 +1595,20 @@ function buildRejectJobTx(jobId, v2) {
|
|
|
1571
1595
|
}
|
|
1572
1596
|
function buildRefundJobTx(jobId, v2) {
|
|
1573
1597
|
const tx = new Transaction();
|
|
1598
|
+
if (v2.batchId) {
|
|
1599
|
+
tx.moveCall({
|
|
1600
|
+
target: `${A2A_ESCROW_LATEST_PACKAGE_ID}::batch::batch_refund`,
|
|
1601
|
+
typeArguments: [USDC_TYPE],
|
|
1602
|
+
arguments: [
|
|
1603
|
+
tx.object(v2.batchId),
|
|
1604
|
+
tx.object(jobId),
|
|
1605
|
+
tx.object(v2.sellerScoreId),
|
|
1606
|
+
feeConfigArg2(tx),
|
|
1607
|
+
tx.object(CLOCK_ID2)
|
|
1608
|
+
]
|
|
1609
|
+
});
|
|
1610
|
+
return tx;
|
|
1611
|
+
}
|
|
1574
1612
|
tx.moveCall({
|
|
1575
1613
|
target: `${A2A_ESCROW_LATEST_PACKAGE_ID}::reputation::refund_v2`,
|
|
1576
1614
|
typeArguments: [USDC_TYPE],
|
|
@@ -1599,6 +1637,20 @@ function buildDeliverJobTx(jobId, deliveryHash) {
|
|
|
1599
1637
|
}
|
|
1600
1638
|
function buildReleaseJobTx(jobId, v2) {
|
|
1601
1639
|
const tx = new Transaction();
|
|
1640
|
+
if (v2.batchId) {
|
|
1641
|
+
tx.moveCall({
|
|
1642
|
+
target: `${A2A_ESCROW_LATEST_PACKAGE_ID}::batch::batch_release`,
|
|
1643
|
+
typeArguments: [USDC_TYPE],
|
|
1644
|
+
arguments: [
|
|
1645
|
+
tx.object(v2.batchId),
|
|
1646
|
+
tx.object(jobId),
|
|
1647
|
+
tx.object(v2.sellerScoreId),
|
|
1648
|
+
feeConfigArg2(tx),
|
|
1649
|
+
tx.object(CLOCK_ID2)
|
|
1650
|
+
]
|
|
1651
|
+
});
|
|
1652
|
+
return tx;
|
|
1653
|
+
}
|
|
1602
1654
|
tx.moveCall({
|
|
1603
1655
|
target: `${A2A_ESCROW_LATEST_PACKAGE_ID}::reputation::release_v2`,
|
|
1604
1656
|
typeArguments: [USDC_TYPE],
|
|
@@ -1648,6 +1700,26 @@ async function getJob(client, jobId) {
|
|
|
1648
1700
|
createdAtMs: Number(json.created_at_ms)
|
|
1649
1701
|
};
|
|
1650
1702
|
}
|
|
1703
|
+
var BATCH_ORIGIN_KEY_TYPE_SUFFIX = "::escrow::BatchOriginKey";
|
|
1704
|
+
async function getJobBatchOrigin(client, jobId) {
|
|
1705
|
+
let cursor = null;
|
|
1706
|
+
do {
|
|
1707
|
+
const page = await client.core.listDynamicFields({
|
|
1708
|
+
parentId: jobId,
|
|
1709
|
+
cursor: cursor ?? void 0
|
|
1710
|
+
});
|
|
1711
|
+
for (const field of page.dynamicFields) {
|
|
1712
|
+
if (!field.name.type.endsWith(BATCH_ORIGIN_KEY_TYPE_SUFFIX)) continue;
|
|
1713
|
+
const resp = await client.core.getDynamicField({
|
|
1714
|
+
parentId: jobId,
|
|
1715
|
+
name: field.name
|
|
1716
|
+
});
|
|
1717
|
+
return bcs.Address.parse(resp.dynamicField.value.bcs);
|
|
1718
|
+
}
|
|
1719
|
+
cursor = page.hasNextPage ? page.cursor : null;
|
|
1720
|
+
} while (cursor);
|
|
1721
|
+
return null;
|
|
1722
|
+
}
|
|
1651
1723
|
function jobActionsFor(job, caller, nowMs = Date.now()) {
|
|
1652
1724
|
const me = validateAddress(caller);
|
|
1653
1725
|
const isBuyer = me === job.buyer;
|
|
@@ -1845,6 +1917,35 @@ var MODULE3 = "batch";
|
|
|
1845
1917
|
var CLOCK_ID3 = "0x6";
|
|
1846
1918
|
var MAX_BATCH_SLOTS_DEFAULT = 250;
|
|
1847
1919
|
var BATCH_OPENING_TYPE_MARKER = "::batch::BatchOpening<";
|
|
1920
|
+
var BATCH_ABORT_CODES = {
|
|
1921
|
+
/** At your wave cap RIGHT NOW — min(buyer ceiling, level cap) active
|
|
1922
|
+
* holds. Settle one to reclaim; never "lifetime". */
|
|
1923
|
+
EMaxClaimsReached: 12,
|
|
1924
|
+
/** Pre-S.1202 wave — lifetime rows never free, so new claims refuse.
|
|
1925
|
+
* The wave's cancel / expired-refund still work. */
|
|
1926
|
+
ELegacyBatch: 22,
|
|
1927
|
+
/** The Job passed to a batch settle door has no BatchOriginKey. */
|
|
1928
|
+
ENotBatchJob: 23,
|
|
1929
|
+
/** The attached wave is not this Job's origin batch. */
|
|
1930
|
+
EWrongBatch: 24,
|
|
1931
|
+
EWrongSellerScore: 25,
|
|
1932
|
+
EWrongBuyerScore: 26,
|
|
1933
|
+
/** Registered Agent-ID buyer must reject via the agent-buyer variant. */
|
|
1934
|
+
EBuyerIsAgent: 27,
|
|
1935
|
+
EBuyerNotAgent: 28
|
|
1936
|
+
};
|
|
1937
|
+
var REPUTATION_ABORT_CODES = {
|
|
1938
|
+
/** A bare v2 door (release_v2 / reject_v2 variants / refund_v2) on a
|
|
1939
|
+
* batch-origin Job — the client must attach the batch and settle via
|
|
1940
|
+
* the batch doors. */
|
|
1941
|
+
EUseBatchSettle: 9
|
|
1942
|
+
};
|
|
1943
|
+
var ESCROW_ABORT_CODES = {
|
|
1944
|
+
/** Stale package flow (FeeConfig VERSION moved) — update @t2000/*. */
|
|
1945
|
+
EWrongVersion: 13,
|
|
1946
|
+
/** Second wave-hold free on one Job (unreachable via the doors). */
|
|
1947
|
+
EBatchHoldReleased: 23
|
|
1948
|
+
};
|
|
1848
1949
|
function preflightCreateBatchOpening(terms) {
|
|
1849
1950
|
const single = preflightCreateOpening(terms);
|
|
1850
1951
|
if (!single.valid) return single;
|
|
@@ -2105,4 +2206,4 @@ async function getJobSpec(base, hash) {
|
|
|
2105
2206
|
// src/browser.ts
|
|
2106
2207
|
init_token_registry();
|
|
2107
2208
|
|
|
2108
|
-
export { A2A_ESCROW_FEE_CONFIG_ID, A2A_ESCROW_PACKAGE_ID, BATCH_OPENING_TYPE_MARKER, CLOCK_ID, COIN_REGISTRY, DEFAULT_ACTIVITY_REPORT_URL, DEFAULT_COMMERCE_API_BASE, DEFAULT_NETWORK, ETH_TYPE, GAS_RESERVE_MIN, IKA_TYPE, JOB_STATES, KNOWN_TARGETS, KeypairSigner, LABEL_PATTERNS, LEVEL4_MAX_NO_DELIVERY, LEVEL4_MIN_REVIEWS, LOFI_TYPE, MANIFEST_TYPE, MAX_BATCH_SLOTS_DEFAULT, MAX_DELIVER_HORIZON_MS, MAX_JOB_USDC, MAX_REVIEW_WINDOW_MS, MIN_JOB_USDC, MIST_PER_SUI, NAVX_TYPE, NO_DELIVERY_REGRESSION_FLOOR, OPENING_CLAIM_POLICIES, OPENING_CLAIM_POLICY_ANY_ACTIVE, OPENING_CLAIM_POLICY_PROVEN, OPENING_CLAIM_POLICY_PROVEN_4STAR, OVERLAY_FEE_RATE, PREFLIGHT_MAX_AMOUNT, PREFLIGHT_OK, PROVEN_MIN_AVG_STARS_X10, PROVEN_MIN_REVIEWS, REVIEW_MAX_STARS, REVIEW_MIN_STARS, SELLER_LEVEL_ACTIVE_CAPS, STABLE_ASSETS, SUI_DECIMALS, SUI_TYPE, SUPPORTED_ASSETS, T2000Error, T2000_OVERLAY_FEE_WALLET, TOKEN_MAP, USDC_DECIMALS, USDC_TYPE, USDE_TYPE, USDSUI_TYPE, USDT_TYPE, WAL_TYPE, WBTC_TYPE, ZkLoginSigner, activeCapForLevel, buildBatchClaimTx, buildCancelBatchOpeningTx, buildCreateBatchOpeningTx, buildCreateJobTx, buildDeliverJobTx, buildRefundBatchExpiredTx, buildRefundJobTx, buildRejectJobTx, buildReleaseJobTx, buildSendTx, buildSwapTx, checkPositiveAmount, checkSuiAddress, claimPolicyLabel, claimPolicyRequirement, classifyAction, classifyLabel, classifySendAsset, classifyTransaction, deriveAgentScoreId, effectiveSellerLevel, executeTx, extractAllUserLegs, extractTransferDetails, extractTxCommands, extractTxSender, fallbackLabel, fetchService, findSwapRoute, formatAssetAmount, formatSui, formatUsd, fromBase642 as fromBase64, getAgentScore, getBatchClaimsByAgent, getBatchOpening, getDecimals, getDecimalsForCoinType, getJob, getJobSpec, invalidSendAssetMessage, jobActionsFor, listServices, mapMoveAbortCode, mapWalletError, meetsClaimPolicy, meetsMinSellerLevel, mistToSui, parseSuiRpcTx, payWithX402, preflightBatchClaim, preflightClaimOpening, preflightCreateBatchOpening, preflightCreateJob, preflightFail, preflightPay, preflightSend, preflightSwap, putJobSpec, rawToStable, rawToUsdc, refineLendingLabel, reportX402Activity, resolveSymbol, resolveTokenType, sellerLevel, sellerLevelLabel, stableToRaw, suiToMist, toBase64, truncateAddress, usdcToRaw, validateAddress, verifyJobForSeller };
|
|
2209
|
+
export { A2A_ESCROW_FEE_CONFIG_ID, A2A_ESCROW_PACKAGE_ID, BATCH_ABORT_CODES, BATCH_OPENING_TYPE_MARKER, BATCH_ORIGIN_KEY_TYPE_SUFFIX, CLOCK_ID, COIN_REGISTRY, DEFAULT_ACTIVITY_REPORT_URL, DEFAULT_COMMERCE_API_BASE, DEFAULT_NETWORK, ESCROW_ABORT_CODES, ETH_TYPE, GAS_RESERVE_MIN, IKA_TYPE, JOB_STATES, KNOWN_TARGETS, KeypairSigner, LABEL_PATTERNS, LEVEL4_MAX_NO_DELIVERY, LEVEL4_MIN_REVIEWS, LOFI_TYPE, MANIFEST_TYPE, MAX_BATCH_SLOTS_DEFAULT, MAX_DELIVER_HORIZON_MS, MAX_JOB_USDC, MAX_REVIEW_WINDOW_MS, MIN_JOB_USDC, MIST_PER_SUI, NAVX_TYPE, NO_DELIVERY_REGRESSION_FLOOR, OPENING_CLAIM_POLICIES, OPENING_CLAIM_POLICY_ANY_ACTIVE, OPENING_CLAIM_POLICY_PROVEN, OPENING_CLAIM_POLICY_PROVEN_4STAR, OVERLAY_FEE_RATE, PREFLIGHT_MAX_AMOUNT, PREFLIGHT_OK, PROVEN_MIN_AVG_STARS_X10, PROVEN_MIN_REVIEWS, REPUTATION_ABORT_CODES, REVIEW_MAX_STARS, REVIEW_MIN_STARS, SELLER_LEVEL_ACTIVE_CAPS, STABLE_ASSETS, SUI_DECIMALS, SUI_TYPE, SUPPORTED_ASSETS, T2000Error, T2000_OVERLAY_FEE_WALLET, TOKEN_MAP, USDC_DECIMALS, USDC_TYPE, USDE_TYPE, USDSUI_TYPE, USDT_TYPE, WAL_TYPE, WBTC_TYPE, ZkLoginSigner, activeCapForLevel, buildBatchClaimTx, buildCancelBatchOpeningTx, buildCreateBatchOpeningTx, buildCreateJobTx, buildDeliverJobTx, buildRefundBatchExpiredTx, buildRefundJobTx, buildRejectJobTx, buildReleaseJobTx, buildSendTx, buildSwapTx, checkPositiveAmount, checkSuiAddress, claimPolicyLabel, claimPolicyRequirement, classifyAction, classifyLabel, classifySendAsset, classifyTransaction, deriveAgentScoreId, effectiveSellerLevel, executeTx, extractAllUserLegs, extractTransferDetails, extractTxCommands, extractTxSender, fallbackLabel, fetchService, findSwapRoute, formatAssetAmount, formatSui, formatUsd, fromBase642 as fromBase64, getAgentScore, getBatchClaimsByAgent, getBatchOpening, getDecimals, getDecimalsForCoinType, getJob, getJobBatchOrigin, getJobSpec, invalidSendAssetMessage, jobActionsFor, listServices, mapMoveAbortCode, mapWalletError, meetsClaimPolicy, meetsMinSellerLevel, mistToSui, parseSuiRpcTx, payWithX402, preflightBatchClaim, preflightClaimOpening, preflightCreateBatchOpening, preflightCreateJob, preflightFail, preflightPay, preflightSend, preflightSwap, putJobSpec, rawToStable, rawToUsdc, refineLendingLabel, reportX402Activity, resolveSymbol, resolveTokenType, sellerLevel, sellerLevelLabel, stableToRaw, suiToMist, toBase64, truncateAddress, usdcToRaw, validateAddress, verifyJobForSeller };
|
|
@@ -1577,17 +1577,29 @@ declare function buildDeclineJobTx(jobId: string): Transaction;
|
|
|
1577
1577
|
* the protocol outcome lands on the seller's score. Score ids derive
|
|
1578
1578
|
* locally (`deriveAgentScoreId`); pass `buyerScoreId` exactly when the
|
|
1579
1579
|
* buyer is a registered agent — the contract refuses a mismatched
|
|
1580
|
-
* variant, so a registered buyer can't dodge its own counter.
|
|
1580
|
+
* variant, so a registered buyer can't dodge its own counter.
|
|
1581
|
+
*
|
|
1582
|
+
* S.1202: a batch-origin Job (has `BatchOriginKey` — read it with
|
|
1583
|
+
* `getJobBatchOrigin`) MUST pass `batchId` so the PTB targets
|
|
1584
|
+
* `batch::batch_reject`/`batch_reject_agent_buyer` and frees the per-wave
|
|
1585
|
+
* hold with the money; the bare reputation door aborts `EUseBatchSettle`
|
|
1586
|
+
* on origin Jobs. */
|
|
1581
1587
|
declare function buildRejectJobTx(jobId: string, v2: {
|
|
1582
1588
|
sellerScoreId: string;
|
|
1583
1589
|
registryId: string;
|
|
1584
1590
|
buyerScoreId?: string;
|
|
1591
|
+
batchId?: string;
|
|
1585
1592
|
}): Transaction;
|
|
1586
1593
|
/** Deadline refund (no delivery) — S.1063: settles through
|
|
1587
1594
|
* `reputation::refund_v2` so `no_delivery` lands on the seller's score.
|
|
1588
|
-
* Still permissionless: funds only ever return to the buyer.
|
|
1595
|
+
* Still permissionless: funds only ever return to the buyer.
|
|
1596
|
+
*
|
|
1597
|
+
* S.1202: pass `batchId` for a batch-origin Job (see `getJobBatchOrigin`)
|
|
1598
|
+
* — the crank must attach the origin wave (`batch::batch_refund`), and a
|
|
1599
|
+
* wrong wave aborts `EWrongBatch` on-chain. */
|
|
1589
1600
|
declare function buildRefundJobTx(jobId: string, v2: {
|
|
1590
1601
|
sellerScoreId: string;
|
|
1602
|
+
batchId?: string;
|
|
1591
1603
|
}): Transaction;
|
|
1592
1604
|
/** Seller posts the delivery commitment (hex hash) before the deadline. */
|
|
1593
1605
|
declare function buildDeliverJobTx(jobId: string, deliveryHash: string): Transaction;
|
|
@@ -1597,13 +1609,37 @@ declare function buildDeliverJobTx(jobId: string, deliveryHash: string): Transac
|
|
|
1597
1609
|
* board-claimed job frees its active seat with the money. Hire jobs pass
|
|
1598
1610
|
* the same score; the contract's `ClaimedJobKey` marker decides whether
|
|
1599
1611
|
* a decrement lands. A scoreless seller needs the `create_empty_score`
|
|
1600
|
-
* precursor first (same hop as reject/refund since S.1063).
|
|
1612
|
+
* precursor first (same hop as reject/refund since S.1063).
|
|
1613
|
+
*
|
|
1614
|
+
* S.1202: a batch-origin Job MUST pass `batchId` (read it with
|
|
1615
|
+
* `getJobBatchOrigin`) so the release targets `batch::batch_release` and
|
|
1616
|
+
* frees the per-wave hold in the same tx — bare `release_v2` aborts
|
|
1617
|
+
* `EUseBatchSettle` on origin Jobs. Applies to all three release shapes
|
|
1618
|
+
* (buyer accept, buyer goodwill, permissionless timeout crank). */
|
|
1601
1619
|
declare function buildReleaseJobTx(jobId: string, v2: {
|
|
1602
1620
|
sellerScoreId: string;
|
|
1621
|
+
batchId?: string;
|
|
1603
1622
|
}): Transaction;
|
|
1604
1623
|
/** Fetch + parse a `Job` shared object. Throws `RPC_ERROR` when the id
|
|
1605
1624
|
* doesn't resolve to an a2a_escrow Job. */
|
|
1606
1625
|
declare function getJob(client: SuiCoreClient, jobId: string): Promise<Job>;
|
|
1626
|
+
/** Type-name suffix of the S.1202 origin marker DF on a batch-claimed
|
|
1627
|
+
* Job. Matched as a SUFFIX so reads never depend on the V12 defining
|
|
1628
|
+
* package id (fillable only after the cutover) — the parent Job is
|
|
1629
|
+
* already authenticated by `getJob`/object-type checks, and only our
|
|
1630
|
+
* package can attach DFs to it. */
|
|
1631
|
+
declare const BATCH_ORIGIN_KEY_TYPE_SUFFIX: "::escrow::BatchOriginKey";
|
|
1632
|
+
/**
|
|
1633
|
+
* The `BatchOpening` id a Job was batch-claimed from, or null for
|
|
1634
|
+
* single-opening / hire Jobs (S.1202 — reads the `BatchOriginKey` DF).
|
|
1635
|
+
*
|
|
1636
|
+
* Every settle/reject/refund prepare MUST call this first: an origin Job
|
|
1637
|
+
* settles only through the batch doors (`batchId` on the builders), and
|
|
1638
|
+
* the bare v2 doors abort `EUseBatchSettle` on it. Errors propagate —
|
|
1639
|
+
* a "couldn't read, assume non-batch" fallback would build a PTB that
|
|
1640
|
+
* aborts on-chain anyway, with a worse message.
|
|
1641
|
+
*/
|
|
1642
|
+
declare function getJobBatchOrigin(client: SuiCoreClient, jobId: string): Promise<string | null>;
|
|
1607
1643
|
/** What `caller` can do to `job` right now — drives `t2 job watch` (the
|
|
1608
1644
|
* ACP-style "available action" readout) and any host UI. */
|
|
1609
1645
|
declare function jobActionsFor(job: Job, caller: string, nowMs?: number): string[];
|
|
@@ -1641,8 +1677,12 @@ declare function verifyJobForSeller({ client, jobId, seller, minAmountUsdc, minR
|
|
|
1641
1677
|
* target the LATEST published id — the original id (types, Job verbs) is
|
|
1642
1678
|
* unchanged.
|
|
1643
1679
|
*/
|
|
1644
|
-
/** The LATEST published `a2a_escrow` package id on MAINNET (
|
|
1645
|
-
* 2026-08-
|
|
1680
|
+
/** The LATEST published `a2a_escrow` package id on MAINNET (v12 upgrade
|
|
1681
|
+
* 2026-08-26, S.1202 — batch ACTIVE per-wave claims + batch-aware settle,
|
|
1682
|
+
* FeeConfig VERSION 6→7 cutover with immediate migrate: origin-stamped
|
|
1683
|
+
* batch Jobs settle via `batch::batch_release`/`batch_reject*`/
|
|
1684
|
+
* `batch_refund`, and every v11-and-earlier entry aborts EWrongVersion;
|
|
1685
|
+
* v11 = S.1193 — batch openings, additive, NO migrate:
|
|
1646
1686
|
* `batch` module + `set_max_batch_slots`;
|
|
1647
1687
|
* v10 = S.1192 seller levels + active caps, VERSION 6 cutover:
|
|
1648
1688
|
* claim_v2/claim_proven_v2/create_open_v2/release_v2;
|
|
@@ -1659,9 +1699,9 @@ declare function verifyJobForSeller({ client, jobId, seller, minAmountUsdc, minR
|
|
|
1659
1699
|
* upgrade + `migrate` cutover is a ONE-VALUE change here. The original id
|
|
1660
1700
|
* (`MAINNET_A2A_ESCROW_PACKAGE_ID` in job.ts) remains the anchor for type
|
|
1661
1701
|
* strings, event filters, and object-type queries — those never move. */
|
|
1662
|
-
declare const MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID = "
|
|
1702
|
+
declare const MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID = "0x1f88ca77b1980e3d0750e83d1363c6025cd677c2f420cae51a86d4a0bddf93c5";
|
|
1663
1703
|
/** Back-compat name for the latest id (pre-S.981 consumers import this). */
|
|
1664
|
-
declare const MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID = "
|
|
1704
|
+
declare const MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID = "0x1f88ca77b1980e3d0750e83d1363c6025cd677c2f420cae51a86d4a0bddf93c5";
|
|
1665
1705
|
/** Env-overridable latest id for testnet/dev (NOT a trust anchor). A fresh
|
|
1666
1706
|
* dev publish has original == latest, so `A2A_ESCROW_PACKAGE_ID` alone is
|
|
1667
1707
|
* honored as the fallback override. */
|
|
@@ -1710,6 +1750,13 @@ declare const A2A_ESCROW_PACKAGE_V10_ID: string;
|
|
|
1710
1750
|
* DEFINING-id anchor like V2/V3/V6/V7/V8/V10 — never moves again, even
|
|
1711
1751
|
* when LATEST does. */
|
|
1712
1752
|
declare const A2A_ESCROW_PACKAGE_V11_ID: string;
|
|
1753
|
+
/** v12 (S.1202, upgrade AGYachnt… 2026-08-26) — defining id for the batch
|
|
1754
|
+
* active-claims surface: the `BatchSlotHoldReleased` event and the
|
|
1755
|
+
* BatchOriginKey/BatchHoldReleasedKey/ActiveClaimsSemanticsKey DF key
|
|
1756
|
+
* types. A DEFINING-id anchor like V2…V11 — never moves again, even when
|
|
1757
|
+
* LATEST does. (Job-side origin reads may still suffix-match the type
|
|
1758
|
+
* name — `BATCH_ORIGIN_KEY_TYPE_SUFFIX` in wallet/job.ts.) */
|
|
1759
|
+
declare const A2A_ESCROW_PACKAGE_V12_ID: string;
|
|
1713
1760
|
/** Default claim policy: any ACTIVE registered Agent ID ($0 claim, FCFS). */
|
|
1714
1761
|
declare const OPENING_CLAIM_POLICY_ANY_ACTIVE = 0;
|
|
1715
1762
|
/** S.1054 — Proven: claimer needs ≥ PROVEN_MIN_REVIEWS on-chain reviews
|
|
@@ -1954,6 +2001,39 @@ declare function buildSubmitFirstReviewTx({ jobId, stars, boardId, }: {
|
|
|
1954
2001
|
declare const MAX_BATCH_SLOTS_DEFAULT = 250;
|
|
1955
2002
|
/** Object-type marker for `resolveCreatedObjectId` digest walks. */
|
|
1956
2003
|
declare const BATCH_OPENING_TYPE_MARKER: "::batch::BatchOpening<";
|
|
2004
|
+
/** S.1202 abort codes clients map to English (transcribed from
|
|
2005
|
+
* `contracts/a2a_escrow` — the runbook's abort-code map is the SSOT).
|
|
2006
|
+
* Grouped by the aborting MODULE, because Move abort codes are only
|
|
2007
|
+
* unique per module. */
|
|
2008
|
+
declare const BATCH_ABORT_CODES: {
|
|
2009
|
+
/** At your wave cap RIGHT NOW — min(buyer ceiling, level cap) active
|
|
2010
|
+
* holds. Settle one to reclaim; never "lifetime". */
|
|
2011
|
+
readonly EMaxClaimsReached: 12;
|
|
2012
|
+
/** Pre-S.1202 wave — lifetime rows never free, so new claims refuse.
|
|
2013
|
+
* The wave's cancel / expired-refund still work. */
|
|
2014
|
+
readonly ELegacyBatch: 22;
|
|
2015
|
+
/** The Job passed to a batch settle door has no BatchOriginKey. */
|
|
2016
|
+
readonly ENotBatchJob: 23;
|
|
2017
|
+
/** The attached wave is not this Job's origin batch. */
|
|
2018
|
+
readonly EWrongBatch: 24;
|
|
2019
|
+
readonly EWrongSellerScore: 25;
|
|
2020
|
+
readonly EWrongBuyerScore: 26;
|
|
2021
|
+
/** Registered Agent-ID buyer must reject via the agent-buyer variant. */
|
|
2022
|
+
readonly EBuyerIsAgent: 27;
|
|
2023
|
+
readonly EBuyerNotAgent: 28;
|
|
2024
|
+
};
|
|
2025
|
+
declare const REPUTATION_ABORT_CODES: {
|
|
2026
|
+
/** A bare v2 door (release_v2 / reject_v2 variants / refund_v2) on a
|
|
2027
|
+
* batch-origin Job — the client must attach the batch and settle via
|
|
2028
|
+
* the batch doors. */
|
|
2029
|
+
readonly EUseBatchSettle: 9;
|
|
2030
|
+
};
|
|
2031
|
+
declare const ESCROW_ABORT_CODES: {
|
|
2032
|
+
/** Stale package flow (FeeConfig VERSION moved) — update @t2000/*. */
|
|
2033
|
+
readonly EWrongVersion: 13;
|
|
2034
|
+
/** Second wave-hold free on one Job (unreachable via the doors). */
|
|
2035
|
+
readonly EBatchHoldReleased: 23;
|
|
2036
|
+
};
|
|
1957
2037
|
interface BatchOpeningTerms extends OpeningTerms {
|
|
1958
2038
|
/** Slots in the wave (1..live max; default live max 250). `amountUsdc`
|
|
1959
2039
|
* is PER SLOT — total escrow = `slots × amountUsdc`. */
|
|
@@ -2127,4 +2207,4 @@ declare function putJobSpec(base: string, content: string): Promise<string>;
|
|
|
2127
2207
|
* the store is untrusted; the chain hash is the authority). */
|
|
2128
2208
|
declare function getJobSpec(base: string, hash: string): Promise<string>;
|
|
2129
2209
|
|
|
2130
|
-
export {
|
|
2210
|
+
export { PROVEN_MIN_REVIEWS as $, A2A_ESCROW_FEE_CONFIG_ID as A, BATCH_ABORT_CODES as B, CLOCK_ID as C, DEFAULT_ACTIVITY_REPORT_URL as D, ESCROW_ABORT_CODES as E, MAX_DELIVER_HORIZON_MS as F, GAS_RESERVE_MIN as G, MAX_JOB_USDC as H, IKA_TYPE as I, JOB_STATES as J, KNOWN_TARGETS as K, LABEL_PATTERNS as L, MANIFEST_TYPE as M, MAX_REVIEW_WINDOW_MS as N, MIN_JOB_USDC as O, MIST_PER_SUI as P, NAVX_TYPE as Q, NO_DELIVERY_REGRESSION_FLOOR as R, OPENING_CLAIM_POLICIES as S, OPENING_CLAIM_POLICY_ANY_ACTIVE as T, OPENING_CLAIM_POLICY_PROVEN as U, OPENING_CLAIM_POLICY_PROVEN_4STAR as V, OVERLAY_FEE_RATE as W, type OverlayFeeConfig as X, PREFLIGHT_MAX_AMOUNT as Y, PREFLIGHT_OK as Z, PROVEN_MIN_AVG_STARS_X10 as _, A2A_ESCROW_PACKAGE_ID as a, extractAllUserLegs as a$, type PayOptions as a0, type PayResult as a1, type PreflightResult as a2, REPUTATION_ABORT_CODES as a3, REVIEW_MAX_STARS as a4, REVIEW_MIN_STARS as a5, SELLER_LEVEL_ACTIVE_CAPS as a6, STABLE_ASSETS as a7, SUI_DECIMALS as a8, SUI_TYPE as a9, WBTC_TYPE as aA, type X402ActivityPayload as aB, type ZkLoginProof as aC, ZkLoginSigner as aD, activeCapForLevel as aE, buildBatchClaimTx as aF, buildCancelBatchOpeningTx as aG, buildCreateBatchOpeningTx as aH, buildCreateJobTx as aI, buildDeliverJobTx as aJ, buildRefundBatchExpiredTx as aK, buildRefundJobTx as aL, buildRejectJobTx as aM, buildReleaseJobTx as aN, buildSendTx as aO, buildSwapTx as aP, checkPositiveAmount as aQ, checkSuiAddress as aR, claimPolicyLabel as aS, claimPolicyRequirement as aT, classifyAction as aU, classifyLabel as aV, classifySendAsset as aW, classifyTransaction as aX, deriveAgentScoreId as aY, effectiveSellerLevel as aZ, executeTx as a_, SUPPORTED_ASSETS as aa, type SellerLevel as ab, type SendAssetClass as ac, type SendResult as ad, type ServiceListing as ae, type SimulationResult as af, type StableAsset as ag, type SuiHolding as ah, type SuiRpcTxBlock as ai, type SupportedAsset as aj, type SwapRouteResult as ak, T2000Error as al, type T2000ErrorCode as am, type T2000ErrorData as an, T2000_OVERLAY_FEE_WALLET as ao, TOKEN_MAP as ap, type TransactionLeg as aq, type TransactionRecord as ar, type TransactionSigner as as, type TxDirection as at, USDC_DECIMALS as au, USDC_TYPE as av, USDE_TYPE as aw, USDSUI_TYPE as ax, USDT_TYPE as ay, WAL_TYPE as az, type ActivityReportConfig as b, A2A_ESCROW_PACKAGE_V12_ID as b$, extractTransferDetails as b0, extractTxCommands as b1, extractTxSender as b2, fallbackLabel as b3, fetchService as b4, findSwapRoute as b5, formatAssetAmount as b6, formatSui as b7, formatUsd as b8, getAgentScore as b9, rawToStable as bA, rawToUsdc as bB, refineLendingLabel as bC, reportX402Activity as bD, resolveSymbol as bE, resolveTokenType as bF, sellerLevel as bG, sellerLevelLabel as bH, stableToRaw as bI, suiToMist as bJ, truncateAddress as bK, usdcToRaw as bL, validateAddress as bM, verifyJobForSeller as bN, type T2000Options as bO, type X402Probe as bP, type SerializedCetusRoute as bQ, type SwapResult as bR, type SwapQuoteResult as bS, type PaymentRequest as bT, type SuiCoreClient as bU, type SponsoredCoinMergeCache as bV, type SendableAsset as bW, A2A_ESCROW_LATEST_PACKAGE_ID as bX, A2A_ESCROW_OPENING_PACKAGE_ID as bY, A2A_ESCROW_PACKAGE_V10_ID as bZ, A2A_ESCROW_PACKAGE_V11_ID as b_, getBatchClaimsByAgent as ba, getBatchOpening as bb, getDecimals as bc, getDecimalsForCoinType as bd, getJob as be, getJobBatchOrigin as bf, getJobSpec as bg, invalidSendAssetMessage as bh, jobActionsFor as bi, listServices as bj, mapMoveAbortCode as bk, mapWalletError as bl, meetsClaimPolicy as bm, meetsMinSellerLevel as bn, mistToSui as bo, parseSuiRpcTx as bp, payWithX402 as bq, preflightBatchClaim as br, preflightClaimOpening as bs, preflightCreateBatchOpening as bt, preflightCreateJob as bu, preflightFail as bv, preflightPay as bw, preflightSend as bx, preflightSwap as by, putJobSpec as bz, type AgentScore as c, A2A_ESCROW_PACKAGE_V2_ID as c0, A2A_ESCROW_PACKAGE_V3_ID as c1, A2A_ESCROW_PACKAGE_V6_ID as c2, A2A_ESCROW_PACKAGE_V7_ID as c3, A2A_ESCROW_PACKAGE_V8_ID as c4, A2A_SCORE_BOARD_ID as c5, type ApiRouteListing as c6, CETUS_USDC_SUI_POOL as c7, type CoinPage as c8, DEFAULT_GRPC_URL as c9, buildRefundUnclaimedTx as cA, buildSubmitFirstReviewTx as cB, buildSubmitReviewTx as cC, deserializeCetusRoute as cD, fetchAllCoins as cE, getCoinMeta as cF, getOpening as cG, getSuiClient as cH, getSuiGrpcClient as cI, isAllowedAsset as cJ, isCetusRouteFresh as cK, isInRegistry as cL, normalizeAsset as cM, normalizeCoinType as cN, preflightCreateOpening as cO, probeX402 as cP, queryHistory as cQ, queryTransaction as cR, selectAndSplitCoin as cS, selectSuiCoin as cT, serializeCetusRoute as cU, simulateTransaction as cV, throwIfSimulationFailed as cW, verifyCetusRouteCoinMatch as cX, GASLESS_MIN_STABLE_AMOUNT as ca, GASLESS_STABLE_TYPES as cb, MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID as cc, MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID as cd, MAINNET_A2A_ESCROW_PACKAGE_ID as ce, MAINNET_A2A_SCORE_BOARD_ID as cf, MAX_OPEN_WINDOW_MS as cg, OPERATION_ASSETS as ch, type Opening as ci, type OpeningTerms as cj, type Operation as ck, SENDABLE_ASSETS as cl, type SelectAndSplitResult as cm, type SerializedCetusRoutePath as cn, type SerializedRouterDataV3 as co, type ServicesRail as cp, type ServicesRow as cq, addSendToTx as cr, addSwapToTx as cs, assertAllowedAsset as ct, assertBuyerRequirements as cu, buildCancelOpeningTx as cv, buildClaimOpeningTx as cw, buildCreateEmptyScoreTx as cx, buildCreateOpeningTx as cy, buildDeclineJobTx as cz, BATCH_OPENING_TYPE_MARKER as d, BATCH_ORIGIN_KEY_TYPE_SUFFIX as e, type BalanceResponse as f, type BatchOpening as g, type BatchOpeningTerms as h, COIN_REGISTRY as i, type ClassifyBalanceChange as j, type ClassifyResult as k, type CoinMeta as l, DEFAULT_COMMERCE_API_BASE as m, DEFAULT_NETWORK as n, type DepositInfo as o, ETH_TYPE as p, type ExtractedTransfer as q, type Job as r, type JobState as s, type JobTerms as t, type JobVerification as u, KeypairSigner as v, LEVEL4_MAX_NO_DELIVERY as w, LEVEL4_MIN_REVIEWS as x, LOFI_TYPE as y, MAX_BATCH_SLOTS_DEFAULT as z };
|
|
@@ -1577,17 +1577,29 @@ declare function buildDeclineJobTx(jobId: string): Transaction;
|
|
|
1577
1577
|
* the protocol outcome lands on the seller's score. Score ids derive
|
|
1578
1578
|
* locally (`deriveAgentScoreId`); pass `buyerScoreId` exactly when the
|
|
1579
1579
|
* buyer is a registered agent — the contract refuses a mismatched
|
|
1580
|
-
* variant, so a registered buyer can't dodge its own counter.
|
|
1580
|
+
* variant, so a registered buyer can't dodge its own counter.
|
|
1581
|
+
*
|
|
1582
|
+
* S.1202: a batch-origin Job (has `BatchOriginKey` — read it with
|
|
1583
|
+
* `getJobBatchOrigin`) MUST pass `batchId` so the PTB targets
|
|
1584
|
+
* `batch::batch_reject`/`batch_reject_agent_buyer` and frees the per-wave
|
|
1585
|
+
* hold with the money; the bare reputation door aborts `EUseBatchSettle`
|
|
1586
|
+
* on origin Jobs. */
|
|
1581
1587
|
declare function buildRejectJobTx(jobId: string, v2: {
|
|
1582
1588
|
sellerScoreId: string;
|
|
1583
1589
|
registryId: string;
|
|
1584
1590
|
buyerScoreId?: string;
|
|
1591
|
+
batchId?: string;
|
|
1585
1592
|
}): Transaction;
|
|
1586
1593
|
/** Deadline refund (no delivery) — S.1063: settles through
|
|
1587
1594
|
* `reputation::refund_v2` so `no_delivery` lands on the seller's score.
|
|
1588
|
-
* Still permissionless: funds only ever return to the buyer.
|
|
1595
|
+
* Still permissionless: funds only ever return to the buyer.
|
|
1596
|
+
*
|
|
1597
|
+
* S.1202: pass `batchId` for a batch-origin Job (see `getJobBatchOrigin`)
|
|
1598
|
+
* — the crank must attach the origin wave (`batch::batch_refund`), and a
|
|
1599
|
+
* wrong wave aborts `EWrongBatch` on-chain. */
|
|
1589
1600
|
declare function buildRefundJobTx(jobId: string, v2: {
|
|
1590
1601
|
sellerScoreId: string;
|
|
1602
|
+
batchId?: string;
|
|
1591
1603
|
}): Transaction;
|
|
1592
1604
|
/** Seller posts the delivery commitment (hex hash) before the deadline. */
|
|
1593
1605
|
declare function buildDeliverJobTx(jobId: string, deliveryHash: string): Transaction;
|
|
@@ -1597,13 +1609,37 @@ declare function buildDeliverJobTx(jobId: string, deliveryHash: string): Transac
|
|
|
1597
1609
|
* board-claimed job frees its active seat with the money. Hire jobs pass
|
|
1598
1610
|
* the same score; the contract's `ClaimedJobKey` marker decides whether
|
|
1599
1611
|
* a decrement lands. A scoreless seller needs the `create_empty_score`
|
|
1600
|
-
* precursor first (same hop as reject/refund since S.1063).
|
|
1612
|
+
* precursor first (same hop as reject/refund since S.1063).
|
|
1613
|
+
*
|
|
1614
|
+
* S.1202: a batch-origin Job MUST pass `batchId` (read it with
|
|
1615
|
+
* `getJobBatchOrigin`) so the release targets `batch::batch_release` and
|
|
1616
|
+
* frees the per-wave hold in the same tx — bare `release_v2` aborts
|
|
1617
|
+
* `EUseBatchSettle` on origin Jobs. Applies to all three release shapes
|
|
1618
|
+
* (buyer accept, buyer goodwill, permissionless timeout crank). */
|
|
1601
1619
|
declare function buildReleaseJobTx(jobId: string, v2: {
|
|
1602
1620
|
sellerScoreId: string;
|
|
1621
|
+
batchId?: string;
|
|
1603
1622
|
}): Transaction;
|
|
1604
1623
|
/** Fetch + parse a `Job` shared object. Throws `RPC_ERROR` when the id
|
|
1605
1624
|
* doesn't resolve to an a2a_escrow Job. */
|
|
1606
1625
|
declare function getJob(client: SuiCoreClient, jobId: string): Promise<Job>;
|
|
1626
|
+
/** Type-name suffix of the S.1202 origin marker DF on a batch-claimed
|
|
1627
|
+
* Job. Matched as a SUFFIX so reads never depend on the V12 defining
|
|
1628
|
+
* package id (fillable only after the cutover) — the parent Job is
|
|
1629
|
+
* already authenticated by `getJob`/object-type checks, and only our
|
|
1630
|
+
* package can attach DFs to it. */
|
|
1631
|
+
declare const BATCH_ORIGIN_KEY_TYPE_SUFFIX: "::escrow::BatchOriginKey";
|
|
1632
|
+
/**
|
|
1633
|
+
* The `BatchOpening` id a Job was batch-claimed from, or null for
|
|
1634
|
+
* single-opening / hire Jobs (S.1202 — reads the `BatchOriginKey` DF).
|
|
1635
|
+
*
|
|
1636
|
+
* Every settle/reject/refund prepare MUST call this first: an origin Job
|
|
1637
|
+
* settles only through the batch doors (`batchId` on the builders), and
|
|
1638
|
+
* the bare v2 doors abort `EUseBatchSettle` on it. Errors propagate —
|
|
1639
|
+
* a "couldn't read, assume non-batch" fallback would build a PTB that
|
|
1640
|
+
* aborts on-chain anyway, with a worse message.
|
|
1641
|
+
*/
|
|
1642
|
+
declare function getJobBatchOrigin(client: SuiCoreClient, jobId: string): Promise<string | null>;
|
|
1607
1643
|
/** What `caller` can do to `job` right now — drives `t2 job watch` (the
|
|
1608
1644
|
* ACP-style "available action" readout) and any host UI. */
|
|
1609
1645
|
declare function jobActionsFor(job: Job, caller: string, nowMs?: number): string[];
|
|
@@ -1641,8 +1677,12 @@ declare function verifyJobForSeller({ client, jobId, seller, minAmountUsdc, minR
|
|
|
1641
1677
|
* target the LATEST published id — the original id (types, Job verbs) is
|
|
1642
1678
|
* unchanged.
|
|
1643
1679
|
*/
|
|
1644
|
-
/** The LATEST published `a2a_escrow` package id on MAINNET (
|
|
1645
|
-
* 2026-08-
|
|
1680
|
+
/** The LATEST published `a2a_escrow` package id on MAINNET (v12 upgrade
|
|
1681
|
+
* 2026-08-26, S.1202 — batch ACTIVE per-wave claims + batch-aware settle,
|
|
1682
|
+
* FeeConfig VERSION 6→7 cutover with immediate migrate: origin-stamped
|
|
1683
|
+
* batch Jobs settle via `batch::batch_release`/`batch_reject*`/
|
|
1684
|
+
* `batch_refund`, and every v11-and-earlier entry aborts EWrongVersion;
|
|
1685
|
+
* v11 = S.1193 — batch openings, additive, NO migrate:
|
|
1646
1686
|
* `batch` module + `set_max_batch_slots`;
|
|
1647
1687
|
* v10 = S.1192 seller levels + active caps, VERSION 6 cutover:
|
|
1648
1688
|
* claim_v2/claim_proven_v2/create_open_v2/release_v2;
|
|
@@ -1659,9 +1699,9 @@ declare function verifyJobForSeller({ client, jobId, seller, minAmountUsdc, minR
|
|
|
1659
1699
|
* upgrade + `migrate` cutover is a ONE-VALUE change here. The original id
|
|
1660
1700
|
* (`MAINNET_A2A_ESCROW_PACKAGE_ID` in job.ts) remains the anchor for type
|
|
1661
1701
|
* strings, event filters, and object-type queries — those never move. */
|
|
1662
|
-
declare const MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID = "
|
|
1702
|
+
declare const MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID = "0x1f88ca77b1980e3d0750e83d1363c6025cd677c2f420cae51a86d4a0bddf93c5";
|
|
1663
1703
|
/** Back-compat name for the latest id (pre-S.981 consumers import this). */
|
|
1664
|
-
declare const MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID = "
|
|
1704
|
+
declare const MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID = "0x1f88ca77b1980e3d0750e83d1363c6025cd677c2f420cae51a86d4a0bddf93c5";
|
|
1665
1705
|
/** Env-overridable latest id for testnet/dev (NOT a trust anchor). A fresh
|
|
1666
1706
|
* dev publish has original == latest, so `A2A_ESCROW_PACKAGE_ID` alone is
|
|
1667
1707
|
* honored as the fallback override. */
|
|
@@ -1710,6 +1750,13 @@ declare const A2A_ESCROW_PACKAGE_V10_ID: string;
|
|
|
1710
1750
|
* DEFINING-id anchor like V2/V3/V6/V7/V8/V10 — never moves again, even
|
|
1711
1751
|
* when LATEST does. */
|
|
1712
1752
|
declare const A2A_ESCROW_PACKAGE_V11_ID: string;
|
|
1753
|
+
/** v12 (S.1202, upgrade AGYachnt… 2026-08-26) — defining id for the batch
|
|
1754
|
+
* active-claims surface: the `BatchSlotHoldReleased` event and the
|
|
1755
|
+
* BatchOriginKey/BatchHoldReleasedKey/ActiveClaimsSemanticsKey DF key
|
|
1756
|
+
* types. A DEFINING-id anchor like V2…V11 — never moves again, even when
|
|
1757
|
+
* LATEST does. (Job-side origin reads may still suffix-match the type
|
|
1758
|
+
* name — `BATCH_ORIGIN_KEY_TYPE_SUFFIX` in wallet/job.ts.) */
|
|
1759
|
+
declare const A2A_ESCROW_PACKAGE_V12_ID: string;
|
|
1713
1760
|
/** Default claim policy: any ACTIVE registered Agent ID ($0 claim, FCFS). */
|
|
1714
1761
|
declare const OPENING_CLAIM_POLICY_ANY_ACTIVE = 0;
|
|
1715
1762
|
/** S.1054 — Proven: claimer needs ≥ PROVEN_MIN_REVIEWS on-chain reviews
|
|
@@ -1954,6 +2001,39 @@ declare function buildSubmitFirstReviewTx({ jobId, stars, boardId, }: {
|
|
|
1954
2001
|
declare const MAX_BATCH_SLOTS_DEFAULT = 250;
|
|
1955
2002
|
/** Object-type marker for `resolveCreatedObjectId` digest walks. */
|
|
1956
2003
|
declare const BATCH_OPENING_TYPE_MARKER: "::batch::BatchOpening<";
|
|
2004
|
+
/** S.1202 abort codes clients map to English (transcribed from
|
|
2005
|
+
* `contracts/a2a_escrow` — the runbook's abort-code map is the SSOT).
|
|
2006
|
+
* Grouped by the aborting MODULE, because Move abort codes are only
|
|
2007
|
+
* unique per module. */
|
|
2008
|
+
declare const BATCH_ABORT_CODES: {
|
|
2009
|
+
/** At your wave cap RIGHT NOW — min(buyer ceiling, level cap) active
|
|
2010
|
+
* holds. Settle one to reclaim; never "lifetime". */
|
|
2011
|
+
readonly EMaxClaimsReached: 12;
|
|
2012
|
+
/** Pre-S.1202 wave — lifetime rows never free, so new claims refuse.
|
|
2013
|
+
* The wave's cancel / expired-refund still work. */
|
|
2014
|
+
readonly ELegacyBatch: 22;
|
|
2015
|
+
/** The Job passed to a batch settle door has no BatchOriginKey. */
|
|
2016
|
+
readonly ENotBatchJob: 23;
|
|
2017
|
+
/** The attached wave is not this Job's origin batch. */
|
|
2018
|
+
readonly EWrongBatch: 24;
|
|
2019
|
+
readonly EWrongSellerScore: 25;
|
|
2020
|
+
readonly EWrongBuyerScore: 26;
|
|
2021
|
+
/** Registered Agent-ID buyer must reject via the agent-buyer variant. */
|
|
2022
|
+
readonly EBuyerIsAgent: 27;
|
|
2023
|
+
readonly EBuyerNotAgent: 28;
|
|
2024
|
+
};
|
|
2025
|
+
declare const REPUTATION_ABORT_CODES: {
|
|
2026
|
+
/** A bare v2 door (release_v2 / reject_v2 variants / refund_v2) on a
|
|
2027
|
+
* batch-origin Job — the client must attach the batch and settle via
|
|
2028
|
+
* the batch doors. */
|
|
2029
|
+
readonly EUseBatchSettle: 9;
|
|
2030
|
+
};
|
|
2031
|
+
declare const ESCROW_ABORT_CODES: {
|
|
2032
|
+
/** Stale package flow (FeeConfig VERSION moved) — update @t2000/*. */
|
|
2033
|
+
readonly EWrongVersion: 13;
|
|
2034
|
+
/** Second wave-hold free on one Job (unreachable via the doors). */
|
|
2035
|
+
readonly EBatchHoldReleased: 23;
|
|
2036
|
+
};
|
|
1957
2037
|
interface BatchOpeningTerms extends OpeningTerms {
|
|
1958
2038
|
/** Slots in the wave (1..live max; default live max 250). `amountUsdc`
|
|
1959
2039
|
* is PER SLOT — total escrow = `slots × amountUsdc`. */
|
|
@@ -2127,4 +2207,4 @@ declare function putJobSpec(base: string, content: string): Promise<string>;
|
|
|
2127
2207
|
* the store is untrusted; the chain hash is the authority). */
|
|
2128
2208
|
declare function getJobSpec(base: string, hash: string): Promise<string>;
|
|
2129
2209
|
|
|
2130
|
-
export {
|
|
2210
|
+
export { PROVEN_MIN_REVIEWS as $, A2A_ESCROW_FEE_CONFIG_ID as A, BATCH_ABORT_CODES as B, CLOCK_ID as C, DEFAULT_ACTIVITY_REPORT_URL as D, ESCROW_ABORT_CODES as E, MAX_DELIVER_HORIZON_MS as F, GAS_RESERVE_MIN as G, MAX_JOB_USDC as H, IKA_TYPE as I, JOB_STATES as J, KNOWN_TARGETS as K, LABEL_PATTERNS as L, MANIFEST_TYPE as M, MAX_REVIEW_WINDOW_MS as N, MIN_JOB_USDC as O, MIST_PER_SUI as P, NAVX_TYPE as Q, NO_DELIVERY_REGRESSION_FLOOR as R, OPENING_CLAIM_POLICIES as S, OPENING_CLAIM_POLICY_ANY_ACTIVE as T, OPENING_CLAIM_POLICY_PROVEN as U, OPENING_CLAIM_POLICY_PROVEN_4STAR as V, OVERLAY_FEE_RATE as W, type OverlayFeeConfig as X, PREFLIGHT_MAX_AMOUNT as Y, PREFLIGHT_OK as Z, PROVEN_MIN_AVG_STARS_X10 as _, A2A_ESCROW_PACKAGE_ID as a, extractAllUserLegs as a$, type PayOptions as a0, type PayResult as a1, type PreflightResult as a2, REPUTATION_ABORT_CODES as a3, REVIEW_MAX_STARS as a4, REVIEW_MIN_STARS as a5, SELLER_LEVEL_ACTIVE_CAPS as a6, STABLE_ASSETS as a7, SUI_DECIMALS as a8, SUI_TYPE as a9, WBTC_TYPE as aA, type X402ActivityPayload as aB, type ZkLoginProof as aC, ZkLoginSigner as aD, activeCapForLevel as aE, buildBatchClaimTx as aF, buildCancelBatchOpeningTx as aG, buildCreateBatchOpeningTx as aH, buildCreateJobTx as aI, buildDeliverJobTx as aJ, buildRefundBatchExpiredTx as aK, buildRefundJobTx as aL, buildRejectJobTx as aM, buildReleaseJobTx as aN, buildSendTx as aO, buildSwapTx as aP, checkPositiveAmount as aQ, checkSuiAddress as aR, claimPolicyLabel as aS, claimPolicyRequirement as aT, classifyAction as aU, classifyLabel as aV, classifySendAsset as aW, classifyTransaction as aX, deriveAgentScoreId as aY, effectiveSellerLevel as aZ, executeTx as a_, SUPPORTED_ASSETS as aa, type SellerLevel as ab, type SendAssetClass as ac, type SendResult as ad, type ServiceListing as ae, type SimulationResult as af, type StableAsset as ag, type SuiHolding as ah, type SuiRpcTxBlock as ai, type SupportedAsset as aj, type SwapRouteResult as ak, T2000Error as al, type T2000ErrorCode as am, type T2000ErrorData as an, T2000_OVERLAY_FEE_WALLET as ao, TOKEN_MAP as ap, type TransactionLeg as aq, type TransactionRecord as ar, type TransactionSigner as as, type TxDirection as at, USDC_DECIMALS as au, USDC_TYPE as av, USDE_TYPE as aw, USDSUI_TYPE as ax, USDT_TYPE as ay, WAL_TYPE as az, type ActivityReportConfig as b, A2A_ESCROW_PACKAGE_V12_ID as b$, extractTransferDetails as b0, extractTxCommands as b1, extractTxSender as b2, fallbackLabel as b3, fetchService as b4, findSwapRoute as b5, formatAssetAmount as b6, formatSui as b7, formatUsd as b8, getAgentScore as b9, rawToStable as bA, rawToUsdc as bB, refineLendingLabel as bC, reportX402Activity as bD, resolveSymbol as bE, resolveTokenType as bF, sellerLevel as bG, sellerLevelLabel as bH, stableToRaw as bI, suiToMist as bJ, truncateAddress as bK, usdcToRaw as bL, validateAddress as bM, verifyJobForSeller as bN, type T2000Options as bO, type X402Probe as bP, type SerializedCetusRoute as bQ, type SwapResult as bR, type SwapQuoteResult as bS, type PaymentRequest as bT, type SuiCoreClient as bU, type SponsoredCoinMergeCache as bV, type SendableAsset as bW, A2A_ESCROW_LATEST_PACKAGE_ID as bX, A2A_ESCROW_OPENING_PACKAGE_ID as bY, A2A_ESCROW_PACKAGE_V10_ID as bZ, A2A_ESCROW_PACKAGE_V11_ID as b_, getBatchClaimsByAgent as ba, getBatchOpening as bb, getDecimals as bc, getDecimalsForCoinType as bd, getJob as be, getJobBatchOrigin as bf, getJobSpec as bg, invalidSendAssetMessage as bh, jobActionsFor as bi, listServices as bj, mapMoveAbortCode as bk, mapWalletError as bl, meetsClaimPolicy as bm, meetsMinSellerLevel as bn, mistToSui as bo, parseSuiRpcTx as bp, payWithX402 as bq, preflightBatchClaim as br, preflightClaimOpening as bs, preflightCreateBatchOpening as bt, preflightCreateJob as bu, preflightFail as bv, preflightPay as bw, preflightSend as bx, preflightSwap as by, putJobSpec as bz, type AgentScore as c, A2A_ESCROW_PACKAGE_V2_ID as c0, A2A_ESCROW_PACKAGE_V3_ID as c1, A2A_ESCROW_PACKAGE_V6_ID as c2, A2A_ESCROW_PACKAGE_V7_ID as c3, A2A_ESCROW_PACKAGE_V8_ID as c4, A2A_SCORE_BOARD_ID as c5, type ApiRouteListing as c6, CETUS_USDC_SUI_POOL as c7, type CoinPage as c8, DEFAULT_GRPC_URL as c9, buildRefundUnclaimedTx as cA, buildSubmitFirstReviewTx as cB, buildSubmitReviewTx as cC, deserializeCetusRoute as cD, fetchAllCoins as cE, getCoinMeta as cF, getOpening as cG, getSuiClient as cH, getSuiGrpcClient as cI, isAllowedAsset as cJ, isCetusRouteFresh as cK, isInRegistry as cL, normalizeAsset as cM, normalizeCoinType as cN, preflightCreateOpening as cO, probeX402 as cP, queryHistory as cQ, queryTransaction as cR, selectAndSplitCoin as cS, selectSuiCoin as cT, serializeCetusRoute as cU, simulateTransaction as cV, throwIfSimulationFailed as cW, verifyCetusRouteCoinMatch as cX, GASLESS_MIN_STABLE_AMOUNT as ca, GASLESS_STABLE_TYPES as cb, MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID as cc, MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID as cd, MAINNET_A2A_ESCROW_PACKAGE_ID as ce, MAINNET_A2A_SCORE_BOARD_ID as cf, MAX_OPEN_WINDOW_MS as cg, OPERATION_ASSETS as ch, type Opening as ci, type OpeningTerms as cj, type Operation as ck, SENDABLE_ASSETS as cl, type SelectAndSplitResult as cm, type SerializedCetusRoutePath as cn, type SerializedRouterDataV3 as co, type ServicesRail as cp, type ServicesRow as cq, addSendToTx as cr, addSwapToTx as cs, assertAllowedAsset as ct, assertBuyerRequirements as cu, buildCancelOpeningTx as cv, buildClaimOpeningTx as cw, buildCreateEmptyScoreTx as cx, buildCreateOpeningTx as cy, buildDeclineJobTx as cz, BATCH_OPENING_TYPE_MARKER as d, BATCH_ORIGIN_KEY_TYPE_SUFFIX as e, type BalanceResponse as f, type BatchOpening as g, type BatchOpeningTerms as h, COIN_REGISTRY as i, type ClassifyBalanceChange as j, type ClassifyResult as k, type CoinMeta as l, DEFAULT_COMMERCE_API_BASE as m, DEFAULT_NETWORK as n, type DepositInfo as o, ETH_TYPE as p, type ExtractedTransfer as q, type Job as r, type JobState as s, type JobTerms as t, type JobVerification as u, KeypairSigner as v, LEVEL4_MAX_NO_DELIVERY as w, LEVEL4_MIN_REVIEWS as x, LOFI_TYPE as y, MAX_BATCH_SLOTS_DEFAULT as z };
|
package/dist/index.cjs
CHANGED
|
@@ -3005,7 +3005,7 @@ init_coinSelection();
|
|
|
3005
3005
|
init_errors();
|
|
3006
3006
|
init_token_registry();
|
|
3007
3007
|
init_coinSelection();
|
|
3008
|
-
var MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID = "
|
|
3008
|
+
var MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID = "0x1f88ca77b1980e3d0750e83d1363c6025cd677c2f420cae51a86d4a0bddf93c5";
|
|
3009
3009
|
var MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID = MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID;
|
|
3010
3010
|
var A2A_ESCROW_LATEST_PACKAGE_ID = process.env.A2A_ESCROW_OPENING_PACKAGE_ID ?? process.env.A2A_ESCROW_PACKAGE_ID ?? MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID;
|
|
3011
3011
|
var A2A_ESCROW_OPENING_PACKAGE_ID = A2A_ESCROW_LATEST_PACKAGE_ID;
|
|
@@ -3016,6 +3016,7 @@ var A2A_ESCROW_PACKAGE_V7_ID = "0x4249f0b242c47c7baf0c37304365bc4bbe769bcedf11f3
|
|
|
3016
3016
|
var A2A_ESCROW_PACKAGE_V8_ID = "0x1595b80bc05a03607f3908702c866ca63cf961025b4263b5ecbe419e07f8ff31";
|
|
3017
3017
|
var A2A_ESCROW_PACKAGE_V10_ID = process.env.A2A_ESCROW_PACKAGE_V10_ID ?? "0x5c90ec07da01bf885a4e65247ce98b75ab8a042cd965d30d7213856d579c4afa";
|
|
3018
3018
|
var A2A_ESCROW_PACKAGE_V11_ID = process.env.A2A_ESCROW_PACKAGE_V11_ID ?? "0x2a928916c859a159e6d6f4841073a31397d01336c1ea689ce74344e456463c8d";
|
|
3019
|
+
var A2A_ESCROW_PACKAGE_V12_ID = process.env.A2A_ESCROW_PACKAGE_V12_ID ?? "0x1f88ca77b1980e3d0750e83d1363c6025cd677c2f420cae51a86d4a0bddf93c5";
|
|
3019
3020
|
var CLOCK_ID2 = "0x6";
|
|
3020
3021
|
var MODULE = "opening";
|
|
3021
3022
|
var SHA256_HEX_RE = /^(0x)?[0-9a-fA-F]{64}$/;
|
|
@@ -3346,6 +3347,29 @@ function buildDeclineJobTx(jobId) {
|
|
|
3346
3347
|
}
|
|
3347
3348
|
function buildRejectJobTx(jobId, v2) {
|
|
3348
3349
|
const tx = new transactions.Transaction();
|
|
3350
|
+
if (v2.batchId) {
|
|
3351
|
+
tx.moveCall({
|
|
3352
|
+
target: `${A2A_ESCROW_LATEST_PACKAGE_ID}::batch::${v2.buyerScoreId ? "batch_reject_agent_buyer" : "batch_reject"}`,
|
|
3353
|
+
typeArguments: [exports.USDC_TYPE],
|
|
3354
|
+
arguments: v2.buyerScoreId ? [
|
|
3355
|
+
tx.object(v2.batchId),
|
|
3356
|
+
tx.object(jobId),
|
|
3357
|
+
tx.object(v2.sellerScoreId),
|
|
3358
|
+
tx.object(v2.buyerScoreId),
|
|
3359
|
+
tx.object(v2.registryId),
|
|
3360
|
+
feeConfigArg2(tx),
|
|
3361
|
+
tx.object(CLOCK_ID3)
|
|
3362
|
+
] : [
|
|
3363
|
+
tx.object(v2.batchId),
|
|
3364
|
+
tx.object(jobId),
|
|
3365
|
+
tx.object(v2.sellerScoreId),
|
|
3366
|
+
tx.object(v2.registryId),
|
|
3367
|
+
feeConfigArg2(tx),
|
|
3368
|
+
tx.object(CLOCK_ID3)
|
|
3369
|
+
]
|
|
3370
|
+
});
|
|
3371
|
+
return tx;
|
|
3372
|
+
}
|
|
3349
3373
|
tx.moveCall({
|
|
3350
3374
|
target: `${A2A_ESCROW_LATEST_PACKAGE_ID}::reputation::${v2.buyerScoreId ? "reject_v2_agent_buyer" : "reject_v2"}`,
|
|
3351
3375
|
typeArguments: [exports.USDC_TYPE],
|
|
@@ -3368,6 +3392,20 @@ function buildRejectJobTx(jobId, v2) {
|
|
|
3368
3392
|
}
|
|
3369
3393
|
function buildRefundJobTx(jobId, v2) {
|
|
3370
3394
|
const tx = new transactions.Transaction();
|
|
3395
|
+
if (v2.batchId) {
|
|
3396
|
+
tx.moveCall({
|
|
3397
|
+
target: `${A2A_ESCROW_LATEST_PACKAGE_ID}::batch::batch_refund`,
|
|
3398
|
+
typeArguments: [exports.USDC_TYPE],
|
|
3399
|
+
arguments: [
|
|
3400
|
+
tx.object(v2.batchId),
|
|
3401
|
+
tx.object(jobId),
|
|
3402
|
+
tx.object(v2.sellerScoreId),
|
|
3403
|
+
feeConfigArg2(tx),
|
|
3404
|
+
tx.object(CLOCK_ID3)
|
|
3405
|
+
]
|
|
3406
|
+
});
|
|
3407
|
+
return tx;
|
|
3408
|
+
}
|
|
3371
3409
|
tx.moveCall({
|
|
3372
3410
|
target: `${A2A_ESCROW_LATEST_PACKAGE_ID}::reputation::refund_v2`,
|
|
3373
3411
|
typeArguments: [exports.USDC_TYPE],
|
|
@@ -3396,6 +3434,20 @@ function buildDeliverJobTx(jobId, deliveryHash) {
|
|
|
3396
3434
|
}
|
|
3397
3435
|
function buildReleaseJobTx(jobId, v2) {
|
|
3398
3436
|
const tx = new transactions.Transaction();
|
|
3437
|
+
if (v2.batchId) {
|
|
3438
|
+
tx.moveCall({
|
|
3439
|
+
target: `${A2A_ESCROW_LATEST_PACKAGE_ID}::batch::batch_release`,
|
|
3440
|
+
typeArguments: [exports.USDC_TYPE],
|
|
3441
|
+
arguments: [
|
|
3442
|
+
tx.object(v2.batchId),
|
|
3443
|
+
tx.object(jobId),
|
|
3444
|
+
tx.object(v2.sellerScoreId),
|
|
3445
|
+
feeConfigArg2(tx),
|
|
3446
|
+
tx.object(CLOCK_ID3)
|
|
3447
|
+
]
|
|
3448
|
+
});
|
|
3449
|
+
return tx;
|
|
3450
|
+
}
|
|
3399
3451
|
tx.moveCall({
|
|
3400
3452
|
target: `${A2A_ESCROW_LATEST_PACKAGE_ID}::reputation::release_v2`,
|
|
3401
3453
|
typeArguments: [exports.USDC_TYPE],
|
|
@@ -3445,6 +3497,26 @@ async function getJob(client, jobId) {
|
|
|
3445
3497
|
createdAtMs: Number(json.created_at_ms)
|
|
3446
3498
|
};
|
|
3447
3499
|
}
|
|
3500
|
+
var BATCH_ORIGIN_KEY_TYPE_SUFFIX = "::escrow::BatchOriginKey";
|
|
3501
|
+
async function getJobBatchOrigin(client, jobId) {
|
|
3502
|
+
let cursor = null;
|
|
3503
|
+
do {
|
|
3504
|
+
const page = await client.core.listDynamicFields({
|
|
3505
|
+
parentId: jobId,
|
|
3506
|
+
cursor: cursor ?? void 0
|
|
3507
|
+
});
|
|
3508
|
+
for (const field of page.dynamicFields) {
|
|
3509
|
+
if (!field.name.type.endsWith(BATCH_ORIGIN_KEY_TYPE_SUFFIX)) continue;
|
|
3510
|
+
const resp = await client.core.getDynamicField({
|
|
3511
|
+
parentId: jobId,
|
|
3512
|
+
name: field.name
|
|
3513
|
+
});
|
|
3514
|
+
return bcs.bcs.Address.parse(resp.dynamicField.value.bcs);
|
|
3515
|
+
}
|
|
3516
|
+
cursor = page.hasNextPage ? page.cursor : null;
|
|
3517
|
+
} while (cursor);
|
|
3518
|
+
return null;
|
|
3519
|
+
}
|
|
3448
3520
|
function jobActionsFor(job, caller, nowMs = Date.now()) {
|
|
3449
3521
|
const me = validateAddress(caller);
|
|
3450
3522
|
const isBuyer = me === job.buyer;
|
|
@@ -3707,6 +3779,35 @@ var MODULE4 = "batch";
|
|
|
3707
3779
|
var CLOCK_ID5 = "0x6";
|
|
3708
3780
|
var MAX_BATCH_SLOTS_DEFAULT = 250;
|
|
3709
3781
|
var BATCH_OPENING_TYPE_MARKER = "::batch::BatchOpening<";
|
|
3782
|
+
var BATCH_ABORT_CODES = {
|
|
3783
|
+
/** At your wave cap RIGHT NOW — min(buyer ceiling, level cap) active
|
|
3784
|
+
* holds. Settle one to reclaim; never "lifetime". */
|
|
3785
|
+
EMaxClaimsReached: 12,
|
|
3786
|
+
/** Pre-S.1202 wave — lifetime rows never free, so new claims refuse.
|
|
3787
|
+
* The wave's cancel / expired-refund still work. */
|
|
3788
|
+
ELegacyBatch: 22,
|
|
3789
|
+
/** The Job passed to a batch settle door has no BatchOriginKey. */
|
|
3790
|
+
ENotBatchJob: 23,
|
|
3791
|
+
/** The attached wave is not this Job's origin batch. */
|
|
3792
|
+
EWrongBatch: 24,
|
|
3793
|
+
EWrongSellerScore: 25,
|
|
3794
|
+
EWrongBuyerScore: 26,
|
|
3795
|
+
/** Registered Agent-ID buyer must reject via the agent-buyer variant. */
|
|
3796
|
+
EBuyerIsAgent: 27,
|
|
3797
|
+
EBuyerNotAgent: 28
|
|
3798
|
+
};
|
|
3799
|
+
var REPUTATION_ABORT_CODES = {
|
|
3800
|
+
/** A bare v2 door (release_v2 / reject_v2 variants / refund_v2) on a
|
|
3801
|
+
* batch-origin Job — the client must attach the batch and settle via
|
|
3802
|
+
* the batch doors. */
|
|
3803
|
+
EUseBatchSettle: 9
|
|
3804
|
+
};
|
|
3805
|
+
var ESCROW_ABORT_CODES = {
|
|
3806
|
+
/** Stale package flow (FeeConfig VERSION moved) — update @t2000/*. */
|
|
3807
|
+
EWrongVersion: 13,
|
|
3808
|
+
/** Second wave-hold free on one Job (unreachable via the doors). */
|
|
3809
|
+
EBatchHoldReleased: 23
|
|
3810
|
+
};
|
|
3710
3811
|
function preflightCreateBatchOpening(terms) {
|
|
3711
3812
|
const single = preflightCreateOpening(terms);
|
|
3712
3813
|
if (!single.valid) return single;
|
|
@@ -5117,6 +5218,7 @@ exports.A2A_ESCROW_OPENING_PACKAGE_ID = A2A_ESCROW_OPENING_PACKAGE_ID;
|
|
|
5117
5218
|
exports.A2A_ESCROW_PACKAGE_ID = A2A_ESCROW_PACKAGE_ID;
|
|
5118
5219
|
exports.A2A_ESCROW_PACKAGE_V10_ID = A2A_ESCROW_PACKAGE_V10_ID;
|
|
5119
5220
|
exports.A2A_ESCROW_PACKAGE_V11_ID = A2A_ESCROW_PACKAGE_V11_ID;
|
|
5221
|
+
exports.A2A_ESCROW_PACKAGE_V12_ID = A2A_ESCROW_PACKAGE_V12_ID;
|
|
5120
5222
|
exports.A2A_ESCROW_PACKAGE_V2_ID = A2A_ESCROW_PACKAGE_V2_ID;
|
|
5121
5223
|
exports.A2A_ESCROW_PACKAGE_V3_ID = A2A_ESCROW_PACKAGE_V3_ID;
|
|
5122
5224
|
exports.A2A_ESCROW_PACKAGE_V6_ID = A2A_ESCROW_PACKAGE_V6_ID;
|
|
@@ -5127,7 +5229,9 @@ exports.AGENT_CATEGORIES = AGENT_CATEGORIES;
|
|
|
5127
5229
|
exports.AUDRIC_PARENT = AUDRIC_PARENT;
|
|
5128
5230
|
exports.AUDRIC_PARENT_NAME = AUDRIC_PARENT_NAME;
|
|
5129
5231
|
exports.AUDRIC_PARENT_NFT_ID = AUDRIC_PARENT_NFT_ID;
|
|
5232
|
+
exports.BATCH_ABORT_CODES = BATCH_ABORT_CODES;
|
|
5130
5233
|
exports.BATCH_OPENING_TYPE_MARKER = BATCH_OPENING_TYPE_MARKER;
|
|
5234
|
+
exports.BATCH_ORIGIN_KEY_TYPE_SUFFIX = BATCH_ORIGIN_KEY_TYPE_SUFFIX;
|
|
5131
5235
|
exports.CETUS_USDC_SUI_POOL = CETUS_USDC_SUI_POOL;
|
|
5132
5236
|
exports.CLOCK_ID = CLOCK_ID;
|
|
5133
5237
|
exports.CommerceClient = CommerceClient;
|
|
@@ -5136,6 +5240,7 @@ exports.DEFAULT_API_BASE = DEFAULT_API_BASE;
|
|
|
5136
5240
|
exports.DEFAULT_COMMERCE_API_BASE = DEFAULT_COMMERCE_API_BASE;
|
|
5137
5241
|
exports.DEFAULT_GRPC_URL = DEFAULT_GRPC_URL;
|
|
5138
5242
|
exports.DEFAULT_NETWORK = DEFAULT_NETWORK;
|
|
5243
|
+
exports.ESCROW_ABORT_CODES = ESCROW_ABORT_CODES;
|
|
5139
5244
|
exports.ESCROW_JOB_TYPE_MARKER = ESCROW_JOB_TYPE_MARKER;
|
|
5140
5245
|
exports.GASLESS_MIN_STABLE_AMOUNT = GASLESS_MIN_STABLE_AMOUNT;
|
|
5141
5246
|
exports.GASLESS_STABLE_TYPES = GASLESS_STABLE_TYPES;
|
|
@@ -5171,6 +5276,7 @@ exports.OPENING_TYPE_MARKER = OPENING_TYPE_MARKER;
|
|
|
5171
5276
|
exports.OPERATION_ASSETS = OPERATION_ASSETS;
|
|
5172
5277
|
exports.PROVEN_MIN_AVG_STARS_X10 = PROVEN_MIN_AVG_STARS_X10;
|
|
5173
5278
|
exports.PROVEN_MIN_REVIEWS = PROVEN_MIN_REVIEWS;
|
|
5279
|
+
exports.REPUTATION_ABORT_CODES = REPUTATION_ABORT_CODES;
|
|
5174
5280
|
exports.REVIEW_MAX_STARS = REVIEW_MAX_STARS;
|
|
5175
5281
|
exports.REVIEW_MIN_STARS = REVIEW_MIN_STARS;
|
|
5176
5282
|
exports.SELLER_LEVEL_ACTIVE_CAPS = SELLER_LEVEL_ACTIVE_CAPS;
|
|
@@ -5272,6 +5378,7 @@ exports.getCoinMeta = getCoinMeta;
|
|
|
5272
5378
|
exports.getDecimals = getDecimals;
|
|
5273
5379
|
exports.getDecimalsForCoinType = getDecimalsForCoinType;
|
|
5274
5380
|
exports.getJob = getJob;
|
|
5381
|
+
exports.getJobBatchOrigin = getJobBatchOrigin;
|
|
5275
5382
|
exports.getJobSpec = getJobSpec;
|
|
5276
5383
|
exports.getLimits = getLimits;
|
|
5277
5384
|
exports.getOpenJob = getOpenJob;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { EventEmitter } from 'eventemitter3';
|
|
2
2
|
import { SuiGrpcClient } from '@mysten/sui/grpc';
|
|
3
3
|
import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
|
|
4
|
-
import {
|
|
5
|
-
export { A as A2A_ESCROW_FEE_CONFIG_ID,
|
|
4
|
+
import { al as T2000Error, bO as T2000Options, as as TransactionSigner, a0 as PayOptions, bP as X402Probe, a1 as PayResult, bQ as SerializedCetusRoute, bR as SwapResult, bS as SwapQuoteResult, ad as SendResult, f as BalanceResponse, ar as TransactionRecord, o as DepositInfo, bT as PaymentRequest, aC as ZkLoginProof, bU as SuiCoreClient, X as OverlayFeeConfig, bV as SponsoredCoinMergeCache, aj as SupportedAsset, ak as SwapRouteResult, bW as SendableAsset } from './commerce-3ztE5Gg3.cjs';
|
|
5
|
+
export { A as A2A_ESCROW_FEE_CONFIG_ID, bX as A2A_ESCROW_LATEST_PACKAGE_ID, bY as A2A_ESCROW_OPENING_PACKAGE_ID, a as A2A_ESCROW_PACKAGE_ID, bZ as A2A_ESCROW_PACKAGE_V10_ID, b_ as A2A_ESCROW_PACKAGE_V11_ID, b$ as A2A_ESCROW_PACKAGE_V12_ID, c0 as A2A_ESCROW_PACKAGE_V2_ID, c1 as A2A_ESCROW_PACKAGE_V3_ID, c2 as A2A_ESCROW_PACKAGE_V6_ID, c3 as A2A_ESCROW_PACKAGE_V7_ID, c4 as A2A_ESCROW_PACKAGE_V8_ID, c5 as A2A_SCORE_BOARD_ID, b as ActivityReportConfig, c as AgentScore, c6 as ApiRouteListing, B as BATCH_ABORT_CODES, d as BATCH_OPENING_TYPE_MARKER, e as BATCH_ORIGIN_KEY_TYPE_SUFFIX, g as BatchOpening, h as BatchOpeningTerms, c7 as CETUS_USDC_SUI_POOL, C as CLOCK_ID, i as COIN_REGISTRY, j as ClassifyBalanceChange, k as ClassifyResult, l as CoinMeta, c8 as CoinPage, D as DEFAULT_ACTIVITY_REPORT_URL, m as DEFAULT_COMMERCE_API_BASE, c9 as DEFAULT_GRPC_URL, n as DEFAULT_NETWORK, E as ESCROW_ABORT_CODES, p as ETH_TYPE, q as ExtractedTransfer, ca as GASLESS_MIN_STABLE_AMOUNT, cb as GASLESS_STABLE_TYPES, G as GAS_RESERVE_MIN, I as IKA_TYPE, J as JOB_STATES, r as Job, s as JobState, t as JobTerms, u as JobVerification, K as KNOWN_TARGETS, v as KeypairSigner, L as LABEL_PATTERNS, w as LEVEL4_MAX_NO_DELIVERY, x as LEVEL4_MIN_REVIEWS, y as LOFI_TYPE, cc as MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID, cd as MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID, ce as MAINNET_A2A_ESCROW_PACKAGE_ID, cf as MAINNET_A2A_SCORE_BOARD_ID, M as MANIFEST_TYPE, z as MAX_BATCH_SLOTS_DEFAULT, F as MAX_DELIVER_HORIZON_MS, H as MAX_JOB_USDC, cg as MAX_OPEN_WINDOW_MS, N as MAX_REVIEW_WINDOW_MS, O as MIN_JOB_USDC, P as MIST_PER_SUI, Q as NAVX_TYPE, R as NO_DELIVERY_REGRESSION_FLOOR, S as OPENING_CLAIM_POLICIES, T as OPENING_CLAIM_POLICY_ANY_ACTIVE, U as OPENING_CLAIM_POLICY_PROVEN, V as OPENING_CLAIM_POLICY_PROVEN_4STAR, ch as OPERATION_ASSETS, W as OVERLAY_FEE_RATE, ci as Opening, cj as OpeningTerms, ck as Operation, Y as PREFLIGHT_MAX_AMOUNT, Z as PREFLIGHT_OK, _ as PROVEN_MIN_AVG_STARS_X10, $ as PROVEN_MIN_REVIEWS, a2 as PreflightResult, a3 as REPUTATION_ABORT_CODES, a4 as REVIEW_MAX_STARS, a5 as REVIEW_MIN_STARS, a6 as SELLER_LEVEL_ACTIVE_CAPS, cl as SENDABLE_ASSETS, a7 as STABLE_ASSETS, a8 as SUI_DECIMALS, a9 as SUI_TYPE, aa as SUPPORTED_ASSETS, cm as SelectAndSplitResult, ab as SellerLevel, ac as SendAssetClass, cn as SerializedCetusRoutePath, co as SerializedRouterDataV3, ae as ServiceListing, cp as ServicesRail, cq as ServicesRow, af as SimulationResult, ag as StableAsset, ah as SuiHolding, ai as SuiRpcTxBlock, am as T2000ErrorCode, an as T2000ErrorData, ao as T2000_OVERLAY_FEE_WALLET, ap as TOKEN_MAP, aq as TransactionLeg, at as TxDirection, au as USDC_DECIMALS, av as USDC_TYPE, aw as USDE_TYPE, ax as USDSUI_TYPE, ay as USDT_TYPE, az as WAL_TYPE, aA as WBTC_TYPE, aB as X402ActivityPayload, aD as ZkLoginSigner, aE as activeCapForLevel, cr as addSendToTx, cs as addSwapToTx, ct as assertAllowedAsset, cu as assertBuyerRequirements, aF as buildBatchClaimTx, aG as buildCancelBatchOpeningTx, cv as buildCancelOpeningTx, cw as buildClaimOpeningTx, aH as buildCreateBatchOpeningTx, cx as buildCreateEmptyScoreTx, aI as buildCreateJobTx, cy as buildCreateOpeningTx, cz as buildDeclineJobTx, aJ as buildDeliverJobTx, aK as buildRefundBatchExpiredTx, aL as buildRefundJobTx, cA as buildRefundUnclaimedTx, aM as buildRejectJobTx, aN as buildReleaseJobTx, aO as buildSendTx, cB as buildSubmitFirstReviewTx, cC as buildSubmitReviewTx, aP as buildSwapTx, aQ as checkPositiveAmount, aR as checkSuiAddress, aS as claimPolicyLabel, aT as claimPolicyRequirement, aU as classifyAction, aV as classifyLabel, aW as classifySendAsset, aX as classifyTransaction, aY as deriveAgentScoreId, cD as deserializeCetusRoute, aZ as effectiveSellerLevel, a_ as executeTx, a$ as extractAllUserLegs, b0 as extractTransferDetails, b1 as extractTxCommands, b2 as extractTxSender, b3 as fallbackLabel, cE as fetchAllCoins, b4 as fetchService, b5 as findSwapRoute, b6 as formatAssetAmount, b7 as formatSui, b8 as formatUsd, b9 as getAgentScore, ba as getBatchClaimsByAgent, bb as getBatchOpening, cF as getCoinMeta, bc as getDecimals, bd as getDecimalsForCoinType, be as getJob, bf as getJobBatchOrigin, bg as getJobSpec, cG as getOpening, cH as getSuiClient, cI as getSuiGrpcClient, bh as invalidSendAssetMessage, cJ as isAllowedAsset, cK as isCetusRouteFresh, cL as isInRegistry, bi as jobActionsFor, bj as listServices, bk as mapMoveAbortCode, bl as mapWalletError, bm as meetsClaimPolicy, bn as meetsMinSellerLevel, bo as mistToSui, cM as normalizeAsset, cN as normalizeCoinType, bp as parseSuiRpcTx, bq as payWithX402, br as preflightBatchClaim, bs as preflightClaimOpening, bt as preflightCreateBatchOpening, bu as preflightCreateJob, cO as preflightCreateOpening, bv as preflightFail, bw as preflightPay, bx as preflightSend, by as preflightSwap, cP as probeX402, bz as putJobSpec, cQ as queryHistory, cR as queryTransaction, bA as rawToStable, bB as rawToUsdc, bC as refineLendingLabel, bD as reportX402Activity, bE as resolveSymbol, bF as resolveTokenType, cS as selectAndSplitCoin, cT as selectSuiCoin, bG as sellerLevel, bH as sellerLevelLabel, cU as serializeCetusRoute, cV as simulateTransaction, bI as stableToRaw, bJ as suiToMist, cW as throwIfSimulationFailed, bK as truncateAddress, bL as usdcToRaw, bM as validateAddress, cX as verifyCetusRouteCoinMatch, bN as verifyJobForSeller } from './commerce-3ztE5Gg3.cjs';
|
|
6
6
|
import { TransactionObjectArgument, Transaction } from '@mysten/sui/transactions';
|
|
7
7
|
import { SuinsClient } from '@mysten/suins';
|
|
8
8
|
import '@mysten/sui/client';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { EventEmitter } from 'eventemitter3';
|
|
2
2
|
import { SuiGrpcClient } from '@mysten/sui/grpc';
|
|
3
3
|
import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
|
|
4
|
-
import {
|
|
5
|
-
export { A as A2A_ESCROW_FEE_CONFIG_ID,
|
|
4
|
+
import { al as T2000Error, bO as T2000Options, as as TransactionSigner, a0 as PayOptions, bP as X402Probe, a1 as PayResult, bQ as SerializedCetusRoute, bR as SwapResult, bS as SwapQuoteResult, ad as SendResult, f as BalanceResponse, ar as TransactionRecord, o as DepositInfo, bT as PaymentRequest, aC as ZkLoginProof, bU as SuiCoreClient, X as OverlayFeeConfig, bV as SponsoredCoinMergeCache, aj as SupportedAsset, ak as SwapRouteResult, bW as SendableAsset } from './commerce-3ztE5Gg3.js';
|
|
5
|
+
export { A as A2A_ESCROW_FEE_CONFIG_ID, bX as A2A_ESCROW_LATEST_PACKAGE_ID, bY as A2A_ESCROW_OPENING_PACKAGE_ID, a as A2A_ESCROW_PACKAGE_ID, bZ as A2A_ESCROW_PACKAGE_V10_ID, b_ as A2A_ESCROW_PACKAGE_V11_ID, b$ as A2A_ESCROW_PACKAGE_V12_ID, c0 as A2A_ESCROW_PACKAGE_V2_ID, c1 as A2A_ESCROW_PACKAGE_V3_ID, c2 as A2A_ESCROW_PACKAGE_V6_ID, c3 as A2A_ESCROW_PACKAGE_V7_ID, c4 as A2A_ESCROW_PACKAGE_V8_ID, c5 as A2A_SCORE_BOARD_ID, b as ActivityReportConfig, c as AgentScore, c6 as ApiRouteListing, B as BATCH_ABORT_CODES, d as BATCH_OPENING_TYPE_MARKER, e as BATCH_ORIGIN_KEY_TYPE_SUFFIX, g as BatchOpening, h as BatchOpeningTerms, c7 as CETUS_USDC_SUI_POOL, C as CLOCK_ID, i as COIN_REGISTRY, j as ClassifyBalanceChange, k as ClassifyResult, l as CoinMeta, c8 as CoinPage, D as DEFAULT_ACTIVITY_REPORT_URL, m as DEFAULT_COMMERCE_API_BASE, c9 as DEFAULT_GRPC_URL, n as DEFAULT_NETWORK, E as ESCROW_ABORT_CODES, p as ETH_TYPE, q as ExtractedTransfer, ca as GASLESS_MIN_STABLE_AMOUNT, cb as GASLESS_STABLE_TYPES, G as GAS_RESERVE_MIN, I as IKA_TYPE, J as JOB_STATES, r as Job, s as JobState, t as JobTerms, u as JobVerification, K as KNOWN_TARGETS, v as KeypairSigner, L as LABEL_PATTERNS, w as LEVEL4_MAX_NO_DELIVERY, x as LEVEL4_MIN_REVIEWS, y as LOFI_TYPE, cc as MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID, cd as MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID, ce as MAINNET_A2A_ESCROW_PACKAGE_ID, cf as MAINNET_A2A_SCORE_BOARD_ID, M as MANIFEST_TYPE, z as MAX_BATCH_SLOTS_DEFAULT, F as MAX_DELIVER_HORIZON_MS, H as MAX_JOB_USDC, cg as MAX_OPEN_WINDOW_MS, N as MAX_REVIEW_WINDOW_MS, O as MIN_JOB_USDC, P as MIST_PER_SUI, Q as NAVX_TYPE, R as NO_DELIVERY_REGRESSION_FLOOR, S as OPENING_CLAIM_POLICIES, T as OPENING_CLAIM_POLICY_ANY_ACTIVE, U as OPENING_CLAIM_POLICY_PROVEN, V as OPENING_CLAIM_POLICY_PROVEN_4STAR, ch as OPERATION_ASSETS, W as OVERLAY_FEE_RATE, ci as Opening, cj as OpeningTerms, ck as Operation, Y as PREFLIGHT_MAX_AMOUNT, Z as PREFLIGHT_OK, _ as PROVEN_MIN_AVG_STARS_X10, $ as PROVEN_MIN_REVIEWS, a2 as PreflightResult, a3 as REPUTATION_ABORT_CODES, a4 as REVIEW_MAX_STARS, a5 as REVIEW_MIN_STARS, a6 as SELLER_LEVEL_ACTIVE_CAPS, cl as SENDABLE_ASSETS, a7 as STABLE_ASSETS, a8 as SUI_DECIMALS, a9 as SUI_TYPE, aa as SUPPORTED_ASSETS, cm as SelectAndSplitResult, ab as SellerLevel, ac as SendAssetClass, cn as SerializedCetusRoutePath, co as SerializedRouterDataV3, ae as ServiceListing, cp as ServicesRail, cq as ServicesRow, af as SimulationResult, ag as StableAsset, ah as SuiHolding, ai as SuiRpcTxBlock, am as T2000ErrorCode, an as T2000ErrorData, ao as T2000_OVERLAY_FEE_WALLET, ap as TOKEN_MAP, aq as TransactionLeg, at as TxDirection, au as USDC_DECIMALS, av as USDC_TYPE, aw as USDE_TYPE, ax as USDSUI_TYPE, ay as USDT_TYPE, az as WAL_TYPE, aA as WBTC_TYPE, aB as X402ActivityPayload, aD as ZkLoginSigner, aE as activeCapForLevel, cr as addSendToTx, cs as addSwapToTx, ct as assertAllowedAsset, cu as assertBuyerRequirements, aF as buildBatchClaimTx, aG as buildCancelBatchOpeningTx, cv as buildCancelOpeningTx, cw as buildClaimOpeningTx, aH as buildCreateBatchOpeningTx, cx as buildCreateEmptyScoreTx, aI as buildCreateJobTx, cy as buildCreateOpeningTx, cz as buildDeclineJobTx, aJ as buildDeliverJobTx, aK as buildRefundBatchExpiredTx, aL as buildRefundJobTx, cA as buildRefundUnclaimedTx, aM as buildRejectJobTx, aN as buildReleaseJobTx, aO as buildSendTx, cB as buildSubmitFirstReviewTx, cC as buildSubmitReviewTx, aP as buildSwapTx, aQ as checkPositiveAmount, aR as checkSuiAddress, aS as claimPolicyLabel, aT as claimPolicyRequirement, aU as classifyAction, aV as classifyLabel, aW as classifySendAsset, aX as classifyTransaction, aY as deriveAgentScoreId, cD as deserializeCetusRoute, aZ as effectiveSellerLevel, a_ as executeTx, a$ as extractAllUserLegs, b0 as extractTransferDetails, b1 as extractTxCommands, b2 as extractTxSender, b3 as fallbackLabel, cE as fetchAllCoins, b4 as fetchService, b5 as findSwapRoute, b6 as formatAssetAmount, b7 as formatSui, b8 as formatUsd, b9 as getAgentScore, ba as getBatchClaimsByAgent, bb as getBatchOpening, cF as getCoinMeta, bc as getDecimals, bd as getDecimalsForCoinType, be as getJob, bf as getJobBatchOrigin, bg as getJobSpec, cG as getOpening, cH as getSuiClient, cI as getSuiGrpcClient, bh as invalidSendAssetMessage, cJ as isAllowedAsset, cK as isCetusRouteFresh, cL as isInRegistry, bi as jobActionsFor, bj as listServices, bk as mapMoveAbortCode, bl as mapWalletError, bm as meetsClaimPolicy, bn as meetsMinSellerLevel, bo as mistToSui, cM as normalizeAsset, cN as normalizeCoinType, bp as parseSuiRpcTx, bq as payWithX402, br as preflightBatchClaim, bs as preflightClaimOpening, bt as preflightCreateBatchOpening, bu as preflightCreateJob, cO as preflightCreateOpening, bv as preflightFail, bw as preflightPay, bx as preflightSend, by as preflightSwap, cP as probeX402, bz as putJobSpec, cQ as queryHistory, cR as queryTransaction, bA as rawToStable, bB as rawToUsdc, bC as refineLendingLabel, bD as reportX402Activity, bE as resolveSymbol, bF as resolveTokenType, cS as selectAndSplitCoin, cT as selectSuiCoin, bG as sellerLevel, bH as sellerLevelLabel, cU as serializeCetusRoute, cV as simulateTransaction, bI as stableToRaw, bJ as suiToMist, cW as throwIfSimulationFailed, bK as truncateAddress, bL as usdcToRaw, bM as validateAddress, cX as verifyCetusRouteCoinMatch, bN as verifyJobForSeller } from './commerce-3ztE5Gg3.js';
|
|
6
6
|
import { TransactionObjectArgument, Transaction } from '@mysten/sui/transactions';
|
|
7
7
|
import { SuinsClient } from '@mysten/suins';
|
|
8
8
|
import '@mysten/sui/client';
|
package/dist/index.js
CHANGED
|
@@ -2999,7 +2999,7 @@ init_coinSelection();
|
|
|
2999
2999
|
init_errors();
|
|
3000
3000
|
init_token_registry();
|
|
3001
3001
|
init_coinSelection();
|
|
3002
|
-
var MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID = "
|
|
3002
|
+
var MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID = "0x1f88ca77b1980e3d0750e83d1363c6025cd677c2f420cae51a86d4a0bddf93c5";
|
|
3003
3003
|
var MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID = MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID;
|
|
3004
3004
|
var A2A_ESCROW_LATEST_PACKAGE_ID = process.env.A2A_ESCROW_OPENING_PACKAGE_ID ?? process.env.A2A_ESCROW_PACKAGE_ID ?? MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID;
|
|
3005
3005
|
var A2A_ESCROW_OPENING_PACKAGE_ID = A2A_ESCROW_LATEST_PACKAGE_ID;
|
|
@@ -3010,6 +3010,7 @@ var A2A_ESCROW_PACKAGE_V7_ID = "0x4249f0b242c47c7baf0c37304365bc4bbe769bcedf11f3
|
|
|
3010
3010
|
var A2A_ESCROW_PACKAGE_V8_ID = "0x1595b80bc05a03607f3908702c866ca63cf961025b4263b5ecbe419e07f8ff31";
|
|
3011
3011
|
var A2A_ESCROW_PACKAGE_V10_ID = process.env.A2A_ESCROW_PACKAGE_V10_ID ?? "0x5c90ec07da01bf885a4e65247ce98b75ab8a042cd965d30d7213856d579c4afa";
|
|
3012
3012
|
var A2A_ESCROW_PACKAGE_V11_ID = process.env.A2A_ESCROW_PACKAGE_V11_ID ?? "0x2a928916c859a159e6d6f4841073a31397d01336c1ea689ce74344e456463c8d";
|
|
3013
|
+
var A2A_ESCROW_PACKAGE_V12_ID = process.env.A2A_ESCROW_PACKAGE_V12_ID ?? "0x1f88ca77b1980e3d0750e83d1363c6025cd677c2f420cae51a86d4a0bddf93c5";
|
|
3013
3014
|
var CLOCK_ID2 = "0x6";
|
|
3014
3015
|
var MODULE = "opening";
|
|
3015
3016
|
var SHA256_HEX_RE = /^(0x)?[0-9a-fA-F]{64}$/;
|
|
@@ -3340,6 +3341,29 @@ function buildDeclineJobTx(jobId) {
|
|
|
3340
3341
|
}
|
|
3341
3342
|
function buildRejectJobTx(jobId, v2) {
|
|
3342
3343
|
const tx = new Transaction();
|
|
3344
|
+
if (v2.batchId) {
|
|
3345
|
+
tx.moveCall({
|
|
3346
|
+
target: `${A2A_ESCROW_LATEST_PACKAGE_ID}::batch::${v2.buyerScoreId ? "batch_reject_agent_buyer" : "batch_reject"}`,
|
|
3347
|
+
typeArguments: [USDC_TYPE],
|
|
3348
|
+
arguments: v2.buyerScoreId ? [
|
|
3349
|
+
tx.object(v2.batchId),
|
|
3350
|
+
tx.object(jobId),
|
|
3351
|
+
tx.object(v2.sellerScoreId),
|
|
3352
|
+
tx.object(v2.buyerScoreId),
|
|
3353
|
+
tx.object(v2.registryId),
|
|
3354
|
+
feeConfigArg2(tx),
|
|
3355
|
+
tx.object(CLOCK_ID3)
|
|
3356
|
+
] : [
|
|
3357
|
+
tx.object(v2.batchId),
|
|
3358
|
+
tx.object(jobId),
|
|
3359
|
+
tx.object(v2.sellerScoreId),
|
|
3360
|
+
tx.object(v2.registryId),
|
|
3361
|
+
feeConfigArg2(tx),
|
|
3362
|
+
tx.object(CLOCK_ID3)
|
|
3363
|
+
]
|
|
3364
|
+
});
|
|
3365
|
+
return tx;
|
|
3366
|
+
}
|
|
3343
3367
|
tx.moveCall({
|
|
3344
3368
|
target: `${A2A_ESCROW_LATEST_PACKAGE_ID}::reputation::${v2.buyerScoreId ? "reject_v2_agent_buyer" : "reject_v2"}`,
|
|
3345
3369
|
typeArguments: [USDC_TYPE],
|
|
@@ -3362,6 +3386,20 @@ function buildRejectJobTx(jobId, v2) {
|
|
|
3362
3386
|
}
|
|
3363
3387
|
function buildRefundJobTx(jobId, v2) {
|
|
3364
3388
|
const tx = new Transaction();
|
|
3389
|
+
if (v2.batchId) {
|
|
3390
|
+
tx.moveCall({
|
|
3391
|
+
target: `${A2A_ESCROW_LATEST_PACKAGE_ID}::batch::batch_refund`,
|
|
3392
|
+
typeArguments: [USDC_TYPE],
|
|
3393
|
+
arguments: [
|
|
3394
|
+
tx.object(v2.batchId),
|
|
3395
|
+
tx.object(jobId),
|
|
3396
|
+
tx.object(v2.sellerScoreId),
|
|
3397
|
+
feeConfigArg2(tx),
|
|
3398
|
+
tx.object(CLOCK_ID3)
|
|
3399
|
+
]
|
|
3400
|
+
});
|
|
3401
|
+
return tx;
|
|
3402
|
+
}
|
|
3365
3403
|
tx.moveCall({
|
|
3366
3404
|
target: `${A2A_ESCROW_LATEST_PACKAGE_ID}::reputation::refund_v2`,
|
|
3367
3405
|
typeArguments: [USDC_TYPE],
|
|
@@ -3390,6 +3428,20 @@ function buildDeliverJobTx(jobId, deliveryHash) {
|
|
|
3390
3428
|
}
|
|
3391
3429
|
function buildReleaseJobTx(jobId, v2) {
|
|
3392
3430
|
const tx = new Transaction();
|
|
3431
|
+
if (v2.batchId) {
|
|
3432
|
+
tx.moveCall({
|
|
3433
|
+
target: `${A2A_ESCROW_LATEST_PACKAGE_ID}::batch::batch_release`,
|
|
3434
|
+
typeArguments: [USDC_TYPE],
|
|
3435
|
+
arguments: [
|
|
3436
|
+
tx.object(v2.batchId),
|
|
3437
|
+
tx.object(jobId),
|
|
3438
|
+
tx.object(v2.sellerScoreId),
|
|
3439
|
+
feeConfigArg2(tx),
|
|
3440
|
+
tx.object(CLOCK_ID3)
|
|
3441
|
+
]
|
|
3442
|
+
});
|
|
3443
|
+
return tx;
|
|
3444
|
+
}
|
|
3393
3445
|
tx.moveCall({
|
|
3394
3446
|
target: `${A2A_ESCROW_LATEST_PACKAGE_ID}::reputation::release_v2`,
|
|
3395
3447
|
typeArguments: [USDC_TYPE],
|
|
@@ -3439,6 +3491,26 @@ async function getJob(client, jobId) {
|
|
|
3439
3491
|
createdAtMs: Number(json.created_at_ms)
|
|
3440
3492
|
};
|
|
3441
3493
|
}
|
|
3494
|
+
var BATCH_ORIGIN_KEY_TYPE_SUFFIX = "::escrow::BatchOriginKey";
|
|
3495
|
+
async function getJobBatchOrigin(client, jobId) {
|
|
3496
|
+
let cursor = null;
|
|
3497
|
+
do {
|
|
3498
|
+
const page = await client.core.listDynamicFields({
|
|
3499
|
+
parentId: jobId,
|
|
3500
|
+
cursor: cursor ?? void 0
|
|
3501
|
+
});
|
|
3502
|
+
for (const field of page.dynamicFields) {
|
|
3503
|
+
if (!field.name.type.endsWith(BATCH_ORIGIN_KEY_TYPE_SUFFIX)) continue;
|
|
3504
|
+
const resp = await client.core.getDynamicField({
|
|
3505
|
+
parentId: jobId,
|
|
3506
|
+
name: field.name
|
|
3507
|
+
});
|
|
3508
|
+
return bcs.Address.parse(resp.dynamicField.value.bcs);
|
|
3509
|
+
}
|
|
3510
|
+
cursor = page.hasNextPage ? page.cursor : null;
|
|
3511
|
+
} while (cursor);
|
|
3512
|
+
return null;
|
|
3513
|
+
}
|
|
3442
3514
|
function jobActionsFor(job, caller, nowMs = Date.now()) {
|
|
3443
3515
|
const me = validateAddress(caller);
|
|
3444
3516
|
const isBuyer = me === job.buyer;
|
|
@@ -3701,6 +3773,35 @@ var MODULE4 = "batch";
|
|
|
3701
3773
|
var CLOCK_ID5 = "0x6";
|
|
3702
3774
|
var MAX_BATCH_SLOTS_DEFAULT = 250;
|
|
3703
3775
|
var BATCH_OPENING_TYPE_MARKER = "::batch::BatchOpening<";
|
|
3776
|
+
var BATCH_ABORT_CODES = {
|
|
3777
|
+
/** At your wave cap RIGHT NOW — min(buyer ceiling, level cap) active
|
|
3778
|
+
* holds. Settle one to reclaim; never "lifetime". */
|
|
3779
|
+
EMaxClaimsReached: 12,
|
|
3780
|
+
/** Pre-S.1202 wave — lifetime rows never free, so new claims refuse.
|
|
3781
|
+
* The wave's cancel / expired-refund still work. */
|
|
3782
|
+
ELegacyBatch: 22,
|
|
3783
|
+
/** The Job passed to a batch settle door has no BatchOriginKey. */
|
|
3784
|
+
ENotBatchJob: 23,
|
|
3785
|
+
/** The attached wave is not this Job's origin batch. */
|
|
3786
|
+
EWrongBatch: 24,
|
|
3787
|
+
EWrongSellerScore: 25,
|
|
3788
|
+
EWrongBuyerScore: 26,
|
|
3789
|
+
/** Registered Agent-ID buyer must reject via the agent-buyer variant. */
|
|
3790
|
+
EBuyerIsAgent: 27,
|
|
3791
|
+
EBuyerNotAgent: 28
|
|
3792
|
+
};
|
|
3793
|
+
var REPUTATION_ABORT_CODES = {
|
|
3794
|
+
/** A bare v2 door (release_v2 / reject_v2 variants / refund_v2) on a
|
|
3795
|
+
* batch-origin Job — the client must attach the batch and settle via
|
|
3796
|
+
* the batch doors. */
|
|
3797
|
+
EUseBatchSettle: 9
|
|
3798
|
+
};
|
|
3799
|
+
var ESCROW_ABORT_CODES = {
|
|
3800
|
+
/** Stale package flow (FeeConfig VERSION moved) — update @t2000/*. */
|
|
3801
|
+
EWrongVersion: 13,
|
|
3802
|
+
/** Second wave-hold free on one Job (unreachable via the doors). */
|
|
3803
|
+
EBatchHoldReleased: 23
|
|
3804
|
+
};
|
|
3704
3805
|
function preflightCreateBatchOpening(terms) {
|
|
3705
3806
|
const single = preflightCreateOpening(terms);
|
|
3706
3807
|
if (!single.valid) return single;
|
|
@@ -5105,4 +5206,4 @@ function displayHandle(label, parentName = AUDRIC_PARENT_NAME) {
|
|
|
5105
5206
|
// src/index.ts
|
|
5106
5207
|
init_preflight();
|
|
5107
5208
|
|
|
5108
|
-
export { A2A_ESCROW_FEE_CONFIG_ID, A2A_ESCROW_LATEST_PACKAGE_ID, A2A_ESCROW_OPENING_PACKAGE_ID, A2A_ESCROW_PACKAGE_ID, A2A_ESCROW_PACKAGE_V10_ID, A2A_ESCROW_PACKAGE_V11_ID, A2A_ESCROW_PACKAGE_V2_ID, A2A_ESCROW_PACKAGE_V3_ID, A2A_ESCROW_PACKAGE_V6_ID, A2A_ESCROW_PACKAGE_V7_ID, A2A_ESCROW_PACKAGE_V8_ID, A2A_SCORE_BOARD_ID, AGENT_CATEGORIES, AUDRIC_PARENT, AUDRIC_PARENT_NAME, AUDRIC_PARENT_NFT_ID, BATCH_OPENING_TYPE_MARKER, CETUS_USDC_SUI_POOL, CLOCK_ID, COIN_REGISTRY, CommerceClient, DEFAULT_ACTIVITY_REPORT_URL, DEFAULT_API_BASE, DEFAULT_COMMERCE_API_BASE, DEFAULT_GRPC_URL, DEFAULT_NETWORK, ESCROW_JOB_TYPE_MARKER, ETH_TYPE, GASLESS_MIN_STABLE_AMOUNT, GASLESS_STABLE_TYPES, GAS_RESERVE_MIN, IKA_TYPE, InvalidAddressError, JOB_STATES, KNOWN_TARGETS, KeypairSigner, LABEL_PATTERNS, LEVEL4_MAX_NO_DELIVERY, LEVEL4_MIN_REVIEWS, LOFI_TYPE, LimitEnforcer, LimitExceededError, MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID, MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID, MAINNET_A2A_ESCROW_PACKAGE_ID, MAINNET_A2A_SCORE_BOARD_ID, MANIFEST_TYPE, MAX_BATCH_SLOTS_DEFAULT, MAX_DELIVER_HORIZON_MS, MAX_JOB_USDC, MAX_OPEN_WINDOW_MS, MAX_REVIEW_WINDOW_MS, MAX_SLUG_LENGTH, MAX_TIER_BASE_LENGTH, MIN_JOB_USDC, MIST_PER_SUI, NAVX_TYPE, NO_DELIVERY_REGRESSION_FLOOR, OPENING_CLAIM_POLICIES, OPENING_CLAIM_POLICY_ANY_ACTIVE, OPENING_CLAIM_POLICY_PROVEN, OPENING_CLAIM_POLICY_PROVEN_4STAR, OPENING_TYPE_MARKER, OPERATION_ASSETS, OVERLAY_FEE_RATE, PREFLIGHT_MAX_AMOUNT, PREFLIGHT_OK, PROVEN_MIN_AVG_STARS_X10, PROVEN_MIN_REVIEWS, REVIEW_MAX_STARS, REVIEW_MIN_STARS, SELLER_LEVEL_ACTIVE_CAPS, SENDABLE_ASSETS, SERVICE_SLUG_RE, SERVICE_TIERS, SPONSORED_PYTH_DEPENDENT_PROVIDERS, STABLE_ASSETS, SUINS_NAME_REGEX, SUI_ADDRESS_REGEX, SUI_ADDRESS_STRICT_REGEX, SUI_DECIMALS, SUI_TYPE, SUPPORTED_ASSETS, SuinsNotRegisteredError, SuinsRpcError, T2000, T2000Error, T2000_OVERLAY_FEE_WALLET, TOKEN_MAP, USDC_DECIMALS, USDC_TYPE, USDE_TYPE, USDSUI_TYPE, USDT_TYPE, WAL_TYPE, WBTC_TYPE, WRITE_APPENDER_REGISTRY, ZkLoginSigner, activeCapForLevel, addSendToTx, addSwapToTx, agentResolveUrl, approxUsdValue, assertAllowedAsset, assertBuyerRequirements, assertLimitConfig, buildAddLeafTx, buildBatchClaimTx, buildCancelBatchOpeningTx, buildCancelOpeningTx, buildClaimOpeningTx, buildCreateBatchOpeningTx, buildCreateEmptyScoreTx, buildCreateJobTx, buildCreateOpeningTx, buildDeclineJobTx, buildDeliverJobTx, buildRefundBatchExpiredTx, buildRefundJobTx, buildRefundUnclaimedTx, buildRejectJobTx, buildReleaseJobTx, buildRevokeLeafTx, buildSendTx, buildSubmitFirstReviewTx, buildSubmitReviewTx, buildSwapTx, cancelBatchOpenJob, cancelOpenJob, canonicalizeRecipientInput, chatCompletion, chatCompletionStream, checkPositiveAmount, checkSuiAddress, claimBatchOpenJob, claimOpenJob, claimPolicyLabel, claimPolicyRequirement, classifyAction, classifyLabel, classifySendAsset, classifyTransaction, clearLimits, composeTx, createPackage, customHireEnvelope, dailySpentToday, deriveAgentScoreId, deriveAllowedAddressesFromPtb, deserializeCetusRoute, displayHandle, effectiveSellerLevel, endpointIssueLines, ensureCategory, executeTx, exportPrivateKey, extractAllUserLegs, extractTransferDetails, extractTxCommands, extractTxSender, fallbackLabel, fetchAllCoins, fetchChallengeNonce, fetchService, findSwapRoute, formatAssetAmount, formatSui, formatUsd, fullHandle, generateKeypair, getAddress, getAgentProfile, getAgentScore, getBatchClaimsByAgent, getBatchOpening, getCoinMeta, getDecimals, getDecimalsForCoinType, getJob, getJobSpec, getLimits, getOpenJob, getOpening, getSponsoredSwapProviders, getSuiClient, getSuiGrpcClient, getSwapQuote, hasLimits, invalidSendAssetMessage, isAllowedAsset, isCetusRouteFresh, isCustomHireEnvelope, isInRegistry, jobActionsFor, keypairFromPrivateKey, listEndpoint, listModels, listOpenJobs, listServices, loadKey, looksLikeSuiNs, mapMoveAbortCode, mapWalletError, meetsClaimPolicy, meetsMinSellerLevel, mistToSui, normalizeAddressInput, normalizeAsset, normalizeCoinType, packageBaseFromName, packageBaseSlug, packageTierSlugs, parseAgentCategory, parseServiceTierSlug, parseSuiRpcTx, payWithX402, planPackage, postBatchOpenJob, postOpenJob, preflightBatchClaim, preflightClaimOpening, preflightCreateBatchOpening, preflightCreateJob, preflightCreateOpening, preflightFail, preflightPay, preflightSend, preflightSwap, probeX402, profileChallengeMessage, putJobSpec, queryBalance, queryHistory, queryTransaction, rawToStable, rawToUsdc, readLimitsFile, recordDailySpend, refineLendingLabel, refundBatchOpenJob, refundOpenJob, registerAgent, removeEndpoint, reportX402Activity, resolveAddressToSuinsViaRpc, resolveAgentRef, resolveCreatedObjectId, resolveSuinsViaRpc, resolveSymbol, resolveTokenType, retireService, saveBech32, saveKey, selectAndSplitCoin, selectSuiCoin, sellerLevel, sellerLevelLabel, serializeCetusRoute, serviceChallengeMessage, servicePayloadSha256, serviceUpsertPayload, setLimits, setSponsoredTxGuard, signChallenge, simulateTransaction, slugify, slugifyLoner, slugifyUnbounded, stableToRaw, submitJobReview, suiToMist, throwIfSimulationFailed, trimDashes, truncateAddress, updateProfile, upsertService, usdcToRaw, validateAddress, validateLabel, verifyCetusRouteCoinMatch, verifyJobForSeller, walletExists, writeLimitsFile };
|
|
5209
|
+
export { A2A_ESCROW_FEE_CONFIG_ID, A2A_ESCROW_LATEST_PACKAGE_ID, A2A_ESCROW_OPENING_PACKAGE_ID, A2A_ESCROW_PACKAGE_ID, A2A_ESCROW_PACKAGE_V10_ID, A2A_ESCROW_PACKAGE_V11_ID, A2A_ESCROW_PACKAGE_V12_ID, A2A_ESCROW_PACKAGE_V2_ID, A2A_ESCROW_PACKAGE_V3_ID, A2A_ESCROW_PACKAGE_V6_ID, A2A_ESCROW_PACKAGE_V7_ID, A2A_ESCROW_PACKAGE_V8_ID, A2A_SCORE_BOARD_ID, AGENT_CATEGORIES, AUDRIC_PARENT, AUDRIC_PARENT_NAME, AUDRIC_PARENT_NFT_ID, BATCH_ABORT_CODES, BATCH_OPENING_TYPE_MARKER, BATCH_ORIGIN_KEY_TYPE_SUFFIX, CETUS_USDC_SUI_POOL, CLOCK_ID, COIN_REGISTRY, CommerceClient, DEFAULT_ACTIVITY_REPORT_URL, DEFAULT_API_BASE, DEFAULT_COMMERCE_API_BASE, DEFAULT_GRPC_URL, DEFAULT_NETWORK, ESCROW_ABORT_CODES, ESCROW_JOB_TYPE_MARKER, ETH_TYPE, GASLESS_MIN_STABLE_AMOUNT, GASLESS_STABLE_TYPES, GAS_RESERVE_MIN, IKA_TYPE, InvalidAddressError, JOB_STATES, KNOWN_TARGETS, KeypairSigner, LABEL_PATTERNS, LEVEL4_MAX_NO_DELIVERY, LEVEL4_MIN_REVIEWS, LOFI_TYPE, LimitEnforcer, LimitExceededError, MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID, MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID, MAINNET_A2A_ESCROW_PACKAGE_ID, MAINNET_A2A_SCORE_BOARD_ID, MANIFEST_TYPE, MAX_BATCH_SLOTS_DEFAULT, MAX_DELIVER_HORIZON_MS, MAX_JOB_USDC, MAX_OPEN_WINDOW_MS, MAX_REVIEW_WINDOW_MS, MAX_SLUG_LENGTH, MAX_TIER_BASE_LENGTH, MIN_JOB_USDC, MIST_PER_SUI, NAVX_TYPE, NO_DELIVERY_REGRESSION_FLOOR, OPENING_CLAIM_POLICIES, OPENING_CLAIM_POLICY_ANY_ACTIVE, OPENING_CLAIM_POLICY_PROVEN, OPENING_CLAIM_POLICY_PROVEN_4STAR, OPENING_TYPE_MARKER, OPERATION_ASSETS, OVERLAY_FEE_RATE, PREFLIGHT_MAX_AMOUNT, PREFLIGHT_OK, PROVEN_MIN_AVG_STARS_X10, PROVEN_MIN_REVIEWS, REPUTATION_ABORT_CODES, REVIEW_MAX_STARS, REVIEW_MIN_STARS, SELLER_LEVEL_ACTIVE_CAPS, SENDABLE_ASSETS, SERVICE_SLUG_RE, SERVICE_TIERS, SPONSORED_PYTH_DEPENDENT_PROVIDERS, STABLE_ASSETS, SUINS_NAME_REGEX, SUI_ADDRESS_REGEX, SUI_ADDRESS_STRICT_REGEX, SUI_DECIMALS, SUI_TYPE, SUPPORTED_ASSETS, SuinsNotRegisteredError, SuinsRpcError, T2000, T2000Error, T2000_OVERLAY_FEE_WALLET, TOKEN_MAP, USDC_DECIMALS, USDC_TYPE, USDE_TYPE, USDSUI_TYPE, USDT_TYPE, WAL_TYPE, WBTC_TYPE, WRITE_APPENDER_REGISTRY, ZkLoginSigner, activeCapForLevel, addSendToTx, addSwapToTx, agentResolveUrl, approxUsdValue, assertAllowedAsset, assertBuyerRequirements, assertLimitConfig, buildAddLeafTx, buildBatchClaimTx, buildCancelBatchOpeningTx, buildCancelOpeningTx, buildClaimOpeningTx, buildCreateBatchOpeningTx, buildCreateEmptyScoreTx, buildCreateJobTx, buildCreateOpeningTx, buildDeclineJobTx, buildDeliverJobTx, buildRefundBatchExpiredTx, buildRefundJobTx, buildRefundUnclaimedTx, buildRejectJobTx, buildReleaseJobTx, buildRevokeLeafTx, buildSendTx, buildSubmitFirstReviewTx, buildSubmitReviewTx, buildSwapTx, cancelBatchOpenJob, cancelOpenJob, canonicalizeRecipientInput, chatCompletion, chatCompletionStream, checkPositiveAmount, checkSuiAddress, claimBatchOpenJob, claimOpenJob, claimPolicyLabel, claimPolicyRequirement, classifyAction, classifyLabel, classifySendAsset, classifyTransaction, clearLimits, composeTx, createPackage, customHireEnvelope, dailySpentToday, deriveAgentScoreId, deriveAllowedAddressesFromPtb, deserializeCetusRoute, displayHandle, effectiveSellerLevel, endpointIssueLines, ensureCategory, executeTx, exportPrivateKey, extractAllUserLegs, extractTransferDetails, extractTxCommands, extractTxSender, fallbackLabel, fetchAllCoins, fetchChallengeNonce, fetchService, findSwapRoute, formatAssetAmount, formatSui, formatUsd, fullHandle, generateKeypair, getAddress, getAgentProfile, getAgentScore, getBatchClaimsByAgent, getBatchOpening, getCoinMeta, getDecimals, getDecimalsForCoinType, getJob, getJobBatchOrigin, getJobSpec, getLimits, getOpenJob, getOpening, getSponsoredSwapProviders, getSuiClient, getSuiGrpcClient, getSwapQuote, hasLimits, invalidSendAssetMessage, isAllowedAsset, isCetusRouteFresh, isCustomHireEnvelope, isInRegistry, jobActionsFor, keypairFromPrivateKey, listEndpoint, listModels, listOpenJobs, listServices, loadKey, looksLikeSuiNs, mapMoveAbortCode, mapWalletError, meetsClaimPolicy, meetsMinSellerLevel, mistToSui, normalizeAddressInput, normalizeAsset, normalizeCoinType, packageBaseFromName, packageBaseSlug, packageTierSlugs, parseAgentCategory, parseServiceTierSlug, parseSuiRpcTx, payWithX402, planPackage, postBatchOpenJob, postOpenJob, preflightBatchClaim, preflightClaimOpening, preflightCreateBatchOpening, preflightCreateJob, preflightCreateOpening, preflightFail, preflightPay, preflightSend, preflightSwap, probeX402, profileChallengeMessage, putJobSpec, queryBalance, queryHistory, queryTransaction, rawToStable, rawToUsdc, readLimitsFile, recordDailySpend, refineLendingLabel, refundBatchOpenJob, refundOpenJob, registerAgent, removeEndpoint, reportX402Activity, resolveAddressToSuinsViaRpc, resolveAgentRef, resolveCreatedObjectId, resolveSuinsViaRpc, resolveSymbol, resolveTokenType, retireService, saveBech32, saveKey, selectAndSplitCoin, selectSuiCoin, sellerLevel, sellerLevelLabel, serializeCetusRoute, serviceChallengeMessage, servicePayloadSha256, serviceUpsertPayload, setLimits, setSponsoredTxGuard, signChallenge, simulateTransaction, slugify, slugifyLoner, slugifyUnbounded, stableToRaw, submitJobReview, suiToMist, throwIfSimulationFailed, trimDashes, truncateAddress, updateProfile, upsertService, usdcToRaw, validateAddress, validateLabel, verifyCetusRouteCoinMatch, verifyJobForSeller, walletExists, writeLimitsFile };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@t2000/sdk",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.40.1",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=20"
|
|
6
6
|
},
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"@phala/dcap-qvl": "^0.5.2",
|
|
57
57
|
"bn.js": "^5.2.1",
|
|
58
58
|
"eventemitter3": "^5",
|
|
59
|
-
"@t2000/sui-x402": "10.
|
|
59
|
+
"@t2000/sui-x402": "10.40.1"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@types/bn.js": "^5.1.5",
|