@t2000/sdk 10.33.1 → 10.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.cjs +24 -5
- package/dist/browser.d.cts +1 -1
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +25 -6
- package/dist/{commerce-CptpOlnv.d.cts → commerce-CMK0liSg.d.cts} +19 -6
- package/dist/{commerce-CptpOlnv.d.ts → commerce-CMK0liSg.d.ts} +19 -6
- package/dist/index.cjs +25 -5
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +26 -7
- package/package.json +2 -2
package/dist/browser.cjs
CHANGED
|
@@ -1332,8 +1332,9 @@ init_coinSelection();
|
|
|
1332
1332
|
init_errors();
|
|
1333
1333
|
init_token_registry();
|
|
1334
1334
|
init_coinSelection();
|
|
1335
|
-
var MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID = "
|
|
1335
|
+
var MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID = "0x4249f0b242c47c7baf0c37304365bc4bbe769bcedf11f3525e84682d59a3b23e";
|
|
1336
1336
|
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;
|
|
1337
|
+
var A2A_ESCROW_PACKAGE_V7_ID = "0x4249f0b242c47c7baf0c37304365bc4bbe769bcedf11f3525e84682d59a3b23e";
|
|
1337
1338
|
var OPENING_CLAIM_POLICY_ANY_ACTIVE = 0;
|
|
1338
1339
|
var OPENING_CLAIM_POLICY_PROVEN = 1;
|
|
1339
1340
|
var OPENING_CLAIM_POLICY_PROVEN_4STAR = 2;
|
|
@@ -1594,6 +1595,23 @@ function deriveAgentScoreId(agent, boardId) {
|
|
|
1594
1595
|
bcs.bcs.Address.serialize(validateAddress(agent)).toBytes()
|
|
1595
1596
|
);
|
|
1596
1597
|
}
|
|
1598
|
+
async function getDistinctBuyers(client, scoreId) {
|
|
1599
|
+
try {
|
|
1600
|
+
const fieldId = utils.deriveDynamicFieldID(
|
|
1601
|
+
scoreId,
|
|
1602
|
+
`${A2A_ESCROW_PACKAGE_V7_ID}::${MODULE2}::DistinctCountKey`,
|
|
1603
|
+
new Uint8Array([0])
|
|
1604
|
+
);
|
|
1605
|
+
const resp = await client.core.getObject({
|
|
1606
|
+
objectId: fieldId,
|
|
1607
|
+
include: { json: true }
|
|
1608
|
+
});
|
|
1609
|
+
const json = resp?.object?.json;
|
|
1610
|
+
return Number(json?.value ?? 0);
|
|
1611
|
+
} catch {
|
|
1612
|
+
return 0;
|
|
1613
|
+
}
|
|
1614
|
+
}
|
|
1597
1615
|
async function getAgentScore(client, agent, boardId) {
|
|
1598
1616
|
const scoreId = deriveAgentScoreId(agent, boardId);
|
|
1599
1617
|
const resp = await client.core.getObject({ objectId: scoreId, include: { json: true } }).catch(() => null);
|
|
@@ -1609,13 +1627,14 @@ async function getAgentScore(client, agent, boardId) {
|
|
|
1609
1627
|
agent: String(json.agent),
|
|
1610
1628
|
reviewCount,
|
|
1611
1629
|
starsSum,
|
|
1612
|
-
averageStars: reviewCount > 0 ? Math.round(starsSum / reviewCount * 100) / 100 : 0
|
|
1630
|
+
averageStars: reviewCount > 0 ? Math.round(starsSum / reviewCount * 100) / 100 : 0,
|
|
1631
|
+
distinctBuyers: await getDistinctBuyers(client, scoreId)
|
|
1613
1632
|
};
|
|
1614
1633
|
}
|
|
1615
1634
|
function meetsClaimPolicy(score, claimPolicy) {
|
|
1616
1635
|
if (claimPolicy === 0) return true;
|
|
1617
1636
|
if (!score) return false;
|
|
1618
|
-
const proven = score.
|
|
1637
|
+
const proven = score.distinctBuyers >= PROVEN_MIN_REVIEWS;
|
|
1619
1638
|
if (claimPolicy === 1) return proven;
|
|
1620
1639
|
if (claimPolicy === 2) {
|
|
1621
1640
|
return proven && score.starsSum * 10 >= score.reviewCount * PROVEN_MIN_AVG_STARS_X10;
|
|
@@ -1630,10 +1649,10 @@ function claimPolicyLabel(claimPolicy) {
|
|
|
1630
1649
|
}
|
|
1631
1650
|
function claimPolicyRequirement(claimPolicy) {
|
|
1632
1651
|
if (claimPolicy === 1) {
|
|
1633
|
-
return `Claiming needs at least ${PROVEN_MIN_REVIEWS}
|
|
1652
|
+
return `Claiming needs at least ${PROVEN_MIN_REVIEWS} reviews from distinct buyers.`;
|
|
1634
1653
|
}
|
|
1635
1654
|
if (claimPolicy === 2) {
|
|
1636
|
-
return `Claiming needs at least ${PROVEN_MIN_REVIEWS}
|
|
1655
|
+
return `Claiming needs at least ${PROVEN_MIN_REVIEWS} reviews from distinct buyers and a 4.0\u2605 average.`;
|
|
1637
1656
|
}
|
|
1638
1657
|
return "Anyone can claim (active Agent ID required).";
|
|
1639
1658
|
}
|
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 BalanceResponse, C as CLOCK_ID, d as COIN_REGISTRY, e as ClassifyBalanceChange, f as ClassifyResult, g as CoinMeta, D as DEFAULT_ACTIVITY_REPORT_URL, h as DEFAULT_COMMERCE_API_BASE, i as DEFAULT_NETWORK, j as DepositInfo, E as ETH_TYPE, k as ExtractedTransfer, G as GAS_RESERVE_MIN, I as IKA_TYPE, J as JOB_STATES, l as Job, m as JobState, n as JobTerms, o as JobVerification, K as KNOWN_TARGETS, p as KeypairSigner, L as LABEL_PATTERNS, q as LOFI_TYPE, M as MANIFEST_TYPE, r as MAX_DELIVER_HORIZON_MS, s as MAX_JOB_USDC, t as MAX_REVIEW_WINDOW_MS, u as MIN_JOB_USDC, v as MIST_PER_SUI, N as NAVX_TYPE, O as OPENING_CLAIM_POLICIES, w as OPENING_CLAIM_POLICY_ANY_ACTIVE, x as OPENING_CLAIM_POLICY_PROVEN, y as OPENING_CLAIM_POLICY_PROVEN_4STAR, z as OVERLAY_FEE_RATE, F as OverlayFeeConfig, P as PREFLIGHT_MAX_AMOUNT, H as PREFLIGHT_OK, Q as PROVEN_MIN_AVG_STARS_X10, R as PROVEN_MIN_REVIEWS, S as PayOptions, T as PayResult, U as PreflightResult, V as REVIEW_MAX_STARS, W as REVIEW_MIN_STARS, X as STABLE_ASSETS, Y as SUI_DECIMALS, Z as SUI_TYPE, _ as SUPPORTED_ASSETS, $ as SendAssetClass, a0 as SendResult, a1 as ServiceListing, a2 as SimulationResult, a3 as StableAsset, a4 as SuiHolding, a5 as SuiRpcTxBlock, a6 as SupportedAsset, a7 as SwapRouteResult, a8 as T2000Error, a9 as T2000ErrorCode, aa as T2000ErrorData, ab as T2000_OVERLAY_FEE_WALLET, ac as TOKEN_MAP, ad as TransactionLeg, ae as TransactionRecord, af as TransactionSigner, ag as TxDirection, ah as USDC_DECIMALS, ai as USDC_TYPE, aj as USDE_TYPE, ak as USDSUI_TYPE, al as USDT_TYPE, am as WAL_TYPE, an as WBTC_TYPE, ao as X402ActivityPayload, ap as ZkLoginProof, aq as ZkLoginSigner, ar as buildCreateJobTx, as as buildDeliverJobTx, at as buildRefundJobTx, au as buildRejectJobTx, av as buildReleaseJobTx, aw as buildSendTx, ax as buildSwapTx, ay as checkPositiveAmount, az as checkSuiAddress, aA as claimPolicyLabel, aB as claimPolicyRequirement, aC as classifyAction, aD as classifyLabel, aE as classifySendAsset, aF as classifyTransaction, aG as deriveAgentScoreId, aH as executeTx, aI as extractAllUserLegs, aJ as extractTransferDetails, aK as extractTxCommands, aL as extractTxSender, aM as fallbackLabel, aN as fetchService, aO as findSwapRoute, aP as formatAssetAmount, aQ as formatSui, aR as formatUsd, aS as getAgentScore, aT as getDecimals, aU as getDecimalsForCoinType, aV as getJob, aW as getJobSpec, aX as invalidSendAssetMessage, aY as jobActionsFor, aZ as listServices, a_ as mapMoveAbortCode, a$ as mapWalletError, b0 as meetsClaimPolicy, b1 as mistToSui, b2 as parseSuiRpcTx, b3 as payWithX402, b4 as preflightCreateJob, b5 as preflightFail, b6 as preflightPay, b7 as preflightSend, b8 as preflightSwap, b9 as putJobSpec, ba as rawToStable, bb as rawToUsdc, bc as refineLendingLabel, bd as reportX402Activity, be as resolveSymbol, bf as resolveTokenType, bg as stableToRaw, bh as suiToMist, bi as truncateAddress, bj as usdcToRaw, bk as validateAddress, bl as verifyJobForSeller } from './commerce-
|
|
1
|
+
export { A as A2A_ESCROW_FEE_CONFIG_ID, a as A2A_ESCROW_PACKAGE_ID, b as ActivityReportConfig, c as AgentScore, B as BalanceResponse, C as CLOCK_ID, d as COIN_REGISTRY, e as ClassifyBalanceChange, f as ClassifyResult, g as CoinMeta, D as DEFAULT_ACTIVITY_REPORT_URL, h as DEFAULT_COMMERCE_API_BASE, i as DEFAULT_NETWORK, j as DepositInfo, E as ETH_TYPE, k as ExtractedTransfer, G as GAS_RESERVE_MIN, I as IKA_TYPE, J as JOB_STATES, l as Job, m as JobState, n as JobTerms, o as JobVerification, K as KNOWN_TARGETS, p as KeypairSigner, L as LABEL_PATTERNS, q as LOFI_TYPE, M as MANIFEST_TYPE, r as MAX_DELIVER_HORIZON_MS, s as MAX_JOB_USDC, t as MAX_REVIEW_WINDOW_MS, u as MIN_JOB_USDC, v as MIST_PER_SUI, N as NAVX_TYPE, O as OPENING_CLAIM_POLICIES, w as OPENING_CLAIM_POLICY_ANY_ACTIVE, x as OPENING_CLAIM_POLICY_PROVEN, y as OPENING_CLAIM_POLICY_PROVEN_4STAR, z as OVERLAY_FEE_RATE, F as OverlayFeeConfig, P as PREFLIGHT_MAX_AMOUNT, H as PREFLIGHT_OK, Q as PROVEN_MIN_AVG_STARS_X10, R as PROVEN_MIN_REVIEWS, S as PayOptions, T as PayResult, U as PreflightResult, V as REVIEW_MAX_STARS, W as REVIEW_MIN_STARS, X as STABLE_ASSETS, Y as SUI_DECIMALS, Z as SUI_TYPE, _ as SUPPORTED_ASSETS, $ as SendAssetClass, a0 as SendResult, a1 as ServiceListing, a2 as SimulationResult, a3 as StableAsset, a4 as SuiHolding, a5 as SuiRpcTxBlock, a6 as SupportedAsset, a7 as SwapRouteResult, a8 as T2000Error, a9 as T2000ErrorCode, aa as T2000ErrorData, ab as T2000_OVERLAY_FEE_WALLET, ac as TOKEN_MAP, ad as TransactionLeg, ae as TransactionRecord, af as TransactionSigner, ag as TxDirection, ah as USDC_DECIMALS, ai as USDC_TYPE, aj as USDE_TYPE, ak as USDSUI_TYPE, al as USDT_TYPE, am as WAL_TYPE, an as WBTC_TYPE, ao as X402ActivityPayload, ap as ZkLoginProof, aq as ZkLoginSigner, ar as buildCreateJobTx, as as buildDeliverJobTx, at as buildRefundJobTx, au as buildRejectJobTx, av as buildReleaseJobTx, aw as buildSendTx, ax as buildSwapTx, ay as checkPositiveAmount, az as checkSuiAddress, aA as claimPolicyLabel, aB as claimPolicyRequirement, aC as classifyAction, aD as classifyLabel, aE as classifySendAsset, aF as classifyTransaction, aG as deriveAgentScoreId, aH as executeTx, aI as extractAllUserLegs, aJ as extractTransferDetails, aK as extractTxCommands, aL as extractTxSender, aM as fallbackLabel, aN as fetchService, aO as findSwapRoute, aP as formatAssetAmount, aQ as formatSui, aR as formatUsd, aS as getAgentScore, aT as getDecimals, aU as getDecimalsForCoinType, aV as getJob, aW as getJobSpec, aX as invalidSendAssetMessage, aY as jobActionsFor, aZ as listServices, a_ as mapMoveAbortCode, a$ as mapWalletError, b0 as meetsClaimPolicy, b1 as mistToSui, b2 as parseSuiRpcTx, b3 as payWithX402, b4 as preflightCreateJob, b5 as preflightFail, b6 as preflightPay, b7 as preflightSend, b8 as preflightSwap, b9 as putJobSpec, ba as rawToStable, bb as rawToUsdc, bc as refineLendingLabel, bd as reportX402Activity, be as resolveSymbol, bf as resolveTokenType, bg as stableToRaw, bh as suiToMist, bi as truncateAddress, bj as usdcToRaw, bk as validateAddress, bl as verifyJobForSeller } from './commerce-CMK0liSg.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 BalanceResponse, C as CLOCK_ID, d as COIN_REGISTRY, e as ClassifyBalanceChange, f as ClassifyResult, g as CoinMeta, D as DEFAULT_ACTIVITY_REPORT_URL, h as DEFAULT_COMMERCE_API_BASE, i as DEFAULT_NETWORK, j as DepositInfo, E as ETH_TYPE, k as ExtractedTransfer, G as GAS_RESERVE_MIN, I as IKA_TYPE, J as JOB_STATES, l as Job, m as JobState, n as JobTerms, o as JobVerification, K as KNOWN_TARGETS, p as KeypairSigner, L as LABEL_PATTERNS, q as LOFI_TYPE, M as MANIFEST_TYPE, r as MAX_DELIVER_HORIZON_MS, s as MAX_JOB_USDC, t as MAX_REVIEW_WINDOW_MS, u as MIN_JOB_USDC, v as MIST_PER_SUI, N as NAVX_TYPE, O as OPENING_CLAIM_POLICIES, w as OPENING_CLAIM_POLICY_ANY_ACTIVE, x as OPENING_CLAIM_POLICY_PROVEN, y as OPENING_CLAIM_POLICY_PROVEN_4STAR, z as OVERLAY_FEE_RATE, F as OverlayFeeConfig, P as PREFLIGHT_MAX_AMOUNT, H as PREFLIGHT_OK, Q as PROVEN_MIN_AVG_STARS_X10, R as PROVEN_MIN_REVIEWS, S as PayOptions, T as PayResult, U as PreflightResult, V as REVIEW_MAX_STARS, W as REVIEW_MIN_STARS, X as STABLE_ASSETS, Y as SUI_DECIMALS, Z as SUI_TYPE, _ as SUPPORTED_ASSETS, $ as SendAssetClass, a0 as SendResult, a1 as ServiceListing, a2 as SimulationResult, a3 as StableAsset, a4 as SuiHolding, a5 as SuiRpcTxBlock, a6 as SupportedAsset, a7 as SwapRouteResult, a8 as T2000Error, a9 as T2000ErrorCode, aa as T2000ErrorData, ab as T2000_OVERLAY_FEE_WALLET, ac as TOKEN_MAP, ad as TransactionLeg, ae as TransactionRecord, af as TransactionSigner, ag as TxDirection, ah as USDC_DECIMALS, ai as USDC_TYPE, aj as USDE_TYPE, ak as USDSUI_TYPE, al as USDT_TYPE, am as WAL_TYPE, an as WBTC_TYPE, ao as X402ActivityPayload, ap as ZkLoginProof, aq as ZkLoginSigner, ar as buildCreateJobTx, as as buildDeliverJobTx, at as buildRefundJobTx, au as buildRejectJobTx, av as buildReleaseJobTx, aw as buildSendTx, ax as buildSwapTx, ay as checkPositiveAmount, az as checkSuiAddress, aA as claimPolicyLabel, aB as claimPolicyRequirement, aC as classifyAction, aD as classifyLabel, aE as classifySendAsset, aF as classifyTransaction, aG as deriveAgentScoreId, aH as executeTx, aI as extractAllUserLegs, aJ as extractTransferDetails, aK as extractTxCommands, aL as extractTxSender, aM as fallbackLabel, aN as fetchService, aO as findSwapRoute, aP as formatAssetAmount, aQ as formatSui, aR as formatUsd, aS as getAgentScore, aT as getDecimals, aU as getDecimalsForCoinType, aV as getJob, aW as getJobSpec, aX as invalidSendAssetMessage, aY as jobActionsFor, aZ as listServices, a_ as mapMoveAbortCode, a$ as mapWalletError, b0 as meetsClaimPolicy, b1 as mistToSui, b2 as parseSuiRpcTx, b3 as payWithX402, b4 as preflightCreateJob, b5 as preflightFail, b6 as preflightPay, b7 as preflightSend, b8 as preflightSwap, b9 as putJobSpec, ba as rawToStable, bb as rawToUsdc, bc as refineLendingLabel, bd as reportX402Activity, be as resolveSymbol, bf as resolveTokenType, bg as stableToRaw, bh as suiToMist, bi as truncateAddress, bj as usdcToRaw, bk as validateAddress, bl as verifyJobForSeller } from './commerce-
|
|
1
|
+
export { A as A2A_ESCROW_FEE_CONFIG_ID, a as A2A_ESCROW_PACKAGE_ID, b as ActivityReportConfig, c as AgentScore, B as BalanceResponse, C as CLOCK_ID, d as COIN_REGISTRY, e as ClassifyBalanceChange, f as ClassifyResult, g as CoinMeta, D as DEFAULT_ACTIVITY_REPORT_URL, h as DEFAULT_COMMERCE_API_BASE, i as DEFAULT_NETWORK, j as DepositInfo, E as ETH_TYPE, k as ExtractedTransfer, G as GAS_RESERVE_MIN, I as IKA_TYPE, J as JOB_STATES, l as Job, m as JobState, n as JobTerms, o as JobVerification, K as KNOWN_TARGETS, p as KeypairSigner, L as LABEL_PATTERNS, q as LOFI_TYPE, M as MANIFEST_TYPE, r as MAX_DELIVER_HORIZON_MS, s as MAX_JOB_USDC, t as MAX_REVIEW_WINDOW_MS, u as MIN_JOB_USDC, v as MIST_PER_SUI, N as NAVX_TYPE, O as OPENING_CLAIM_POLICIES, w as OPENING_CLAIM_POLICY_ANY_ACTIVE, x as OPENING_CLAIM_POLICY_PROVEN, y as OPENING_CLAIM_POLICY_PROVEN_4STAR, z as OVERLAY_FEE_RATE, F as OverlayFeeConfig, P as PREFLIGHT_MAX_AMOUNT, H as PREFLIGHT_OK, Q as PROVEN_MIN_AVG_STARS_X10, R as PROVEN_MIN_REVIEWS, S as PayOptions, T as PayResult, U as PreflightResult, V as REVIEW_MAX_STARS, W as REVIEW_MIN_STARS, X as STABLE_ASSETS, Y as SUI_DECIMALS, Z as SUI_TYPE, _ as SUPPORTED_ASSETS, $ as SendAssetClass, a0 as SendResult, a1 as ServiceListing, a2 as SimulationResult, a3 as StableAsset, a4 as SuiHolding, a5 as SuiRpcTxBlock, a6 as SupportedAsset, a7 as SwapRouteResult, a8 as T2000Error, a9 as T2000ErrorCode, aa as T2000ErrorData, ab as T2000_OVERLAY_FEE_WALLET, ac as TOKEN_MAP, ad as TransactionLeg, ae as TransactionRecord, af as TransactionSigner, ag as TxDirection, ah as USDC_DECIMALS, ai as USDC_TYPE, aj as USDE_TYPE, ak as USDSUI_TYPE, al as USDT_TYPE, am as WAL_TYPE, an as WBTC_TYPE, ao as X402ActivityPayload, ap as ZkLoginProof, aq as ZkLoginSigner, ar as buildCreateJobTx, as as buildDeliverJobTx, at as buildRefundJobTx, au as buildRejectJobTx, av as buildReleaseJobTx, aw as buildSendTx, ax as buildSwapTx, ay as checkPositiveAmount, az as checkSuiAddress, aA as claimPolicyLabel, aB as claimPolicyRequirement, aC as classifyAction, aD as classifyLabel, aE as classifySendAsset, aF as classifyTransaction, aG as deriveAgentScoreId, aH as executeTx, aI as extractAllUserLegs, aJ as extractTransferDetails, aK as extractTxCommands, aL as extractTxSender, aM as fallbackLabel, aN as fetchService, aO as findSwapRoute, aP as formatAssetAmount, aQ as formatSui, aR as formatUsd, aS as getAgentScore, aT as getDecimals, aU as getDecimalsForCoinType, aV as getJob, aW as getJobSpec, aX as invalidSendAssetMessage, aY as jobActionsFor, aZ as listServices, a_ as mapMoveAbortCode, a$ as mapWalletError, b0 as meetsClaimPolicy, b1 as mistToSui, b2 as parseSuiRpcTx, b3 as payWithX402, b4 as preflightCreateJob, b5 as preflightFail, b6 as preflightPay, b7 as preflightSend, b8 as preflightSwap, b9 as putJobSpec, ba as rawToStable, bb as rawToUsdc, bc as refineLendingLabel, bd as reportX402Activity, be as resolveSymbol, bf as resolveTokenType, bg as stableToRaw, bh as suiToMist, bi as truncateAddress, bj as usdcToRaw, bk as validateAddress, bl as verifyJobForSeller } from './commerce-CMK0liSg.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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { coinWithBalance, Transaction } from '@mysten/sui/transactions';
|
|
2
|
-
import { isValidSuiAddress, normalizeSuiAddress, fromBase64, normalizeStructTag, deriveObjectID } from '@mysten/sui/utils';
|
|
2
|
+
import { isValidSuiAddress, normalizeSuiAddress, fromBase64, normalizeStructTag, deriveObjectID, deriveDynamicFieldID } from '@mysten/sui/utils';
|
|
3
3
|
import '@mysten/sui/grpc';
|
|
4
4
|
import '@mysten/sui/graphql';
|
|
5
5
|
import { AggregatorClient, Env } from '@cetusprotocol/aggregator-sdk';
|
|
@@ -1330,8 +1330,9 @@ init_coinSelection();
|
|
|
1330
1330
|
init_errors();
|
|
1331
1331
|
init_token_registry();
|
|
1332
1332
|
init_coinSelection();
|
|
1333
|
-
var MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID = "
|
|
1333
|
+
var MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID = "0x4249f0b242c47c7baf0c37304365bc4bbe769bcedf11f3525e84682d59a3b23e";
|
|
1334
1334
|
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;
|
|
1335
|
+
var A2A_ESCROW_PACKAGE_V7_ID = "0x4249f0b242c47c7baf0c37304365bc4bbe769bcedf11f3525e84682d59a3b23e";
|
|
1335
1336
|
var OPENING_CLAIM_POLICY_ANY_ACTIVE = 0;
|
|
1336
1337
|
var OPENING_CLAIM_POLICY_PROVEN = 1;
|
|
1337
1338
|
var OPENING_CLAIM_POLICY_PROVEN_4STAR = 2;
|
|
@@ -1592,6 +1593,23 @@ function deriveAgentScoreId(agent, boardId) {
|
|
|
1592
1593
|
bcs.Address.serialize(validateAddress(agent)).toBytes()
|
|
1593
1594
|
);
|
|
1594
1595
|
}
|
|
1596
|
+
async function getDistinctBuyers(client, scoreId) {
|
|
1597
|
+
try {
|
|
1598
|
+
const fieldId = deriveDynamicFieldID(
|
|
1599
|
+
scoreId,
|
|
1600
|
+
`${A2A_ESCROW_PACKAGE_V7_ID}::${MODULE2}::DistinctCountKey`,
|
|
1601
|
+
new Uint8Array([0])
|
|
1602
|
+
);
|
|
1603
|
+
const resp = await client.core.getObject({
|
|
1604
|
+
objectId: fieldId,
|
|
1605
|
+
include: { json: true }
|
|
1606
|
+
});
|
|
1607
|
+
const json = resp?.object?.json;
|
|
1608
|
+
return Number(json?.value ?? 0);
|
|
1609
|
+
} catch {
|
|
1610
|
+
return 0;
|
|
1611
|
+
}
|
|
1612
|
+
}
|
|
1595
1613
|
async function getAgentScore(client, agent, boardId) {
|
|
1596
1614
|
const scoreId = deriveAgentScoreId(agent, boardId);
|
|
1597
1615
|
const resp = await client.core.getObject({ objectId: scoreId, include: { json: true } }).catch(() => null);
|
|
@@ -1607,13 +1625,14 @@ async function getAgentScore(client, agent, boardId) {
|
|
|
1607
1625
|
agent: String(json.agent),
|
|
1608
1626
|
reviewCount,
|
|
1609
1627
|
starsSum,
|
|
1610
|
-
averageStars: reviewCount > 0 ? Math.round(starsSum / reviewCount * 100) / 100 : 0
|
|
1628
|
+
averageStars: reviewCount > 0 ? Math.round(starsSum / reviewCount * 100) / 100 : 0,
|
|
1629
|
+
distinctBuyers: await getDistinctBuyers(client, scoreId)
|
|
1611
1630
|
};
|
|
1612
1631
|
}
|
|
1613
1632
|
function meetsClaimPolicy(score, claimPolicy) {
|
|
1614
1633
|
if (claimPolicy === 0) return true;
|
|
1615
1634
|
if (!score) return false;
|
|
1616
|
-
const proven = score.
|
|
1635
|
+
const proven = score.distinctBuyers >= PROVEN_MIN_REVIEWS;
|
|
1617
1636
|
if (claimPolicy === 1) return proven;
|
|
1618
1637
|
if (claimPolicy === 2) {
|
|
1619
1638
|
return proven && score.starsSum * 10 >= score.reviewCount * PROVEN_MIN_AVG_STARS_X10;
|
|
@@ -1628,10 +1647,10 @@ function claimPolicyLabel(claimPolicy) {
|
|
|
1628
1647
|
}
|
|
1629
1648
|
function claimPolicyRequirement(claimPolicy) {
|
|
1630
1649
|
if (claimPolicy === 1) {
|
|
1631
|
-
return `Claiming needs at least ${PROVEN_MIN_REVIEWS}
|
|
1650
|
+
return `Claiming needs at least ${PROVEN_MIN_REVIEWS} reviews from distinct buyers.`;
|
|
1632
1651
|
}
|
|
1633
1652
|
if (claimPolicy === 2) {
|
|
1634
|
-
return `Claiming needs at least ${PROVEN_MIN_REVIEWS}
|
|
1653
|
+
return `Claiming needs at least ${PROVEN_MIN_REVIEWS} reviews from distinct buyers and a 4.0\u2605 average.`;
|
|
1635
1654
|
}
|
|
1636
1655
|
return "Anyone can claim (active Agent ID required).";
|
|
1637
1656
|
}
|
|
@@ -1625,9 +1625,9 @@ declare function verifyJobForSeller({ client, jobId, seller, minAmountUsdc, minR
|
|
|
1625
1625
|
* upgrade + `migrate` cutover is a ONE-VALUE change here. The original id
|
|
1626
1626
|
* (`MAINNET_A2A_ESCROW_PACKAGE_ID` in job.ts) remains the anchor for type
|
|
1627
1627
|
* strings, event filters, and object-type queries — those never move. */
|
|
1628
|
-
declare const MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID = "
|
|
1628
|
+
declare const MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID = "0x4249f0b242c47c7baf0c37304365bc4bbe769bcedf11f3525e84682d59a3b23e";
|
|
1629
1629
|
/** Back-compat name for the latest id (pre-S.981 consumers import this). */
|
|
1630
|
-
declare const MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID = "
|
|
1630
|
+
declare const MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID = "0x4249f0b242c47c7baf0c37304365bc4bbe769bcedf11f3525e84682d59a3b23e";
|
|
1631
1631
|
/** Env-overridable latest id for testnet/dev (NOT a trust anchor). A fresh
|
|
1632
1632
|
* dev publish has original == latest, so `A2A_ESCROW_PACKAGE_ID` alone is
|
|
1633
1633
|
* honored as the fallback override. */
|
|
@@ -1654,6 +1654,11 @@ declare const A2A_ESCROW_PACKAGE_V3_ID = "0x69ad93c555519de520a5c7f7f2963ad6f8b9
|
|
|
1654
1654
|
* events and the ScoreBoard/AgentScore object types. A DEFINING-id anchor
|
|
1655
1655
|
* like V2/V3 — never moves again, even when LATEST does. */
|
|
1656
1656
|
declare const A2A_ESCROW_PACKAGE_V6_ID = "0xb065033b6f72c4899055a0b3afac28f09dc7b0b7b491eada793157de20000618";
|
|
1657
|
+
/** v7 (S.1062, upgrade 3DcWdSPE… 2026-08-15) — defining id for the
|
|
1658
|
+
* distinct-buyer surface: the ReviewSubmittedV2 event and the
|
|
1659
|
+
* DistinctCountKey/BuyerSeenKey DF key types. A DEFINING-id anchor like
|
|
1660
|
+
* V2/V3/V6 — never moves again, even when LATEST does. */
|
|
1661
|
+
declare const A2A_ESCROW_PACKAGE_V7_ID = "0x4249f0b242c47c7baf0c37304365bc4bbe769bcedf11f3525e84682d59a3b23e";
|
|
1657
1662
|
/** Default claim policy: any ACTIVE registered Agent ID ($0 claim, FCFS). */
|
|
1658
1663
|
declare const OPENING_CLAIM_POLICY_ANY_ACTIVE = 0;
|
|
1659
1664
|
/** S.1054 — Proven: claimer needs ≥ PROVEN_MIN_REVIEWS on-chain reviews
|
|
@@ -1758,7 +1763,10 @@ declare function getOpening(client: SuiCoreClient, openingId: string): Promise<O
|
|
|
1758
1763
|
declare const MAINNET_A2A_SCORE_BOARD_ID = "0x7506f01e01b1c48d73832949a2808929b80dec2f7104889e012f8a4f09719f6e";
|
|
1759
1764
|
/** Env-overridable board id for testnet/dev (NOT a trust anchor). */
|
|
1760
1765
|
declare const A2A_SCORE_BOARD_ID: string;
|
|
1761
|
-
/**
|
|
1766
|
+
/** The Proven floor (`claim_policy` 1, and the floor of 2). Since S.1062
|
|
1767
|
+
* this counts DISTINCT BUYERS, not raw reviews — one friendly buyer ×3
|
|
1768
|
+
* no longer unlocks Proven. The name survives for the published surface;
|
|
1769
|
+
* the value is unchanged at 3. */
|
|
1762
1770
|
declare const PROVEN_MIN_REVIEWS = 3;
|
|
1763
1771
|
/** Average-stars floor for Proven · 4★+ (`claim_policy` 2), scaled ×10. */
|
|
1764
1772
|
declare const PROVEN_MIN_AVG_STARS_X10 = 40;
|
|
@@ -1777,13 +1785,18 @@ interface AgentScore {
|
|
|
1777
1785
|
starsSum: number;
|
|
1778
1786
|
/** Integer-safe average, rounded to 2dp for display (0 when no reviews). */
|
|
1779
1787
|
averageStars: number;
|
|
1788
|
+
/** Distinct buyer addresses that have reviewed since S.1062 — the
|
|
1789
|
+
* Proven gate input. 0 when the DF is absent (pre-S.1062 scores never
|
|
1790
|
+
* grandfather in). */
|
|
1791
|
+
distinctBuyers: number;
|
|
1780
1792
|
}
|
|
1781
1793
|
/** Read an agent's score (null = no reviews yet — the lazy-create means the
|
|
1782
1794
|
* object simply doesn't exist). */
|
|
1783
1795
|
declare function getAgentScore(client: SuiCoreClient, agent: string, boardId?: string): Promise<AgentScore | null>;
|
|
1784
1796
|
/** Does a score satisfy an Opening's claim policy? (`null` score = zero
|
|
1785
|
-
* reviews.) Mirrors the Move predicates exactly —
|
|
1786
|
-
*
|
|
1797
|
+
* reviews.) Mirrors the Move predicates exactly — S.1062: the Proven
|
|
1798
|
+
* floor counts DISTINCT BUYERS; integer avg math; policy 2 strictly
|
|
1799
|
+
* stronger than policy 1. */
|
|
1787
1800
|
declare function meetsClaimPolicy(score: AgentScore | null, claimPolicy: number): boolean;
|
|
1788
1801
|
/** Human label for a claim policy — every surface uses these, never the
|
|
1789
1802
|
* raw enum. */
|
|
@@ -1874,4 +1887,4 @@ declare function putJobSpec(base: string, content: string): Promise<string>;
|
|
|
1874
1887
|
* the store is untrusted; the chain hash is the authority). */
|
|
1875
1888
|
declare function getJobSpec(base: string, hash: string): Promise<string>;
|
|
1876
1889
|
|
|
1877
|
-
export { type SendAssetClass as $, A2A_ESCROW_FEE_CONFIG_ID as A, type BalanceResponse as B, CLOCK_ID as C, DEFAULT_ACTIVITY_REPORT_URL as D, ETH_TYPE as E, type OverlayFeeConfig as F, GAS_RESERVE_MIN as G, PREFLIGHT_OK as H, IKA_TYPE as I, JOB_STATES as J, KNOWN_TARGETS as K, LABEL_PATTERNS as L, MANIFEST_TYPE as M, NAVX_TYPE as N, OPENING_CLAIM_POLICIES as O, PREFLIGHT_MAX_AMOUNT as P, PROVEN_MIN_AVG_STARS_X10 as Q, PROVEN_MIN_REVIEWS as R, type PayOptions as S, type PayResult as T, type PreflightResult as U, REVIEW_MAX_STARS as V, REVIEW_MIN_STARS as W, STABLE_ASSETS as X, SUI_DECIMALS as Y, SUI_TYPE as Z, SUPPORTED_ASSETS as _, A2A_ESCROW_PACKAGE_ID as a, mapWalletError as a$, type SendResult as a0, type ServiceListing as a1, type SimulationResult as a2, type StableAsset as a3, type SuiHolding as a4, type SuiRpcTxBlock as a5, type SupportedAsset as a6, type SwapRouteResult as a7, T2000Error as a8, type T2000ErrorCode as a9, claimPolicyLabel as aA, claimPolicyRequirement as aB, classifyAction as aC, classifyLabel as aD, classifySendAsset as aE, classifyTransaction as aF, deriveAgentScoreId as aG, executeTx as aH, extractAllUserLegs as aI, extractTransferDetails as aJ, extractTxCommands as aK, extractTxSender as aL, fallbackLabel as aM, fetchService as aN, findSwapRoute as aO, formatAssetAmount as aP, formatSui as aQ, formatUsd as aR, getAgentScore as aS, getDecimals as aT, getDecimalsForCoinType as aU, getJob as aV, getJobSpec as aW, invalidSendAssetMessage as aX, jobActionsFor as aY, listServices as aZ, mapMoveAbortCode as a_, type T2000ErrorData as aa, T2000_OVERLAY_FEE_WALLET as ab, TOKEN_MAP as ac, type TransactionLeg as ad, type TransactionRecord as ae, type TransactionSigner as af, type TxDirection as ag, USDC_DECIMALS as ah, USDC_TYPE as ai, USDE_TYPE as aj, USDSUI_TYPE as ak, USDT_TYPE as al, WAL_TYPE as am, WBTC_TYPE as an, type X402ActivityPayload as ao, type ZkLoginProof as ap, ZkLoginSigner as aq, buildCreateJobTx as ar, buildDeliverJobTx as as, buildRefundJobTx as at, buildRejectJobTx as au, buildReleaseJobTx as av, buildSendTx as aw, buildSwapTx as ax, checkPositiveAmount as ay, checkSuiAddress as az, type ActivityReportConfig as b,
|
|
1890
|
+
export { type SendAssetClass as $, A2A_ESCROW_FEE_CONFIG_ID as A, type BalanceResponse as B, CLOCK_ID as C, DEFAULT_ACTIVITY_REPORT_URL as D, ETH_TYPE as E, type OverlayFeeConfig as F, GAS_RESERVE_MIN as G, PREFLIGHT_OK as H, IKA_TYPE as I, JOB_STATES as J, KNOWN_TARGETS as K, LABEL_PATTERNS as L, MANIFEST_TYPE as M, NAVX_TYPE as N, OPENING_CLAIM_POLICIES as O, PREFLIGHT_MAX_AMOUNT as P, PROVEN_MIN_AVG_STARS_X10 as Q, PROVEN_MIN_REVIEWS as R, type PayOptions as S, type PayResult as T, type PreflightResult as U, REVIEW_MAX_STARS as V, REVIEW_MIN_STARS as W, STABLE_ASSETS as X, SUI_DECIMALS as Y, SUI_TYPE as Z, SUPPORTED_ASSETS as _, A2A_ESCROW_PACKAGE_ID as a, mapWalletError as a$, type SendResult as a0, type ServiceListing as a1, type SimulationResult as a2, type StableAsset as a3, type SuiHolding as a4, type SuiRpcTxBlock as a5, type SupportedAsset as a6, type SwapRouteResult as a7, T2000Error as a8, type T2000ErrorCode as a9, claimPolicyLabel as aA, claimPolicyRequirement as aB, classifyAction as aC, classifyLabel as aD, classifySendAsset as aE, classifyTransaction as aF, deriveAgentScoreId as aG, executeTx as aH, extractAllUserLegs as aI, extractTransferDetails as aJ, extractTxCommands as aK, extractTxSender as aL, fallbackLabel as aM, fetchService as aN, findSwapRoute as aO, formatAssetAmount as aP, formatSui as aQ, formatUsd as aR, getAgentScore as aS, getDecimals as aT, getDecimalsForCoinType as aU, getJob as aV, getJobSpec as aW, invalidSendAssetMessage as aX, jobActionsFor as aY, listServices as aZ, mapMoveAbortCode as a_, type T2000ErrorData as aa, T2000_OVERLAY_FEE_WALLET as ab, TOKEN_MAP as ac, type TransactionLeg as ad, type TransactionRecord as ae, type TransactionSigner as af, type TxDirection as ag, USDC_DECIMALS as ah, USDC_TYPE as ai, USDE_TYPE as aj, USDSUI_TYPE as ak, USDT_TYPE as al, WAL_TYPE as am, WBTC_TYPE as an, type X402ActivityPayload as ao, type ZkLoginProof as ap, ZkLoginSigner as aq, buildCreateJobTx as ar, buildDeliverJobTx as as, buildRefundJobTx as at, buildRejectJobTx as au, buildReleaseJobTx as av, buildSendTx as aw, buildSwapTx as ax, checkPositiveAmount as ay, checkSuiAddress as az, type ActivityReportConfig as b, buildDeclineJobTx as b$, meetsClaimPolicy as b0, mistToSui as b1, parseSuiRpcTx as b2, payWithX402 as b3, preflightCreateJob as b4, preflightFail as b5, preflightPay as b6, preflightSend as b7, preflightSwap as b8, putJobSpec as b9, A2A_ESCROW_PACKAGE_V7_ID as bA, A2A_SCORE_BOARD_ID as bB, CETUS_USDC_SUI_POOL as bC, type CoinPage as bD, DEFAULT_GRPC_URL as bE, GASLESS_MIN_STABLE_AMOUNT as bF, GASLESS_STABLE_TYPES as bG, MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID as bH, MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID as bI, MAINNET_A2A_ESCROW_PACKAGE_ID as bJ, MAINNET_A2A_SCORE_BOARD_ID as bK, MAX_OPEN_WINDOW_MS as bL, OPERATION_ASSETS as bM, type Opening as bN, type OpeningTerms as bO, type Operation as bP, SENDABLE_ASSETS as bQ, type SelectAndSplitResult as bR, type SerializedCetusRoutePath as bS, type SerializedRouterDataV3 as bT, addSendToTx as bU, addSwapToTx as bV, assertAllowedAsset as bW, assertBuyerRequirements as bX, buildCancelOpeningTx as bY, buildClaimOpeningTx as bZ, buildCreateOpeningTx as b_, rawToStable as ba, rawToUsdc as bb, refineLendingLabel as bc, reportX402Activity as bd, resolveSymbol as be, resolveTokenType as bf, stableToRaw as bg, suiToMist as bh, truncateAddress as bi, usdcToRaw as bj, validateAddress as bk, verifyJobForSeller as bl, type T2000Options as bm, type X402Probe as bn, type SerializedCetusRoute as bo, type SwapResult as bp, type SwapQuoteResult as bq, type PaymentRequest as br, type SuiCoreClient as bs, type SponsoredCoinMergeCache as bt, type SendableAsset as bu, A2A_ESCROW_LATEST_PACKAGE_ID as bv, A2A_ESCROW_OPENING_PACKAGE_ID as bw, A2A_ESCROW_PACKAGE_V2_ID as bx, A2A_ESCROW_PACKAGE_V3_ID as by, A2A_ESCROW_PACKAGE_V6_ID as bz, type AgentScore as c, buildRefundUnclaimedTx as c0, buildSubmitFirstReviewTx as c1, buildSubmitReviewTx as c2, deserializeCetusRoute as c3, fetchAllCoins as c4, getCoinMeta as c5, getOpening as c6, getSuiClient as c7, getSuiGrpcClient as c8, isAllowedAsset as c9, isCetusRouteFresh as ca, isInRegistry as cb, normalizeAsset as cc, normalizeCoinType as cd, preflightCreateOpening as ce, probeX402 as cf, queryHistory as cg, queryTransaction as ch, selectAndSplitCoin as ci, selectSuiCoin as cj, serializeCetusRoute as ck, simulateTransaction as cl, throwIfSimulationFailed as cm, verifyCetusRouteCoinMatch as cn, COIN_REGISTRY as d, type ClassifyBalanceChange as e, type ClassifyResult as f, type CoinMeta as g, DEFAULT_COMMERCE_API_BASE as h, DEFAULT_NETWORK as i, type DepositInfo as j, type ExtractedTransfer as k, type Job as l, type JobState as m, type JobTerms as n, type JobVerification as o, KeypairSigner as p, LOFI_TYPE as q, MAX_DELIVER_HORIZON_MS as r, MAX_JOB_USDC as s, MAX_REVIEW_WINDOW_MS as t, MIN_JOB_USDC as u, MIST_PER_SUI as v, OPENING_CLAIM_POLICY_ANY_ACTIVE as w, OPENING_CLAIM_POLICY_PROVEN as x, OPENING_CLAIM_POLICY_PROVEN_4STAR as y, OVERLAY_FEE_RATE as z };
|
|
@@ -1625,9 +1625,9 @@ declare function verifyJobForSeller({ client, jobId, seller, minAmountUsdc, minR
|
|
|
1625
1625
|
* upgrade + `migrate` cutover is a ONE-VALUE change here. The original id
|
|
1626
1626
|
* (`MAINNET_A2A_ESCROW_PACKAGE_ID` in job.ts) remains the anchor for type
|
|
1627
1627
|
* strings, event filters, and object-type queries — those never move. */
|
|
1628
|
-
declare const MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID = "
|
|
1628
|
+
declare const MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID = "0x4249f0b242c47c7baf0c37304365bc4bbe769bcedf11f3525e84682d59a3b23e";
|
|
1629
1629
|
/** Back-compat name for the latest id (pre-S.981 consumers import this). */
|
|
1630
|
-
declare const MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID = "
|
|
1630
|
+
declare const MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID = "0x4249f0b242c47c7baf0c37304365bc4bbe769bcedf11f3525e84682d59a3b23e";
|
|
1631
1631
|
/** Env-overridable latest id for testnet/dev (NOT a trust anchor). A fresh
|
|
1632
1632
|
* dev publish has original == latest, so `A2A_ESCROW_PACKAGE_ID` alone is
|
|
1633
1633
|
* honored as the fallback override. */
|
|
@@ -1654,6 +1654,11 @@ declare const A2A_ESCROW_PACKAGE_V3_ID = "0x69ad93c555519de520a5c7f7f2963ad6f8b9
|
|
|
1654
1654
|
* events and the ScoreBoard/AgentScore object types. A DEFINING-id anchor
|
|
1655
1655
|
* like V2/V3 — never moves again, even when LATEST does. */
|
|
1656
1656
|
declare const A2A_ESCROW_PACKAGE_V6_ID = "0xb065033b6f72c4899055a0b3afac28f09dc7b0b7b491eada793157de20000618";
|
|
1657
|
+
/** v7 (S.1062, upgrade 3DcWdSPE… 2026-08-15) — defining id for the
|
|
1658
|
+
* distinct-buyer surface: the ReviewSubmittedV2 event and the
|
|
1659
|
+
* DistinctCountKey/BuyerSeenKey DF key types. A DEFINING-id anchor like
|
|
1660
|
+
* V2/V3/V6 — never moves again, even when LATEST does. */
|
|
1661
|
+
declare const A2A_ESCROW_PACKAGE_V7_ID = "0x4249f0b242c47c7baf0c37304365bc4bbe769bcedf11f3525e84682d59a3b23e";
|
|
1657
1662
|
/** Default claim policy: any ACTIVE registered Agent ID ($0 claim, FCFS). */
|
|
1658
1663
|
declare const OPENING_CLAIM_POLICY_ANY_ACTIVE = 0;
|
|
1659
1664
|
/** S.1054 — Proven: claimer needs ≥ PROVEN_MIN_REVIEWS on-chain reviews
|
|
@@ -1758,7 +1763,10 @@ declare function getOpening(client: SuiCoreClient, openingId: string): Promise<O
|
|
|
1758
1763
|
declare const MAINNET_A2A_SCORE_BOARD_ID = "0x7506f01e01b1c48d73832949a2808929b80dec2f7104889e012f8a4f09719f6e";
|
|
1759
1764
|
/** Env-overridable board id for testnet/dev (NOT a trust anchor). */
|
|
1760
1765
|
declare const A2A_SCORE_BOARD_ID: string;
|
|
1761
|
-
/**
|
|
1766
|
+
/** The Proven floor (`claim_policy` 1, and the floor of 2). Since S.1062
|
|
1767
|
+
* this counts DISTINCT BUYERS, not raw reviews — one friendly buyer ×3
|
|
1768
|
+
* no longer unlocks Proven. The name survives for the published surface;
|
|
1769
|
+
* the value is unchanged at 3. */
|
|
1762
1770
|
declare const PROVEN_MIN_REVIEWS = 3;
|
|
1763
1771
|
/** Average-stars floor for Proven · 4★+ (`claim_policy` 2), scaled ×10. */
|
|
1764
1772
|
declare const PROVEN_MIN_AVG_STARS_X10 = 40;
|
|
@@ -1777,13 +1785,18 @@ interface AgentScore {
|
|
|
1777
1785
|
starsSum: number;
|
|
1778
1786
|
/** Integer-safe average, rounded to 2dp for display (0 when no reviews). */
|
|
1779
1787
|
averageStars: number;
|
|
1788
|
+
/** Distinct buyer addresses that have reviewed since S.1062 — the
|
|
1789
|
+
* Proven gate input. 0 when the DF is absent (pre-S.1062 scores never
|
|
1790
|
+
* grandfather in). */
|
|
1791
|
+
distinctBuyers: number;
|
|
1780
1792
|
}
|
|
1781
1793
|
/** Read an agent's score (null = no reviews yet — the lazy-create means the
|
|
1782
1794
|
* object simply doesn't exist). */
|
|
1783
1795
|
declare function getAgentScore(client: SuiCoreClient, agent: string, boardId?: string): Promise<AgentScore | null>;
|
|
1784
1796
|
/** Does a score satisfy an Opening's claim policy? (`null` score = zero
|
|
1785
|
-
* reviews.) Mirrors the Move predicates exactly —
|
|
1786
|
-
*
|
|
1797
|
+
* reviews.) Mirrors the Move predicates exactly — S.1062: the Proven
|
|
1798
|
+
* floor counts DISTINCT BUYERS; integer avg math; policy 2 strictly
|
|
1799
|
+
* stronger than policy 1. */
|
|
1787
1800
|
declare function meetsClaimPolicy(score: AgentScore | null, claimPolicy: number): boolean;
|
|
1788
1801
|
/** Human label for a claim policy — every surface uses these, never the
|
|
1789
1802
|
* raw enum. */
|
|
@@ -1874,4 +1887,4 @@ declare function putJobSpec(base: string, content: string): Promise<string>;
|
|
|
1874
1887
|
* the store is untrusted; the chain hash is the authority). */
|
|
1875
1888
|
declare function getJobSpec(base: string, hash: string): Promise<string>;
|
|
1876
1889
|
|
|
1877
|
-
export { type SendAssetClass as $, A2A_ESCROW_FEE_CONFIG_ID as A, type BalanceResponse as B, CLOCK_ID as C, DEFAULT_ACTIVITY_REPORT_URL as D, ETH_TYPE as E, type OverlayFeeConfig as F, GAS_RESERVE_MIN as G, PREFLIGHT_OK as H, IKA_TYPE as I, JOB_STATES as J, KNOWN_TARGETS as K, LABEL_PATTERNS as L, MANIFEST_TYPE as M, NAVX_TYPE as N, OPENING_CLAIM_POLICIES as O, PREFLIGHT_MAX_AMOUNT as P, PROVEN_MIN_AVG_STARS_X10 as Q, PROVEN_MIN_REVIEWS as R, type PayOptions as S, type PayResult as T, type PreflightResult as U, REVIEW_MAX_STARS as V, REVIEW_MIN_STARS as W, STABLE_ASSETS as X, SUI_DECIMALS as Y, SUI_TYPE as Z, SUPPORTED_ASSETS as _, A2A_ESCROW_PACKAGE_ID as a, mapWalletError as a$, type SendResult as a0, type ServiceListing as a1, type SimulationResult as a2, type StableAsset as a3, type SuiHolding as a4, type SuiRpcTxBlock as a5, type SupportedAsset as a6, type SwapRouteResult as a7, T2000Error as a8, type T2000ErrorCode as a9, claimPolicyLabel as aA, claimPolicyRequirement as aB, classifyAction as aC, classifyLabel as aD, classifySendAsset as aE, classifyTransaction as aF, deriveAgentScoreId as aG, executeTx as aH, extractAllUserLegs as aI, extractTransferDetails as aJ, extractTxCommands as aK, extractTxSender as aL, fallbackLabel as aM, fetchService as aN, findSwapRoute as aO, formatAssetAmount as aP, formatSui as aQ, formatUsd as aR, getAgentScore as aS, getDecimals as aT, getDecimalsForCoinType as aU, getJob as aV, getJobSpec as aW, invalidSendAssetMessage as aX, jobActionsFor as aY, listServices as aZ, mapMoveAbortCode as a_, type T2000ErrorData as aa, T2000_OVERLAY_FEE_WALLET as ab, TOKEN_MAP as ac, type TransactionLeg as ad, type TransactionRecord as ae, type TransactionSigner as af, type TxDirection as ag, USDC_DECIMALS as ah, USDC_TYPE as ai, USDE_TYPE as aj, USDSUI_TYPE as ak, USDT_TYPE as al, WAL_TYPE as am, WBTC_TYPE as an, type X402ActivityPayload as ao, type ZkLoginProof as ap, ZkLoginSigner as aq, buildCreateJobTx as ar, buildDeliverJobTx as as, buildRefundJobTx as at, buildRejectJobTx as au, buildReleaseJobTx as av, buildSendTx as aw, buildSwapTx as ax, checkPositiveAmount as ay, checkSuiAddress as az, type ActivityReportConfig as b,
|
|
1890
|
+
export { type SendAssetClass as $, A2A_ESCROW_FEE_CONFIG_ID as A, type BalanceResponse as B, CLOCK_ID as C, DEFAULT_ACTIVITY_REPORT_URL as D, ETH_TYPE as E, type OverlayFeeConfig as F, GAS_RESERVE_MIN as G, PREFLIGHT_OK as H, IKA_TYPE as I, JOB_STATES as J, KNOWN_TARGETS as K, LABEL_PATTERNS as L, MANIFEST_TYPE as M, NAVX_TYPE as N, OPENING_CLAIM_POLICIES as O, PREFLIGHT_MAX_AMOUNT as P, PROVEN_MIN_AVG_STARS_X10 as Q, PROVEN_MIN_REVIEWS as R, type PayOptions as S, type PayResult as T, type PreflightResult as U, REVIEW_MAX_STARS as V, REVIEW_MIN_STARS as W, STABLE_ASSETS as X, SUI_DECIMALS as Y, SUI_TYPE as Z, SUPPORTED_ASSETS as _, A2A_ESCROW_PACKAGE_ID as a, mapWalletError as a$, type SendResult as a0, type ServiceListing as a1, type SimulationResult as a2, type StableAsset as a3, type SuiHolding as a4, type SuiRpcTxBlock as a5, type SupportedAsset as a6, type SwapRouteResult as a7, T2000Error as a8, type T2000ErrorCode as a9, claimPolicyLabel as aA, claimPolicyRequirement as aB, classifyAction as aC, classifyLabel as aD, classifySendAsset as aE, classifyTransaction as aF, deriveAgentScoreId as aG, executeTx as aH, extractAllUserLegs as aI, extractTransferDetails as aJ, extractTxCommands as aK, extractTxSender as aL, fallbackLabel as aM, fetchService as aN, findSwapRoute as aO, formatAssetAmount as aP, formatSui as aQ, formatUsd as aR, getAgentScore as aS, getDecimals as aT, getDecimalsForCoinType as aU, getJob as aV, getJobSpec as aW, invalidSendAssetMessage as aX, jobActionsFor as aY, listServices as aZ, mapMoveAbortCode as a_, type T2000ErrorData as aa, T2000_OVERLAY_FEE_WALLET as ab, TOKEN_MAP as ac, type TransactionLeg as ad, type TransactionRecord as ae, type TransactionSigner as af, type TxDirection as ag, USDC_DECIMALS as ah, USDC_TYPE as ai, USDE_TYPE as aj, USDSUI_TYPE as ak, USDT_TYPE as al, WAL_TYPE as am, WBTC_TYPE as an, type X402ActivityPayload as ao, type ZkLoginProof as ap, ZkLoginSigner as aq, buildCreateJobTx as ar, buildDeliverJobTx as as, buildRefundJobTx as at, buildRejectJobTx as au, buildReleaseJobTx as av, buildSendTx as aw, buildSwapTx as ax, checkPositiveAmount as ay, checkSuiAddress as az, type ActivityReportConfig as b, buildDeclineJobTx as b$, meetsClaimPolicy as b0, mistToSui as b1, parseSuiRpcTx as b2, payWithX402 as b3, preflightCreateJob as b4, preflightFail as b5, preflightPay as b6, preflightSend as b7, preflightSwap as b8, putJobSpec as b9, A2A_ESCROW_PACKAGE_V7_ID as bA, A2A_SCORE_BOARD_ID as bB, CETUS_USDC_SUI_POOL as bC, type CoinPage as bD, DEFAULT_GRPC_URL as bE, GASLESS_MIN_STABLE_AMOUNT as bF, GASLESS_STABLE_TYPES as bG, MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID as bH, MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID as bI, MAINNET_A2A_ESCROW_PACKAGE_ID as bJ, MAINNET_A2A_SCORE_BOARD_ID as bK, MAX_OPEN_WINDOW_MS as bL, OPERATION_ASSETS as bM, type Opening as bN, type OpeningTerms as bO, type Operation as bP, SENDABLE_ASSETS as bQ, type SelectAndSplitResult as bR, type SerializedCetusRoutePath as bS, type SerializedRouterDataV3 as bT, addSendToTx as bU, addSwapToTx as bV, assertAllowedAsset as bW, assertBuyerRequirements as bX, buildCancelOpeningTx as bY, buildClaimOpeningTx as bZ, buildCreateOpeningTx as b_, rawToStable as ba, rawToUsdc as bb, refineLendingLabel as bc, reportX402Activity as bd, resolveSymbol as be, resolveTokenType as bf, stableToRaw as bg, suiToMist as bh, truncateAddress as bi, usdcToRaw as bj, validateAddress as bk, verifyJobForSeller as bl, type T2000Options as bm, type X402Probe as bn, type SerializedCetusRoute as bo, type SwapResult as bp, type SwapQuoteResult as bq, type PaymentRequest as br, type SuiCoreClient as bs, type SponsoredCoinMergeCache as bt, type SendableAsset as bu, A2A_ESCROW_LATEST_PACKAGE_ID as bv, A2A_ESCROW_OPENING_PACKAGE_ID as bw, A2A_ESCROW_PACKAGE_V2_ID as bx, A2A_ESCROW_PACKAGE_V3_ID as by, A2A_ESCROW_PACKAGE_V6_ID as bz, type AgentScore as c, buildRefundUnclaimedTx as c0, buildSubmitFirstReviewTx as c1, buildSubmitReviewTx as c2, deserializeCetusRoute as c3, fetchAllCoins as c4, getCoinMeta as c5, getOpening as c6, getSuiClient as c7, getSuiGrpcClient as c8, isAllowedAsset as c9, isCetusRouteFresh as ca, isInRegistry as cb, normalizeAsset as cc, normalizeCoinType as cd, preflightCreateOpening as ce, probeX402 as cf, queryHistory as cg, queryTransaction as ch, selectAndSplitCoin as ci, selectSuiCoin as cj, serializeCetusRoute as ck, simulateTransaction as cl, throwIfSimulationFailed as cm, verifyCetusRouteCoinMatch as cn, COIN_REGISTRY as d, type ClassifyBalanceChange as e, type ClassifyResult as f, type CoinMeta as g, DEFAULT_COMMERCE_API_BASE as h, DEFAULT_NETWORK as i, type DepositInfo as j, type ExtractedTransfer as k, type Job as l, type JobState as m, type JobTerms as n, type JobVerification as o, KeypairSigner as p, LOFI_TYPE as q, MAX_DELIVER_HORIZON_MS as r, MAX_JOB_USDC as s, MAX_REVIEW_WINDOW_MS as t, MIN_JOB_USDC as u, MIST_PER_SUI as v, OPENING_CLAIM_POLICY_ANY_ACTIVE as w, OPENING_CLAIM_POLICY_PROVEN as x, OPENING_CLAIM_POLICY_PROVEN_4STAR as y, OVERLAY_FEE_RATE as z };
|
package/dist/index.cjs
CHANGED
|
@@ -3328,13 +3328,14 @@ init_coinSelection();
|
|
|
3328
3328
|
init_errors();
|
|
3329
3329
|
init_token_registry();
|
|
3330
3330
|
init_coinSelection();
|
|
3331
|
-
var MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID = "
|
|
3331
|
+
var MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID = "0x4249f0b242c47c7baf0c37304365bc4bbe769bcedf11f3525e84682d59a3b23e";
|
|
3332
3332
|
var MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID = MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID;
|
|
3333
3333
|
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;
|
|
3334
3334
|
var A2A_ESCROW_OPENING_PACKAGE_ID = A2A_ESCROW_LATEST_PACKAGE_ID;
|
|
3335
3335
|
var A2A_ESCROW_PACKAGE_V2_ID = "0x860288d789dc617f6474a0a6801d6011e53bf30d5fb801cdad47b9bc6adb098b";
|
|
3336
3336
|
var A2A_ESCROW_PACKAGE_V3_ID = "0x69ad93c555519de520a5c7f7f2963ad6f8b91cefc098fc2eed75942dcb5bcbe7";
|
|
3337
3337
|
var A2A_ESCROW_PACKAGE_V6_ID = "0xb065033b6f72c4899055a0b3afac28f09dc7b0b7b491eada793157de20000618";
|
|
3338
|
+
var A2A_ESCROW_PACKAGE_V7_ID = "0x4249f0b242c47c7baf0c37304365bc4bbe769bcedf11f3525e84682d59a3b23e";
|
|
3338
3339
|
var CLOCK_ID2 = "0x6";
|
|
3339
3340
|
var MODULE = "opening";
|
|
3340
3341
|
var SHA256_HEX_RE = /^(0x)?[0-9a-fA-F]{64}$/;
|
|
@@ -3765,6 +3766,23 @@ function deriveAgentScoreId(agent, boardId) {
|
|
|
3765
3766
|
bcs.bcs.Address.serialize(validateAddress(agent)).toBytes()
|
|
3766
3767
|
);
|
|
3767
3768
|
}
|
|
3769
|
+
async function getDistinctBuyers(client, scoreId) {
|
|
3770
|
+
try {
|
|
3771
|
+
const fieldId = utils.deriveDynamicFieldID(
|
|
3772
|
+
scoreId,
|
|
3773
|
+
`${A2A_ESCROW_PACKAGE_V7_ID}::${MODULE3}::DistinctCountKey`,
|
|
3774
|
+
new Uint8Array([0])
|
|
3775
|
+
);
|
|
3776
|
+
const resp = await client.core.getObject({
|
|
3777
|
+
objectId: fieldId,
|
|
3778
|
+
include: { json: true }
|
|
3779
|
+
});
|
|
3780
|
+
const json = resp?.object?.json;
|
|
3781
|
+
return Number(json?.value ?? 0);
|
|
3782
|
+
} catch {
|
|
3783
|
+
return 0;
|
|
3784
|
+
}
|
|
3785
|
+
}
|
|
3768
3786
|
async function getAgentScore(client, agent, boardId) {
|
|
3769
3787
|
const scoreId = deriveAgentScoreId(agent, boardId);
|
|
3770
3788
|
const resp = await client.core.getObject({ objectId: scoreId, include: { json: true } }).catch(() => null);
|
|
@@ -3780,13 +3798,14 @@ async function getAgentScore(client, agent, boardId) {
|
|
|
3780
3798
|
agent: String(json.agent),
|
|
3781
3799
|
reviewCount,
|
|
3782
3800
|
starsSum,
|
|
3783
|
-
averageStars: reviewCount > 0 ? Math.round(starsSum / reviewCount * 100) / 100 : 0
|
|
3801
|
+
averageStars: reviewCount > 0 ? Math.round(starsSum / reviewCount * 100) / 100 : 0,
|
|
3802
|
+
distinctBuyers: await getDistinctBuyers(client, scoreId)
|
|
3784
3803
|
};
|
|
3785
3804
|
}
|
|
3786
3805
|
function meetsClaimPolicy(score, claimPolicy) {
|
|
3787
3806
|
if (claimPolicy === 0) return true;
|
|
3788
3807
|
if (!score) return false;
|
|
3789
|
-
const proven = score.
|
|
3808
|
+
const proven = score.distinctBuyers >= PROVEN_MIN_REVIEWS;
|
|
3790
3809
|
if (claimPolicy === 1) return proven;
|
|
3791
3810
|
if (claimPolicy === 2) {
|
|
3792
3811
|
return proven && score.starsSum * 10 >= score.reviewCount * PROVEN_MIN_AVG_STARS_X10;
|
|
@@ -3801,10 +3820,10 @@ function claimPolicyLabel(claimPolicy) {
|
|
|
3801
3820
|
}
|
|
3802
3821
|
function claimPolicyRequirement(claimPolicy) {
|
|
3803
3822
|
if (claimPolicy === 1) {
|
|
3804
|
-
return `Claiming needs at least ${PROVEN_MIN_REVIEWS}
|
|
3823
|
+
return `Claiming needs at least ${PROVEN_MIN_REVIEWS} reviews from distinct buyers.`;
|
|
3805
3824
|
}
|
|
3806
3825
|
if (claimPolicy === 2) {
|
|
3807
|
-
return `Claiming needs at least ${PROVEN_MIN_REVIEWS}
|
|
3826
|
+
return `Claiming needs at least ${PROVEN_MIN_REVIEWS} reviews from distinct buyers and a 4.0\u2605 average.`;
|
|
3808
3827
|
}
|
|
3809
3828
|
return "Anyone can claim (active Agent ID required).";
|
|
3810
3829
|
}
|
|
@@ -4549,6 +4568,7 @@ exports.A2A_ESCROW_PACKAGE_ID = A2A_ESCROW_PACKAGE_ID;
|
|
|
4549
4568
|
exports.A2A_ESCROW_PACKAGE_V2_ID = A2A_ESCROW_PACKAGE_V2_ID;
|
|
4550
4569
|
exports.A2A_ESCROW_PACKAGE_V3_ID = A2A_ESCROW_PACKAGE_V3_ID;
|
|
4551
4570
|
exports.A2A_ESCROW_PACKAGE_V6_ID = A2A_ESCROW_PACKAGE_V6_ID;
|
|
4571
|
+
exports.A2A_ESCROW_PACKAGE_V7_ID = A2A_ESCROW_PACKAGE_V7_ID;
|
|
4552
4572
|
exports.A2A_SCORE_BOARD_ID = A2A_SCORE_BOARD_ID;
|
|
4553
4573
|
exports.AUDRIC_PARENT = AUDRIC_PARENT;
|
|
4554
4574
|
exports.AUDRIC_PARENT_NAME = AUDRIC_PARENT_NAME;
|
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 { a8 as T2000Error, bm as T2000Options, af as TransactionSigner, S as PayOptions, bn as X402Probe, T as PayResult, bo as SerializedCetusRoute, bp as SwapResult, bq as SwapQuoteResult, a0 as SendResult, B as BalanceResponse, ae as TransactionRecord, j as DepositInfo, br as PaymentRequest, ap as ZkLoginProof, bs as SuiCoreClient, F as OverlayFeeConfig, bt as SponsoredCoinMergeCache, a6 as SupportedAsset, a7 as SwapRouteResult, bu as SendableAsset } from './commerce-
|
|
5
|
-
export { A as A2A_ESCROW_FEE_CONFIG_ID, bv as A2A_ESCROW_LATEST_PACKAGE_ID, bw as A2A_ESCROW_OPENING_PACKAGE_ID, a as A2A_ESCROW_PACKAGE_ID, bx as A2A_ESCROW_PACKAGE_V2_ID, by as A2A_ESCROW_PACKAGE_V3_ID, bz as A2A_ESCROW_PACKAGE_V6_ID, bA as A2A_SCORE_BOARD_ID, b as ActivityReportConfig, c as AgentScore,
|
|
4
|
+
import { a8 as T2000Error, bm as T2000Options, af as TransactionSigner, S as PayOptions, bn as X402Probe, T as PayResult, bo as SerializedCetusRoute, bp as SwapResult, bq as SwapQuoteResult, a0 as SendResult, B as BalanceResponse, ae as TransactionRecord, j as DepositInfo, br as PaymentRequest, ap as ZkLoginProof, bs as SuiCoreClient, F as OverlayFeeConfig, bt as SponsoredCoinMergeCache, a6 as SupportedAsset, a7 as SwapRouteResult, bu as SendableAsset } from './commerce-CMK0liSg.cjs';
|
|
5
|
+
export { A as A2A_ESCROW_FEE_CONFIG_ID, bv as A2A_ESCROW_LATEST_PACKAGE_ID, bw as A2A_ESCROW_OPENING_PACKAGE_ID, a as A2A_ESCROW_PACKAGE_ID, bx as A2A_ESCROW_PACKAGE_V2_ID, by as A2A_ESCROW_PACKAGE_V3_ID, bz as A2A_ESCROW_PACKAGE_V6_ID, bA as A2A_ESCROW_PACKAGE_V7_ID, bB as A2A_SCORE_BOARD_ID, b as ActivityReportConfig, c as AgentScore, bC as CETUS_USDC_SUI_POOL, C as CLOCK_ID, d as COIN_REGISTRY, e as ClassifyBalanceChange, f as ClassifyResult, g as CoinMeta, bD as CoinPage, D as DEFAULT_ACTIVITY_REPORT_URL, h as DEFAULT_COMMERCE_API_BASE, bE as DEFAULT_GRPC_URL, i as DEFAULT_NETWORK, E as ETH_TYPE, k as ExtractedTransfer, bF as GASLESS_MIN_STABLE_AMOUNT, bG as GASLESS_STABLE_TYPES, G as GAS_RESERVE_MIN, I as IKA_TYPE, J as JOB_STATES, l as Job, m as JobState, n as JobTerms, o as JobVerification, K as KNOWN_TARGETS, p as KeypairSigner, L as LABEL_PATTERNS, q as LOFI_TYPE, bH as MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID, bI as MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID, bJ as MAINNET_A2A_ESCROW_PACKAGE_ID, bK as MAINNET_A2A_SCORE_BOARD_ID, M as MANIFEST_TYPE, r as MAX_DELIVER_HORIZON_MS, s as MAX_JOB_USDC, bL as MAX_OPEN_WINDOW_MS, t as MAX_REVIEW_WINDOW_MS, u as MIN_JOB_USDC, v as MIST_PER_SUI, N as NAVX_TYPE, O as OPENING_CLAIM_POLICIES, w as OPENING_CLAIM_POLICY_ANY_ACTIVE, x as OPENING_CLAIM_POLICY_PROVEN, y as OPENING_CLAIM_POLICY_PROVEN_4STAR, bM as OPERATION_ASSETS, z as OVERLAY_FEE_RATE, bN as Opening, bO as OpeningTerms, bP as Operation, P as PREFLIGHT_MAX_AMOUNT, H as PREFLIGHT_OK, Q as PROVEN_MIN_AVG_STARS_X10, R as PROVEN_MIN_REVIEWS, U as PreflightResult, V as REVIEW_MAX_STARS, W as REVIEW_MIN_STARS, bQ as SENDABLE_ASSETS, X as STABLE_ASSETS, Y as SUI_DECIMALS, Z as SUI_TYPE, _ as SUPPORTED_ASSETS, bR as SelectAndSplitResult, $ as SendAssetClass, bS as SerializedCetusRoutePath, bT as SerializedRouterDataV3, a1 as ServiceListing, a2 as SimulationResult, a3 as StableAsset, a4 as SuiHolding, a5 as SuiRpcTxBlock, a9 as T2000ErrorCode, aa as T2000ErrorData, ab as T2000_OVERLAY_FEE_WALLET, ac as TOKEN_MAP, ad as TransactionLeg, ag as TxDirection, ah as USDC_DECIMALS, ai as USDC_TYPE, aj as USDE_TYPE, ak as USDSUI_TYPE, al as USDT_TYPE, am as WAL_TYPE, an as WBTC_TYPE, ao as X402ActivityPayload, aq as ZkLoginSigner, bU as addSendToTx, bV as addSwapToTx, bW as assertAllowedAsset, bX as assertBuyerRequirements, bY as buildCancelOpeningTx, bZ as buildClaimOpeningTx, ar as buildCreateJobTx, b_ as buildCreateOpeningTx, b$ as buildDeclineJobTx, as as buildDeliverJobTx, at as buildRefundJobTx, c0 as buildRefundUnclaimedTx, au as buildRejectJobTx, av as buildReleaseJobTx, aw as buildSendTx, c1 as buildSubmitFirstReviewTx, c2 as buildSubmitReviewTx, ax as buildSwapTx, ay as checkPositiveAmount, az as checkSuiAddress, aA as claimPolicyLabel, aB as claimPolicyRequirement, aC as classifyAction, aD as classifyLabel, aE as classifySendAsset, aF as classifyTransaction, aG as deriveAgentScoreId, c3 as deserializeCetusRoute, aH as executeTx, aI as extractAllUserLegs, aJ as extractTransferDetails, aK as extractTxCommands, aL as extractTxSender, aM as fallbackLabel, c4 as fetchAllCoins, aN as fetchService, aO as findSwapRoute, aP as formatAssetAmount, aQ as formatSui, aR as formatUsd, aS as getAgentScore, c5 as getCoinMeta, aT as getDecimals, aU as getDecimalsForCoinType, aV as getJob, aW as getJobSpec, c6 as getOpening, c7 as getSuiClient, c8 as getSuiGrpcClient, aX as invalidSendAssetMessage, c9 as isAllowedAsset, ca as isCetusRouteFresh, cb as isInRegistry, aY as jobActionsFor, aZ as listServices, a_ as mapMoveAbortCode, a$ as mapWalletError, b0 as meetsClaimPolicy, b1 as mistToSui, cc as normalizeAsset, cd as normalizeCoinType, b2 as parseSuiRpcTx, b3 as payWithX402, b4 as preflightCreateJob, ce as preflightCreateOpening, b5 as preflightFail, b6 as preflightPay, b7 as preflightSend, b8 as preflightSwap, cf as probeX402, b9 as putJobSpec, cg as queryHistory, ch as queryTransaction, ba as rawToStable, bb as rawToUsdc, bc as refineLendingLabel, bd as reportX402Activity, be as resolveSymbol, bf as resolveTokenType, ci as selectAndSplitCoin, cj as selectSuiCoin, ck as serializeCetusRoute, cl as simulateTransaction, bg as stableToRaw, bh as suiToMist, cm as throwIfSimulationFailed, bi as truncateAddress, bj as usdcToRaw, bk as validateAddress, cn as verifyCetusRouteCoinMatch, bl as verifyJobForSeller } from './commerce-CMK0liSg.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 { a8 as T2000Error, bm as T2000Options, af as TransactionSigner, S as PayOptions, bn as X402Probe, T as PayResult, bo as SerializedCetusRoute, bp as SwapResult, bq as SwapQuoteResult, a0 as SendResult, B as BalanceResponse, ae as TransactionRecord, j as DepositInfo, br as PaymentRequest, ap as ZkLoginProof, bs as SuiCoreClient, F as OverlayFeeConfig, bt as SponsoredCoinMergeCache, a6 as SupportedAsset, a7 as SwapRouteResult, bu as SendableAsset } from './commerce-
|
|
5
|
-
export { A as A2A_ESCROW_FEE_CONFIG_ID, bv as A2A_ESCROW_LATEST_PACKAGE_ID, bw as A2A_ESCROW_OPENING_PACKAGE_ID, a as A2A_ESCROW_PACKAGE_ID, bx as A2A_ESCROW_PACKAGE_V2_ID, by as A2A_ESCROW_PACKAGE_V3_ID, bz as A2A_ESCROW_PACKAGE_V6_ID, bA as A2A_SCORE_BOARD_ID, b as ActivityReportConfig, c as AgentScore,
|
|
4
|
+
import { a8 as T2000Error, bm as T2000Options, af as TransactionSigner, S as PayOptions, bn as X402Probe, T as PayResult, bo as SerializedCetusRoute, bp as SwapResult, bq as SwapQuoteResult, a0 as SendResult, B as BalanceResponse, ae as TransactionRecord, j as DepositInfo, br as PaymentRequest, ap as ZkLoginProof, bs as SuiCoreClient, F as OverlayFeeConfig, bt as SponsoredCoinMergeCache, a6 as SupportedAsset, a7 as SwapRouteResult, bu as SendableAsset } from './commerce-CMK0liSg.js';
|
|
5
|
+
export { A as A2A_ESCROW_FEE_CONFIG_ID, bv as A2A_ESCROW_LATEST_PACKAGE_ID, bw as A2A_ESCROW_OPENING_PACKAGE_ID, a as A2A_ESCROW_PACKAGE_ID, bx as A2A_ESCROW_PACKAGE_V2_ID, by as A2A_ESCROW_PACKAGE_V3_ID, bz as A2A_ESCROW_PACKAGE_V6_ID, bA as A2A_ESCROW_PACKAGE_V7_ID, bB as A2A_SCORE_BOARD_ID, b as ActivityReportConfig, c as AgentScore, bC as CETUS_USDC_SUI_POOL, C as CLOCK_ID, d as COIN_REGISTRY, e as ClassifyBalanceChange, f as ClassifyResult, g as CoinMeta, bD as CoinPage, D as DEFAULT_ACTIVITY_REPORT_URL, h as DEFAULT_COMMERCE_API_BASE, bE as DEFAULT_GRPC_URL, i as DEFAULT_NETWORK, E as ETH_TYPE, k as ExtractedTransfer, bF as GASLESS_MIN_STABLE_AMOUNT, bG as GASLESS_STABLE_TYPES, G as GAS_RESERVE_MIN, I as IKA_TYPE, J as JOB_STATES, l as Job, m as JobState, n as JobTerms, o as JobVerification, K as KNOWN_TARGETS, p as KeypairSigner, L as LABEL_PATTERNS, q as LOFI_TYPE, bH as MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID, bI as MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID, bJ as MAINNET_A2A_ESCROW_PACKAGE_ID, bK as MAINNET_A2A_SCORE_BOARD_ID, M as MANIFEST_TYPE, r as MAX_DELIVER_HORIZON_MS, s as MAX_JOB_USDC, bL as MAX_OPEN_WINDOW_MS, t as MAX_REVIEW_WINDOW_MS, u as MIN_JOB_USDC, v as MIST_PER_SUI, N as NAVX_TYPE, O as OPENING_CLAIM_POLICIES, w as OPENING_CLAIM_POLICY_ANY_ACTIVE, x as OPENING_CLAIM_POLICY_PROVEN, y as OPENING_CLAIM_POLICY_PROVEN_4STAR, bM as OPERATION_ASSETS, z as OVERLAY_FEE_RATE, bN as Opening, bO as OpeningTerms, bP as Operation, P as PREFLIGHT_MAX_AMOUNT, H as PREFLIGHT_OK, Q as PROVEN_MIN_AVG_STARS_X10, R as PROVEN_MIN_REVIEWS, U as PreflightResult, V as REVIEW_MAX_STARS, W as REVIEW_MIN_STARS, bQ as SENDABLE_ASSETS, X as STABLE_ASSETS, Y as SUI_DECIMALS, Z as SUI_TYPE, _ as SUPPORTED_ASSETS, bR as SelectAndSplitResult, $ as SendAssetClass, bS as SerializedCetusRoutePath, bT as SerializedRouterDataV3, a1 as ServiceListing, a2 as SimulationResult, a3 as StableAsset, a4 as SuiHolding, a5 as SuiRpcTxBlock, a9 as T2000ErrorCode, aa as T2000ErrorData, ab as T2000_OVERLAY_FEE_WALLET, ac as TOKEN_MAP, ad as TransactionLeg, ag as TxDirection, ah as USDC_DECIMALS, ai as USDC_TYPE, aj as USDE_TYPE, ak as USDSUI_TYPE, al as USDT_TYPE, am as WAL_TYPE, an as WBTC_TYPE, ao as X402ActivityPayload, aq as ZkLoginSigner, bU as addSendToTx, bV as addSwapToTx, bW as assertAllowedAsset, bX as assertBuyerRequirements, bY as buildCancelOpeningTx, bZ as buildClaimOpeningTx, ar as buildCreateJobTx, b_ as buildCreateOpeningTx, b$ as buildDeclineJobTx, as as buildDeliverJobTx, at as buildRefundJobTx, c0 as buildRefundUnclaimedTx, au as buildRejectJobTx, av as buildReleaseJobTx, aw as buildSendTx, c1 as buildSubmitFirstReviewTx, c2 as buildSubmitReviewTx, ax as buildSwapTx, ay as checkPositiveAmount, az as checkSuiAddress, aA as claimPolicyLabel, aB as claimPolicyRequirement, aC as classifyAction, aD as classifyLabel, aE as classifySendAsset, aF as classifyTransaction, aG as deriveAgentScoreId, c3 as deserializeCetusRoute, aH as executeTx, aI as extractAllUserLegs, aJ as extractTransferDetails, aK as extractTxCommands, aL as extractTxSender, aM as fallbackLabel, c4 as fetchAllCoins, aN as fetchService, aO as findSwapRoute, aP as formatAssetAmount, aQ as formatSui, aR as formatUsd, aS as getAgentScore, c5 as getCoinMeta, aT as getDecimals, aU as getDecimalsForCoinType, aV as getJob, aW as getJobSpec, c6 as getOpening, c7 as getSuiClient, c8 as getSuiGrpcClient, aX as invalidSendAssetMessage, c9 as isAllowedAsset, ca as isCetusRouteFresh, cb as isInRegistry, aY as jobActionsFor, aZ as listServices, a_ as mapMoveAbortCode, a$ as mapWalletError, b0 as meetsClaimPolicy, b1 as mistToSui, cc as normalizeAsset, cd as normalizeCoinType, b2 as parseSuiRpcTx, b3 as payWithX402, b4 as preflightCreateJob, ce as preflightCreateOpening, b5 as preflightFail, b6 as preflightPay, b7 as preflightSend, b8 as preflightSwap, cf as probeX402, b9 as putJobSpec, cg as queryHistory, ch as queryTransaction, ba as rawToStable, bb as rawToUsdc, bc as refineLendingLabel, bd as reportX402Activity, be as resolveSymbol, bf as resolveTokenType, ci as selectAndSplitCoin, cj as selectSuiCoin, ck as serializeCetusRoute, cl as simulateTransaction, bg as stableToRaw, bh as suiToMist, cm as throwIfSimulationFailed, bi as truncateAddress, bj as usdcToRaw, bk as validateAddress, cn as verifyCetusRouteCoinMatch, bl as verifyJobForSeller } from './commerce-CMK0liSg.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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { normalizeStructTag, isValidSuiAddress, normalizeSuiAddress, fromBase64, deriveObjectID } from '@mysten/sui/utils';
|
|
1
|
+
import { normalizeStructTag, isValidSuiAddress, normalizeSuiAddress, fromBase64, deriveObjectID, deriveDynamicFieldID } from '@mysten/sui/utils';
|
|
2
2
|
import { coinWithBalance, Transaction } from '@mysten/sui/transactions';
|
|
3
3
|
import { AggregatorClient, Env } from '@cetusprotocol/aggregator-sdk';
|
|
4
4
|
import BN from 'bn.js';
|
|
@@ -3322,13 +3322,14 @@ init_coinSelection();
|
|
|
3322
3322
|
init_errors();
|
|
3323
3323
|
init_token_registry();
|
|
3324
3324
|
init_coinSelection();
|
|
3325
|
-
var MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID = "
|
|
3325
|
+
var MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID = "0x4249f0b242c47c7baf0c37304365bc4bbe769bcedf11f3525e84682d59a3b23e";
|
|
3326
3326
|
var MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID = MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID;
|
|
3327
3327
|
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;
|
|
3328
3328
|
var A2A_ESCROW_OPENING_PACKAGE_ID = A2A_ESCROW_LATEST_PACKAGE_ID;
|
|
3329
3329
|
var A2A_ESCROW_PACKAGE_V2_ID = "0x860288d789dc617f6474a0a6801d6011e53bf30d5fb801cdad47b9bc6adb098b";
|
|
3330
3330
|
var A2A_ESCROW_PACKAGE_V3_ID = "0x69ad93c555519de520a5c7f7f2963ad6f8b91cefc098fc2eed75942dcb5bcbe7";
|
|
3331
3331
|
var A2A_ESCROW_PACKAGE_V6_ID = "0xb065033b6f72c4899055a0b3afac28f09dc7b0b7b491eada793157de20000618";
|
|
3332
|
+
var A2A_ESCROW_PACKAGE_V7_ID = "0x4249f0b242c47c7baf0c37304365bc4bbe769bcedf11f3525e84682d59a3b23e";
|
|
3332
3333
|
var CLOCK_ID2 = "0x6";
|
|
3333
3334
|
var MODULE = "opening";
|
|
3334
3335
|
var SHA256_HEX_RE = /^(0x)?[0-9a-fA-F]{64}$/;
|
|
@@ -3759,6 +3760,23 @@ function deriveAgentScoreId(agent, boardId) {
|
|
|
3759
3760
|
bcs.Address.serialize(validateAddress(agent)).toBytes()
|
|
3760
3761
|
);
|
|
3761
3762
|
}
|
|
3763
|
+
async function getDistinctBuyers(client, scoreId) {
|
|
3764
|
+
try {
|
|
3765
|
+
const fieldId = deriveDynamicFieldID(
|
|
3766
|
+
scoreId,
|
|
3767
|
+
`${A2A_ESCROW_PACKAGE_V7_ID}::${MODULE3}::DistinctCountKey`,
|
|
3768
|
+
new Uint8Array([0])
|
|
3769
|
+
);
|
|
3770
|
+
const resp = await client.core.getObject({
|
|
3771
|
+
objectId: fieldId,
|
|
3772
|
+
include: { json: true }
|
|
3773
|
+
});
|
|
3774
|
+
const json = resp?.object?.json;
|
|
3775
|
+
return Number(json?.value ?? 0);
|
|
3776
|
+
} catch {
|
|
3777
|
+
return 0;
|
|
3778
|
+
}
|
|
3779
|
+
}
|
|
3762
3780
|
async function getAgentScore(client, agent, boardId) {
|
|
3763
3781
|
const scoreId = deriveAgentScoreId(agent, boardId);
|
|
3764
3782
|
const resp = await client.core.getObject({ objectId: scoreId, include: { json: true } }).catch(() => null);
|
|
@@ -3774,13 +3792,14 @@ async function getAgentScore(client, agent, boardId) {
|
|
|
3774
3792
|
agent: String(json.agent),
|
|
3775
3793
|
reviewCount,
|
|
3776
3794
|
starsSum,
|
|
3777
|
-
averageStars: reviewCount > 0 ? Math.round(starsSum / reviewCount * 100) / 100 : 0
|
|
3795
|
+
averageStars: reviewCount > 0 ? Math.round(starsSum / reviewCount * 100) / 100 : 0,
|
|
3796
|
+
distinctBuyers: await getDistinctBuyers(client, scoreId)
|
|
3778
3797
|
};
|
|
3779
3798
|
}
|
|
3780
3799
|
function meetsClaimPolicy(score, claimPolicy) {
|
|
3781
3800
|
if (claimPolicy === 0) return true;
|
|
3782
3801
|
if (!score) return false;
|
|
3783
|
-
const proven = score.
|
|
3802
|
+
const proven = score.distinctBuyers >= PROVEN_MIN_REVIEWS;
|
|
3784
3803
|
if (claimPolicy === 1) return proven;
|
|
3785
3804
|
if (claimPolicy === 2) {
|
|
3786
3805
|
return proven && score.starsSum * 10 >= score.reviewCount * PROVEN_MIN_AVG_STARS_X10;
|
|
@@ -3795,10 +3814,10 @@ function claimPolicyLabel(claimPolicy) {
|
|
|
3795
3814
|
}
|
|
3796
3815
|
function claimPolicyRequirement(claimPolicy) {
|
|
3797
3816
|
if (claimPolicy === 1) {
|
|
3798
|
-
return `Claiming needs at least ${PROVEN_MIN_REVIEWS}
|
|
3817
|
+
return `Claiming needs at least ${PROVEN_MIN_REVIEWS} reviews from distinct buyers.`;
|
|
3799
3818
|
}
|
|
3800
3819
|
if (claimPolicy === 2) {
|
|
3801
|
-
return `Claiming needs at least ${PROVEN_MIN_REVIEWS}
|
|
3820
|
+
return `Claiming needs at least ${PROVEN_MIN_REVIEWS} reviews from distinct buyers and a 4.0\u2605 average.`;
|
|
3802
3821
|
}
|
|
3803
3822
|
return "Anyone can claim (active Agent ID required).";
|
|
3804
3823
|
}
|
|
@@ -4536,4 +4555,4 @@ function displayHandle(label, parentName = AUDRIC_PARENT_NAME) {
|
|
|
4536
4555
|
// src/index.ts
|
|
4537
4556
|
init_preflight();
|
|
4538
4557
|
|
|
4539
|
-
export { A2A_ESCROW_FEE_CONFIG_ID, A2A_ESCROW_LATEST_PACKAGE_ID, A2A_ESCROW_OPENING_PACKAGE_ID, A2A_ESCROW_PACKAGE_ID, A2A_ESCROW_PACKAGE_V2_ID, A2A_ESCROW_PACKAGE_V3_ID, A2A_ESCROW_PACKAGE_V6_ID, A2A_SCORE_BOARD_ID, AUDRIC_PARENT, AUDRIC_PARENT_NAME, AUDRIC_PARENT_NFT_ID, CETUS_USDC_SUI_POOL, CLOCK_ID, COIN_REGISTRY, 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, 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_DELIVER_HORIZON_MS, MAX_JOB_USDC, MAX_OPEN_WINDOW_MS, MAX_REVIEW_WINDOW_MS, MIN_JOB_USDC, MIST_PER_SUI, NAVX_TYPE, 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, SENDABLE_ASSETS, 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, addSendToTx, addSwapToTx, approxUsdValue, assertAllowedAsset, assertBuyerRequirements, assertLimitConfig, buildAddLeafTx, buildCancelOpeningTx, buildClaimOpeningTx, buildCreateJobTx, buildCreateOpeningTx, buildDeclineJobTx, buildDeliverJobTx, buildRefundJobTx, buildRefundUnclaimedTx, buildRejectJobTx, buildReleaseJobTx, buildRevokeLeafTx, buildSendTx, buildSubmitFirstReviewTx, buildSubmitReviewTx, buildSwapTx, cancelOpenJob, canonicalizeRecipientInput, chatCompletion, chatCompletionStream, checkPositiveAmount, checkSuiAddress, claimOpenJob, claimPolicyLabel, claimPolicyRequirement, classifyAction, classifyLabel, classifySendAsset, classifyTransaction, clearLimits, composeTx, customHireEnvelope, dailySpentToday, deriveAgentScoreId, deriveAllowedAddressesFromPtb, deserializeCetusRoute, displayHandle, executeTx, exportPrivateKey, extractAllUserLegs, extractTransferDetails, extractTxCommands, extractTxSender, fallbackLabel, fetchAllCoins, fetchService, findSwapRoute, formatAssetAmount, formatSui, formatUsd, fullHandle, generateKeypair, getAddress, getAgentScore, getCoinMeta, getDecimals, getDecimalsForCoinType, getJob, getJobSpec, getLimits, getOpenJob, getOpening, getSponsoredSwapProviders, getSuiClient, getSuiGrpcClient, getSwapQuote, hasLimits, invalidSendAssetMessage, isAllowedAsset, isCetusRouteFresh, isCustomHireEnvelope, isInRegistry, jobActionsFor, keypairFromPrivateKey, listModels, listOpenJobs, listServices, loadKey, looksLikeSuiNs, mapMoveAbortCode, mapWalletError, meetsClaimPolicy, mistToSui, normalizeAddressInput, normalizeAsset, normalizeCoinType, parseSuiRpcTx, payWithX402, postOpenJob, preflightCreateJob, preflightCreateOpening, preflightFail, preflightPay, preflightSend, preflightSwap, probeX402, putJobSpec, queryBalance, queryHistory, queryTransaction, rawToStable, rawToUsdc, readLimitsFile, recordDailySpend, refineLendingLabel, refundOpenJob, reportX402Activity, resolveAddressToSuinsViaRpc, resolveCreatedObjectId, resolveSuinsViaRpc, resolveSymbol, resolveTokenType, saveBech32, saveKey, selectAndSplitCoin, selectSuiCoin, serializeCetusRoute, setLimits, setSponsoredTxGuard, simulateTransaction, stableToRaw, submitJobReview, suiToMist, throwIfSimulationFailed, truncateAddress, usdcToRaw, validateAddress, validateLabel, verifyCetusRouteCoinMatch, verifyJobForSeller, verifyReceipt, walletExists, writeLimitsFile };
|
|
4558
|
+
export { A2A_ESCROW_FEE_CONFIG_ID, A2A_ESCROW_LATEST_PACKAGE_ID, A2A_ESCROW_OPENING_PACKAGE_ID, A2A_ESCROW_PACKAGE_ID, A2A_ESCROW_PACKAGE_V2_ID, A2A_ESCROW_PACKAGE_V3_ID, A2A_ESCROW_PACKAGE_V6_ID, A2A_ESCROW_PACKAGE_V7_ID, A2A_SCORE_BOARD_ID, AUDRIC_PARENT, AUDRIC_PARENT_NAME, AUDRIC_PARENT_NFT_ID, CETUS_USDC_SUI_POOL, CLOCK_ID, COIN_REGISTRY, 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, 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_DELIVER_HORIZON_MS, MAX_JOB_USDC, MAX_OPEN_WINDOW_MS, MAX_REVIEW_WINDOW_MS, MIN_JOB_USDC, MIST_PER_SUI, NAVX_TYPE, 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, SENDABLE_ASSETS, 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, addSendToTx, addSwapToTx, approxUsdValue, assertAllowedAsset, assertBuyerRequirements, assertLimitConfig, buildAddLeafTx, buildCancelOpeningTx, buildClaimOpeningTx, buildCreateJobTx, buildCreateOpeningTx, buildDeclineJobTx, buildDeliverJobTx, buildRefundJobTx, buildRefundUnclaimedTx, buildRejectJobTx, buildReleaseJobTx, buildRevokeLeafTx, buildSendTx, buildSubmitFirstReviewTx, buildSubmitReviewTx, buildSwapTx, cancelOpenJob, canonicalizeRecipientInput, chatCompletion, chatCompletionStream, checkPositiveAmount, checkSuiAddress, claimOpenJob, claimPolicyLabel, claimPolicyRequirement, classifyAction, classifyLabel, classifySendAsset, classifyTransaction, clearLimits, composeTx, customHireEnvelope, dailySpentToday, deriveAgentScoreId, deriveAllowedAddressesFromPtb, deserializeCetusRoute, displayHandle, executeTx, exportPrivateKey, extractAllUserLegs, extractTransferDetails, extractTxCommands, extractTxSender, fallbackLabel, fetchAllCoins, fetchService, findSwapRoute, formatAssetAmount, formatSui, formatUsd, fullHandle, generateKeypair, getAddress, getAgentScore, getCoinMeta, getDecimals, getDecimalsForCoinType, getJob, getJobSpec, getLimits, getOpenJob, getOpening, getSponsoredSwapProviders, getSuiClient, getSuiGrpcClient, getSwapQuote, hasLimits, invalidSendAssetMessage, isAllowedAsset, isCetusRouteFresh, isCustomHireEnvelope, isInRegistry, jobActionsFor, keypairFromPrivateKey, listModels, listOpenJobs, listServices, loadKey, looksLikeSuiNs, mapMoveAbortCode, mapWalletError, meetsClaimPolicy, mistToSui, normalizeAddressInput, normalizeAsset, normalizeCoinType, parseSuiRpcTx, payWithX402, postOpenJob, preflightCreateJob, preflightCreateOpening, preflightFail, preflightPay, preflightSend, preflightSwap, probeX402, putJobSpec, queryBalance, queryHistory, queryTransaction, rawToStable, rawToUsdc, readLimitsFile, recordDailySpend, refineLendingLabel, refundOpenJob, reportX402Activity, resolveAddressToSuinsViaRpc, resolveCreatedObjectId, resolveSuinsViaRpc, resolveSymbol, resolveTokenType, saveBech32, saveKey, selectAndSplitCoin, selectSuiCoin, serializeCetusRoute, setLimits, setSponsoredTxGuard, simulateTransaction, stableToRaw, submitJobReview, suiToMist, throwIfSimulationFailed, truncateAddress, usdcToRaw, validateAddress, validateLabel, verifyCetusRouteCoinMatch, verifyJobForSeller, verifyReceipt, walletExists, writeLimitsFile };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@t2000/sdk",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.34.0",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=20"
|
|
6
6
|
},
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@phala/dcap-qvl": "^0.5.2",
|
|
56
56
|
"bn.js": "^5.2.1",
|
|
57
57
|
"eventemitter3": "^5",
|
|
58
|
-
"@t2000/sui-x402": "10.
|
|
58
|
+
"@t2000/sui-x402": "10.34.0"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@types/bn.js": "^5.1.5",
|