@t2000/sdk 10.37.1 → 10.38.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 +81 -17
- package/dist/browser.d.cts +1 -1
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +72 -18
- package/dist/{commerce-C0B4y1uP.d.cts → commerce-D14qzqAV.d.cts} +104 -20
- package/dist/{commerce-C0B4y1uP.d.ts → commerce-D14qzqAV.d.ts} +104 -20
- package/dist/index.cjs +125 -26
- package/dist/index.d.cts +8 -2
- package/dist/index.d.ts +8 -2
- package/dist/index.js +115 -27
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -2986,7 +2986,7 @@ init_coinSelection();
|
|
|
2986
2986
|
init_errors();
|
|
2987
2987
|
init_token_registry();
|
|
2988
2988
|
init_coinSelection();
|
|
2989
|
-
var MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID = "
|
|
2989
|
+
var MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID = "0x5c90ec07da01bf885a4e65247ce98b75ab8a042cd965d30d7213856d579c4afa";
|
|
2990
2990
|
var MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID = MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID;
|
|
2991
2991
|
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;
|
|
2992
2992
|
var A2A_ESCROW_OPENING_PACKAGE_ID = A2A_ESCROW_LATEST_PACKAGE_ID;
|
|
@@ -2995,6 +2995,7 @@ var A2A_ESCROW_PACKAGE_V3_ID = "0x69ad93c555519de520a5c7f7f2963ad6f8b91cefc098fc
|
|
|
2995
2995
|
var A2A_ESCROW_PACKAGE_V6_ID = "0xb065033b6f72c4899055a0b3afac28f09dc7b0b7b491eada793157de20000618";
|
|
2996
2996
|
var A2A_ESCROW_PACKAGE_V7_ID = "0x4249f0b242c47c7baf0c37304365bc4bbe769bcedf11f3525e84682d59a3b23e";
|
|
2997
2997
|
var A2A_ESCROW_PACKAGE_V8_ID = "0x1595b80bc05a03607f3908702c866ca63cf961025b4263b5ecbe419e07f8ff31";
|
|
2998
|
+
var A2A_ESCROW_PACKAGE_V10_ID = process.env.A2A_ESCROW_PACKAGE_V10_ID ?? "0x5c90ec07da01bf885a4e65247ce98b75ab8a042cd965d30d7213856d579c4afa";
|
|
2998
2999
|
var CLOCK_ID2 = "0x6";
|
|
2999
3000
|
var MODULE = "opening";
|
|
3000
3001
|
var SHA256_HEX_RE = /^(0x)?[0-9a-fA-F]{64}$/;
|
|
@@ -3069,6 +3070,14 @@ function preflightCreateOpening(terms) {
|
|
|
3069
3070
|
error: "claimPolicy must be 0 (Anyone), 1 (Proven) or 2 (Proven \xB7 4\u2605+) \u2014 anything else aborts on-chain."
|
|
3070
3071
|
};
|
|
3071
3072
|
}
|
|
3073
|
+
const minLevel = terms.minSellerLevel ?? 0;
|
|
3074
|
+
if (!Number.isInteger(minLevel) || minLevel < 0 || minLevel > 4) {
|
|
3075
|
+
return {
|
|
3076
|
+
valid: false,
|
|
3077
|
+
code: "INVALID_INPUT",
|
|
3078
|
+
error: "minSellerLevel must be 0 (no floor) or 1\u20134 (Level 1\u20134) \u2014 anything else aborts on-chain (S.1192)."
|
|
3079
|
+
};
|
|
3080
|
+
}
|
|
3072
3081
|
return { valid: true };
|
|
3073
3082
|
}
|
|
3074
3083
|
async function buildCreateOpeningTx({
|
|
@@ -3084,7 +3093,9 @@ async function buildCreateOpeningTx({
|
|
|
3084
3093
|
allowSwapAll: false
|
|
3085
3094
|
});
|
|
3086
3095
|
tx.moveCall({
|
|
3087
|
-
|
|
3096
|
+
// S.1192: create_open is a dead abort stub after the v10 migrate —
|
|
3097
|
+
// every post rides v2 (adds the min_seller_level DF write).
|
|
3098
|
+
target: `${A2A_ESCROW_OPENING_PACKAGE_ID}::${MODULE}::create_open_v2`,
|
|
3088
3099
|
typeArguments: [exports.USDC_TYPE],
|
|
3089
3100
|
arguments: [
|
|
3090
3101
|
coin,
|
|
@@ -3094,6 +3105,7 @@ async function buildCreateOpeningTx({
|
|
|
3094
3105
|
tx.pure.u64(terms.reviewWindowMs),
|
|
3095
3106
|
tx.pure.u64(terms.rejectSplitBps),
|
|
3096
3107
|
tx.pure.u8(terms.claimPolicy ?? OPENING_CLAIM_POLICY_ANY_ACTIVE),
|
|
3108
|
+
tx.pure.u8(terms.minSellerLevel ?? 0),
|
|
3097
3109
|
feeConfigArg(tx),
|
|
3098
3110
|
tx.object(CLOCK_ID2)
|
|
3099
3111
|
]
|
|
@@ -3103,23 +3115,26 @@ async function buildCreateOpeningTx({
|
|
|
3103
3115
|
function buildClaimOpeningTx({
|
|
3104
3116
|
openingId,
|
|
3105
3117
|
registryId,
|
|
3106
|
-
scoreId
|
|
3118
|
+
scoreId,
|
|
3119
|
+
claimPolicy = OPENING_CLAIM_POLICY_ANY_ACTIVE
|
|
3107
3120
|
}) {
|
|
3121
|
+
if (!scoreId) {
|
|
3122
|
+
throw new exports.T2000Error(
|
|
3123
|
+
"INVALID_INPUT",
|
|
3124
|
+
"Claiming needs the claimer's own AgentScore id (S.1192 \u2014 every claim moves the active-job counter). Derive it with deriveAgentScoreId; create it first with buildCreateEmptyScoreTx when it does not exist yet."
|
|
3125
|
+
);
|
|
3126
|
+
}
|
|
3127
|
+
const proven = claimPolicy !== OPENING_CLAIM_POLICY_ANY_ACTIVE;
|
|
3108
3128
|
const tx = new transactions.Transaction();
|
|
3109
3129
|
tx.moveCall({
|
|
3110
|
-
target: `${A2A_ESCROW_OPENING_PACKAGE_ID}::${MODULE}::${
|
|
3130
|
+
target: `${A2A_ESCROW_OPENING_PACKAGE_ID}::${MODULE}::${proven ? "claim_proven_v2" : "claim_v2"}`,
|
|
3111
3131
|
typeArguments: [exports.USDC_TYPE],
|
|
3112
|
-
arguments:
|
|
3132
|
+
arguments: [
|
|
3113
3133
|
tx.object(openingId),
|
|
3114
3134
|
tx.object(registryId),
|
|
3115
3135
|
tx.object(scoreId),
|
|
3116
3136
|
feeConfigArg(tx),
|
|
3117
3137
|
tx.object(CLOCK_ID2)
|
|
3118
|
-
] : [
|
|
3119
|
-
tx.object(openingId),
|
|
3120
|
-
tx.object(registryId),
|
|
3121
|
-
feeConfigArg(tx),
|
|
3122
|
-
tx.object(CLOCK_ID2)
|
|
3123
3138
|
]
|
|
3124
3139
|
});
|
|
3125
3140
|
return tx;
|
|
@@ -3139,6 +3154,24 @@ function buildCancelOpeningTx(openingId) {
|
|
|
3139
3154
|
function buildRefundUnclaimedTx(openingId) {
|
|
3140
3155
|
return openingCall(openingId, "refund_unclaimed");
|
|
3141
3156
|
}
|
|
3157
|
+
async function readMinSellerLevelDf(client, openingId) {
|
|
3158
|
+
if (!A2A_ESCROW_PACKAGE_V10_ID) return 0;
|
|
3159
|
+
try {
|
|
3160
|
+
const fieldId = utils.deriveDynamicFieldID(
|
|
3161
|
+
openingId,
|
|
3162
|
+
`${A2A_ESCROW_PACKAGE_V10_ID}::${MODULE}::MinSellerLevelKey`,
|
|
3163
|
+
new Uint8Array([0])
|
|
3164
|
+
);
|
|
3165
|
+
const resp = await client.core.getObject({
|
|
3166
|
+
objectId: fieldId,
|
|
3167
|
+
include: { json: true }
|
|
3168
|
+
});
|
|
3169
|
+
const json = resp?.object?.json;
|
|
3170
|
+
return Number(json?.value ?? 0);
|
|
3171
|
+
} catch {
|
|
3172
|
+
return 0;
|
|
3173
|
+
}
|
|
3174
|
+
}
|
|
3142
3175
|
function bytesToHex(bytes) {
|
|
3143
3176
|
return `0x${Array.from(bytes).map((b) => b.toString(16).padStart(2, "0")).join("")}`;
|
|
3144
3177
|
}
|
|
@@ -3149,6 +3182,7 @@ async function getOpening(client, openingId) {
|
|
|
3149
3182
|
if (!json || !objType.includes(`::${MODULE}::Opening<`)) {
|
|
3150
3183
|
return null;
|
|
3151
3184
|
}
|
|
3185
|
+
const minSellerLevel = await readMinSellerLevelDf(client, openingId);
|
|
3152
3186
|
return {
|
|
3153
3187
|
id: openingId,
|
|
3154
3188
|
buyer: String(json.buyer),
|
|
@@ -3160,6 +3194,7 @@ async function getOpening(client, openingId) {
|
|
|
3160
3194
|
reviewWindowMs: Number(json.review_window_ms),
|
|
3161
3195
|
rejectSplitBps: Number(json.reject_split_bps),
|
|
3162
3196
|
claimPolicy: Number(json.claim_policy ?? 0),
|
|
3197
|
+
minSellerLevel,
|
|
3163
3198
|
createdAtMs: Number(json.created_at_ms ?? 0)
|
|
3164
3199
|
};
|
|
3165
3200
|
}
|
|
@@ -3180,7 +3215,7 @@ function feeConfigArg2(tx) {
|
|
|
3180
3215
|
mutable: false
|
|
3181
3216
|
});
|
|
3182
3217
|
}
|
|
3183
|
-
var MAX_JOB_USDC =
|
|
3218
|
+
var MAX_JOB_USDC = 100;
|
|
3184
3219
|
var MIN_JOB_USDC = 0.01;
|
|
3185
3220
|
var MAX_REVIEW_WINDOW_MS = 2592e6;
|
|
3186
3221
|
var MAX_DELIVER_HORIZON_MS = 31536e6;
|
|
@@ -3226,7 +3261,7 @@ function preflightCreateJob(terms) {
|
|
|
3226
3261
|
if (terms.amountUsdc > MAX_JOB_USDC) {
|
|
3227
3262
|
return preflightFail(
|
|
3228
3263
|
"INVALID_AMOUNT",
|
|
3229
|
-
`
|
|
3264
|
+
`Escrow jobs cap at ${MAX_JOB_USDC} USDC (the no-arbitration split is the only dispute model \u2014 the cap keeps stakes where that stays fair). Got ${terms.amountUsdc}. Larger engagements: split into milestone jobs.`
|
|
3230
3265
|
);
|
|
3231
3266
|
}
|
|
3232
3267
|
if (terms.deliverByMs <= Date.now()) {
|
|
@@ -3289,15 +3324,6 @@ function buildDeclineJobTx(jobId) {
|
|
|
3289
3324
|
});
|
|
3290
3325
|
return tx;
|
|
3291
3326
|
}
|
|
3292
|
-
function jobCall(jobId, fn) {
|
|
3293
|
-
const tx = new transactions.Transaction();
|
|
3294
|
-
tx.moveCall({
|
|
3295
|
-
target: `${A2A_ESCROW_LATEST_PACKAGE_ID}::${MODULE2}::${fn}`,
|
|
3296
|
-
typeArguments: [exports.USDC_TYPE],
|
|
3297
|
-
arguments: [tx.object(jobId), feeConfigArg2(tx), tx.object(CLOCK_ID3)]
|
|
3298
|
-
});
|
|
3299
|
-
return tx;
|
|
3300
|
-
}
|
|
3301
3327
|
function buildRejectJobTx(jobId, v2) {
|
|
3302
3328
|
const tx = new transactions.Transaction();
|
|
3303
3329
|
tx.moveCall({
|
|
@@ -3348,8 +3374,19 @@ function buildDeliverJobTx(jobId, deliveryHash) {
|
|
|
3348
3374
|
});
|
|
3349
3375
|
return tx;
|
|
3350
3376
|
}
|
|
3351
|
-
function buildReleaseJobTx(jobId) {
|
|
3352
|
-
|
|
3377
|
+
function buildReleaseJobTx(jobId, v2) {
|
|
3378
|
+
const tx = new transactions.Transaction();
|
|
3379
|
+
tx.moveCall({
|
|
3380
|
+
target: `${A2A_ESCROW_LATEST_PACKAGE_ID}::reputation::release_v2`,
|
|
3381
|
+
typeArguments: [exports.USDC_TYPE],
|
|
3382
|
+
arguments: [
|
|
3383
|
+
tx.object(jobId),
|
|
3384
|
+
tx.object(v2.sellerScoreId),
|
|
3385
|
+
feeConfigArg2(tx),
|
|
3386
|
+
tx.object(CLOCK_ID3)
|
|
3387
|
+
]
|
|
3388
|
+
});
|
|
3389
|
+
return tx;
|
|
3353
3390
|
}
|
|
3354
3391
|
async function getJob(client, jobId) {
|
|
3355
3392
|
const resp = await client.core.getObject({ objectId: jobId, include: { json: true } }).catch((e) => {
|
|
@@ -3438,6 +3475,10 @@ var PROVEN_MIN_REVIEWS = 3;
|
|
|
3438
3475
|
var PROVEN_MIN_AVG_STARS_X10 = 40;
|
|
3439
3476
|
var REVIEW_MIN_STARS = 1;
|
|
3440
3477
|
var REVIEW_MAX_STARS = 5;
|
|
3478
|
+
var SELLER_LEVEL_ACTIVE_CAPS = [4, 10, 20, 30];
|
|
3479
|
+
var NO_DELIVERY_REGRESSION_FLOOR = 3;
|
|
3480
|
+
var LEVEL4_MIN_REVIEWS = 20;
|
|
3481
|
+
var LEVEL4_MAX_NO_DELIVERY = 2;
|
|
3441
3482
|
function boardIdOrThrow(boardId) {
|
|
3442
3483
|
const id = boardId ?? A2A_SCORE_BOARD_ID;
|
|
3443
3484
|
if (!id) {
|
|
@@ -3483,11 +3524,12 @@ async function getAgentScore(client, agent, boardId) {
|
|
|
3483
3524
|
}
|
|
3484
3525
|
const reviewCount = Number(json.review_count ?? 0);
|
|
3485
3526
|
const starsSum = Number(json.stars_sum ?? 0);
|
|
3486
|
-
const [distinctBuyers, rejectedAfterDelivery, noDelivery, asBuyerRejected] = await Promise.all([
|
|
3527
|
+
const [distinctBuyers, rejectedAfterDelivery, noDelivery, asBuyerRejected, activeSellerJobs] = await Promise.all([
|
|
3487
3528
|
readCounterDf(client, scoreId, A2A_ESCROW_PACKAGE_V7_ID, "DistinctCountKey"),
|
|
3488
3529
|
readCounterDf(client, scoreId, A2A_ESCROW_PACKAGE_V8_ID, "RejectedAfterDeliveryKey"),
|
|
3489
3530
|
readCounterDf(client, scoreId, A2A_ESCROW_PACKAGE_V8_ID, "NoDeliveryKey"),
|
|
3490
|
-
readCounterDf(client, scoreId, A2A_ESCROW_PACKAGE_V8_ID, "AsBuyerRejectedKey")
|
|
3531
|
+
readCounterDf(client, scoreId, A2A_ESCROW_PACKAGE_V8_ID, "AsBuyerRejectedKey"),
|
|
3532
|
+
readCounterDf(client, scoreId, A2A_ESCROW_PACKAGE_V10_ID, "ActiveSellerJobsKey")
|
|
3491
3533
|
]);
|
|
3492
3534
|
return {
|
|
3493
3535
|
id: scoreId,
|
|
@@ -3498,7 +3540,8 @@ async function getAgentScore(client, agent, boardId) {
|
|
|
3498
3540
|
distinctBuyers,
|
|
3499
3541
|
rejectedAfterDelivery,
|
|
3500
3542
|
noDelivery,
|
|
3501
|
-
asBuyerRejected
|
|
3543
|
+
asBuyerRejected,
|
|
3544
|
+
activeSellerJobs
|
|
3502
3545
|
};
|
|
3503
3546
|
}
|
|
3504
3547
|
function buildCreateEmptyScoreTx({
|
|
@@ -3543,6 +3586,51 @@ function claimPolicyRequirement(claimPolicy) {
|
|
|
3543
3586
|
}
|
|
3544
3587
|
return "Anyone can claim (active Agent ID required).";
|
|
3545
3588
|
}
|
|
3589
|
+
function sellerLevel(score) {
|
|
3590
|
+
if (!score) return 1;
|
|
3591
|
+
const provenAvg = score.distinctBuyers >= PROVEN_MIN_REVIEWS && score.starsSum * 10 >= score.reviewCount * PROVEN_MIN_AVG_STARS_X10;
|
|
3592
|
+
if (provenAvg) {
|
|
3593
|
+
return score.reviewCount >= LEVEL4_MIN_REVIEWS && score.noDelivery <= LEVEL4_MAX_NO_DELIVERY ? 4 : 3;
|
|
3594
|
+
}
|
|
3595
|
+
return score.distinctBuyers >= PROVEN_MIN_REVIEWS ? 2 : 1;
|
|
3596
|
+
}
|
|
3597
|
+
function effectiveSellerLevel(score) {
|
|
3598
|
+
if (!score) return 1;
|
|
3599
|
+
if (score.noDelivery >= NO_DELIVERY_REGRESSION_FLOOR) return 1;
|
|
3600
|
+
return sellerLevel(score);
|
|
3601
|
+
}
|
|
3602
|
+
function activeCapForLevel(level) {
|
|
3603
|
+
return SELLER_LEVEL_ACTIVE_CAPS[level - 1];
|
|
3604
|
+
}
|
|
3605
|
+
function meetsMinSellerLevel(score, minLevel) {
|
|
3606
|
+
if (minLevel <= 0) return true;
|
|
3607
|
+
return effectiveSellerLevel(score) >= minLevel;
|
|
3608
|
+
}
|
|
3609
|
+
function sellerLevelLabel(level) {
|
|
3610
|
+
return level >= 1 && level <= 4 ? `Level ${level}` : `Level ? (${level})`;
|
|
3611
|
+
}
|
|
3612
|
+
function preflightClaimOpening(score, opening) {
|
|
3613
|
+
if (!meetsClaimPolicy(score, opening.claimPolicy)) {
|
|
3614
|
+
return { valid: false, error: claimPolicyRequirement(opening.claimPolicy) };
|
|
3615
|
+
}
|
|
3616
|
+
const level = effectiveSellerLevel(score);
|
|
3617
|
+
const cap = activeCapForLevel(level);
|
|
3618
|
+
const active = score?.activeSellerJobs ?? 0;
|
|
3619
|
+
if (active >= cap) {
|
|
3620
|
+
return {
|
|
3621
|
+
valid: false,
|
|
3622
|
+
error: `Active: ${active}/${cap} \u2014 ${sellerLevelLabel(level)} caps in-flight claimed jobs at ${cap}. Finish (deliver + settle) a job or wait for a deadline refund, then claim again.`
|
|
3623
|
+
};
|
|
3624
|
+
}
|
|
3625
|
+
const minLevel = opening.minSellerLevel ?? 0;
|
|
3626
|
+
if (!meetsMinSellerLevel(score, minLevel)) {
|
|
3627
|
+
return {
|
|
3628
|
+
valid: false,
|
|
3629
|
+
error: `This opening needs ${sellerLevelLabel(minLevel)}+ \u2014 this wallet is ${sellerLevelLabel(level)}. Level 2 = reviews from ${PROVEN_MIN_REVIEWS}+ distinct buyers; Level 3 adds a 4.0\u2605 average; reliability (no-shows) can regress a level. Earn it on openings without a floor first.`
|
|
3630
|
+
};
|
|
3631
|
+
}
|
|
3632
|
+
return { valid: true };
|
|
3633
|
+
}
|
|
3546
3634
|
function assertStars(stars) {
|
|
3547
3635
|
if (!Number.isInteger(stars) || stars < REVIEW_MIN_STARS || stars > REVIEW_MAX_STARS) {
|
|
3548
3636
|
throw new exports.T2000Error("INVALID_INPUT", "Stars must be an integer 1-5.");
|
|
@@ -4809,6 +4897,7 @@ exports.A2A_ESCROW_FEE_CONFIG_ID = A2A_ESCROW_FEE_CONFIG_ID;
|
|
|
4809
4897
|
exports.A2A_ESCROW_LATEST_PACKAGE_ID = A2A_ESCROW_LATEST_PACKAGE_ID;
|
|
4810
4898
|
exports.A2A_ESCROW_OPENING_PACKAGE_ID = A2A_ESCROW_OPENING_PACKAGE_ID;
|
|
4811
4899
|
exports.A2A_ESCROW_PACKAGE_ID = A2A_ESCROW_PACKAGE_ID;
|
|
4900
|
+
exports.A2A_ESCROW_PACKAGE_V10_ID = A2A_ESCROW_PACKAGE_V10_ID;
|
|
4812
4901
|
exports.A2A_ESCROW_PACKAGE_V2_ID = A2A_ESCROW_PACKAGE_V2_ID;
|
|
4813
4902
|
exports.A2A_ESCROW_PACKAGE_V3_ID = A2A_ESCROW_PACKAGE_V3_ID;
|
|
4814
4903
|
exports.A2A_ESCROW_PACKAGE_V6_ID = A2A_ESCROW_PACKAGE_V6_ID;
|
|
@@ -4836,6 +4925,8 @@ exports.JOB_STATES = JOB_STATES;
|
|
|
4836
4925
|
exports.KNOWN_TARGETS = KNOWN_TARGETS;
|
|
4837
4926
|
exports.KeypairSigner = KeypairSigner;
|
|
4838
4927
|
exports.LABEL_PATTERNS = LABEL_PATTERNS;
|
|
4928
|
+
exports.LEVEL4_MAX_NO_DELIVERY = LEVEL4_MAX_NO_DELIVERY;
|
|
4929
|
+
exports.LEVEL4_MIN_REVIEWS = LEVEL4_MIN_REVIEWS;
|
|
4839
4930
|
exports.LimitEnforcer = LimitEnforcer;
|
|
4840
4931
|
exports.LimitExceededError = LimitExceededError;
|
|
4841
4932
|
exports.MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID = MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID;
|
|
@@ -4850,6 +4941,7 @@ exports.MAX_SLUG_LENGTH = MAX_SLUG_LENGTH;
|
|
|
4850
4941
|
exports.MAX_TIER_BASE_LENGTH = MAX_TIER_BASE_LENGTH;
|
|
4851
4942
|
exports.MIN_JOB_USDC = MIN_JOB_USDC;
|
|
4852
4943
|
exports.MIST_PER_SUI = MIST_PER_SUI;
|
|
4944
|
+
exports.NO_DELIVERY_REGRESSION_FLOOR = NO_DELIVERY_REGRESSION_FLOOR;
|
|
4853
4945
|
exports.OPENING_CLAIM_POLICIES = OPENING_CLAIM_POLICIES;
|
|
4854
4946
|
exports.OPENING_CLAIM_POLICY_ANY_ACTIVE = OPENING_CLAIM_POLICY_ANY_ACTIVE;
|
|
4855
4947
|
exports.OPENING_CLAIM_POLICY_PROVEN = OPENING_CLAIM_POLICY_PROVEN;
|
|
@@ -4860,6 +4952,7 @@ exports.PROVEN_MIN_AVG_STARS_X10 = PROVEN_MIN_AVG_STARS_X10;
|
|
|
4860
4952
|
exports.PROVEN_MIN_REVIEWS = PROVEN_MIN_REVIEWS;
|
|
4861
4953
|
exports.REVIEW_MAX_STARS = REVIEW_MAX_STARS;
|
|
4862
4954
|
exports.REVIEW_MIN_STARS = REVIEW_MIN_STARS;
|
|
4955
|
+
exports.SELLER_LEVEL_ACTIVE_CAPS = SELLER_LEVEL_ACTIVE_CAPS;
|
|
4863
4956
|
exports.SENDABLE_ASSETS = SENDABLE_ASSETS;
|
|
4864
4957
|
exports.SERVICE_SLUG_RE = SERVICE_SLUG_RE;
|
|
4865
4958
|
exports.SERVICE_TIERS = SERVICE_TIERS;
|
|
@@ -4877,6 +4970,7 @@ exports.T2000_OVERLAY_FEE_WALLET = T2000_OVERLAY_FEE_WALLET;
|
|
|
4877
4970
|
exports.USDC_DECIMALS = USDC_DECIMALS;
|
|
4878
4971
|
exports.WRITE_APPENDER_REGISTRY = WRITE_APPENDER_REGISTRY;
|
|
4879
4972
|
exports.ZkLoginSigner = ZkLoginSigner;
|
|
4973
|
+
exports.activeCapForLevel = activeCapForLevel;
|
|
4880
4974
|
exports.addSendToTx = addSendToTx;
|
|
4881
4975
|
exports.addSwapToTx = addSwapToTx;
|
|
4882
4976
|
exports.agentResolveUrl = agentResolveUrl;
|
|
@@ -4923,6 +5017,7 @@ exports.deriveAgentScoreId = deriveAgentScoreId;
|
|
|
4923
5017
|
exports.deriveAllowedAddressesFromPtb = deriveAllowedAddressesFromPtb;
|
|
4924
5018
|
exports.deserializeCetusRoute = deserializeCetusRoute;
|
|
4925
5019
|
exports.displayHandle = displayHandle;
|
|
5020
|
+
exports.effectiveSellerLevel = effectiveSellerLevel;
|
|
4926
5021
|
exports.endpointIssueLines = endpointIssueLines;
|
|
4927
5022
|
exports.ensureCategory = ensureCategory;
|
|
4928
5023
|
exports.executeTx = executeTx;
|
|
@@ -4973,6 +5068,7 @@ exports.looksLikeSuiNs = looksLikeSuiNs;
|
|
|
4973
5068
|
exports.mapMoveAbortCode = mapMoveAbortCode;
|
|
4974
5069
|
exports.mapWalletError = mapWalletError;
|
|
4975
5070
|
exports.meetsClaimPolicy = meetsClaimPolicy;
|
|
5071
|
+
exports.meetsMinSellerLevel = meetsMinSellerLevel;
|
|
4976
5072
|
exports.mistToSui = mistToSui;
|
|
4977
5073
|
exports.normalizeAddressInput = normalizeAddressInput;
|
|
4978
5074
|
exports.normalizeAsset = normalizeAsset;
|
|
@@ -4986,6 +5082,7 @@ exports.parseSuiRpcTx = parseSuiRpcTx;
|
|
|
4986
5082
|
exports.payWithX402 = payWithX402;
|
|
4987
5083
|
exports.planPackage = planPackage;
|
|
4988
5084
|
exports.postOpenJob = postOpenJob;
|
|
5085
|
+
exports.preflightClaimOpening = preflightClaimOpening;
|
|
4989
5086
|
exports.preflightCreateJob = preflightCreateJob;
|
|
4990
5087
|
exports.preflightCreateOpening = preflightCreateOpening;
|
|
4991
5088
|
exports.preflightFail = preflightFail;
|
|
@@ -5018,6 +5115,8 @@ exports.saveBech32 = saveBech32;
|
|
|
5018
5115
|
exports.saveKey = saveKey;
|
|
5019
5116
|
exports.selectAndSplitCoin = selectAndSplitCoin;
|
|
5020
5117
|
exports.selectSuiCoin = selectSuiCoin;
|
|
5118
|
+
exports.sellerLevel = sellerLevel;
|
|
5119
|
+
exports.sellerLevelLabel = sellerLevelLabel;
|
|
5021
5120
|
exports.serializeCetusRoute = serializeCetusRoute;
|
|
5022
5121
|
exports.serviceChallengeMessage = serviceChallengeMessage;
|
|
5023
5122
|
exports.servicePayloadSha256 = servicePayloadSha256;
|
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 { ad as T2000Error, bx as T2000Options, ak as TransactionSigner, V as PayOptions, by as X402Probe, W as PayResult, bz as SerializedCetusRoute, bA as SwapResult, bB as SwapQuoteResult, a5 as SendResult, B as BalanceResponse, aj as TransactionRecord, j as DepositInfo, bC as PaymentRequest, au as ZkLoginProof, bD as SuiCoreClient, Q as OverlayFeeConfig, bE as SponsoredCoinMergeCache, ab as SupportedAsset, ac as SwapRouteResult, bF as SendableAsset } from './commerce-D14qzqAV.cjs';
|
|
5
|
+
export { A as A2A_ESCROW_FEE_CONFIG_ID, bG as A2A_ESCROW_LATEST_PACKAGE_ID, bH as A2A_ESCROW_OPENING_PACKAGE_ID, a as A2A_ESCROW_PACKAGE_ID, bI as A2A_ESCROW_PACKAGE_V10_ID, bJ as A2A_ESCROW_PACKAGE_V2_ID, bK as A2A_ESCROW_PACKAGE_V3_ID, bL as A2A_ESCROW_PACKAGE_V6_ID, bM as A2A_ESCROW_PACKAGE_V7_ID, bN as A2A_ESCROW_PACKAGE_V8_ID, bO as A2A_SCORE_BOARD_ID, b as ActivityReportConfig, c as AgentScore, bP as ApiRouteListing, bQ as CETUS_USDC_SUI_POOL, C as CLOCK_ID, d as COIN_REGISTRY, e as ClassifyBalanceChange, f as ClassifyResult, g as CoinMeta, bR as CoinPage, D as DEFAULT_ACTIVITY_REPORT_URL, h as DEFAULT_COMMERCE_API_BASE, bS as DEFAULT_GRPC_URL, i as DEFAULT_NETWORK, E as ETH_TYPE, k as ExtractedTransfer, bT as GASLESS_MIN_STABLE_AMOUNT, bU 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 LEVEL4_MAX_NO_DELIVERY, r as LEVEL4_MIN_REVIEWS, s as LOFI_TYPE, bV as MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID, bW as MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID, bX as MAINNET_A2A_ESCROW_PACKAGE_ID, bY as MAINNET_A2A_SCORE_BOARD_ID, M as MANIFEST_TYPE, t as MAX_DELIVER_HORIZON_MS, u as MAX_JOB_USDC, bZ as MAX_OPEN_WINDOW_MS, v as MAX_REVIEW_WINDOW_MS, w as MIN_JOB_USDC, x as MIST_PER_SUI, N as NAVX_TYPE, y as NO_DELIVERY_REGRESSION_FLOOR, O as OPENING_CLAIM_POLICIES, z as OPENING_CLAIM_POLICY_ANY_ACTIVE, F as OPENING_CLAIM_POLICY_PROVEN, H as OPENING_CLAIM_POLICY_PROVEN_4STAR, b_ as OPERATION_ASSETS, P as OVERLAY_FEE_RATE, b$ as Opening, c0 as OpeningTerms, c1 as Operation, R as PREFLIGHT_MAX_AMOUNT, S as PREFLIGHT_OK, T as PROVEN_MIN_AVG_STARS_X10, U as PROVEN_MIN_REVIEWS, X as PreflightResult, Y as REVIEW_MAX_STARS, Z as REVIEW_MIN_STARS, _ as SELLER_LEVEL_ACTIVE_CAPS, c2 as SENDABLE_ASSETS, $ as STABLE_ASSETS, a0 as SUI_DECIMALS, a1 as SUI_TYPE, a2 as SUPPORTED_ASSETS, c3 as SelectAndSplitResult, a3 as SellerLevel, a4 as SendAssetClass, c4 as SerializedCetusRoutePath, c5 as SerializedRouterDataV3, a6 as ServiceListing, c6 as ServicesRail, c7 as ServicesRow, a7 as SimulationResult, a8 as StableAsset, a9 as SuiHolding, aa as SuiRpcTxBlock, ae as T2000ErrorCode, af as T2000ErrorData, ag as T2000_OVERLAY_FEE_WALLET, ah as TOKEN_MAP, ai as TransactionLeg, al as TxDirection, am as USDC_DECIMALS, an as USDC_TYPE, ao as USDE_TYPE, ap as USDSUI_TYPE, aq as USDT_TYPE, ar as WAL_TYPE, as as WBTC_TYPE, at as X402ActivityPayload, av as ZkLoginSigner, aw as activeCapForLevel, c8 as addSendToTx, c9 as addSwapToTx, ca as assertAllowedAsset, cb as assertBuyerRequirements, cc as buildCancelOpeningTx, cd as buildClaimOpeningTx, ce as buildCreateEmptyScoreTx, ax as buildCreateJobTx, cf as buildCreateOpeningTx, cg as buildDeclineJobTx, ay as buildDeliverJobTx, az as buildRefundJobTx, ch as buildRefundUnclaimedTx, aA as buildRejectJobTx, aB as buildReleaseJobTx, aC as buildSendTx, ci as buildSubmitFirstReviewTx, cj as buildSubmitReviewTx, aD as buildSwapTx, aE as checkPositiveAmount, aF as checkSuiAddress, aG as claimPolicyLabel, aH as claimPolicyRequirement, aI as classifyAction, aJ as classifyLabel, aK as classifySendAsset, aL as classifyTransaction, aM as deriveAgentScoreId, ck as deserializeCetusRoute, aN as effectiveSellerLevel, aO as executeTx, aP as extractAllUserLegs, aQ as extractTransferDetails, aR as extractTxCommands, aS as extractTxSender, aT as fallbackLabel, cl as fetchAllCoins, aU as fetchService, aV as findSwapRoute, aW as formatAssetAmount, aX as formatSui, aY as formatUsd, aZ as getAgentScore, cm as getCoinMeta, a_ as getDecimals, a$ as getDecimalsForCoinType, b0 as getJob, b1 as getJobSpec, cn as getOpening, co as getSuiClient, cp as getSuiGrpcClient, b2 as invalidSendAssetMessage, cq as isAllowedAsset, cr as isCetusRouteFresh, cs as isInRegistry, b3 as jobActionsFor, b4 as listServices, b5 as mapMoveAbortCode, b6 as mapWalletError, b7 as meetsClaimPolicy, b8 as meetsMinSellerLevel, b9 as mistToSui, ct as normalizeAsset, cu as normalizeCoinType, ba as parseSuiRpcTx, bb as payWithX402, bc as preflightClaimOpening, bd as preflightCreateJob, cv as preflightCreateOpening, be as preflightFail, bf as preflightPay, bg as preflightSend, bh as preflightSwap, cw as probeX402, bi as putJobSpec, cx as queryHistory, cy as queryTransaction, bj as rawToStable, bk as rawToUsdc, bl as refineLendingLabel, bm as reportX402Activity, bn as resolveSymbol, bo as resolveTokenType, cz as selectAndSplitCoin, cA as selectSuiCoin, bp as sellerLevel, bq as sellerLevelLabel, cB as serializeCetusRoute, cC as simulateTransaction, br as stableToRaw, bs as suiToMist, cD as throwIfSimulationFailed, bt as truncateAddress, bu as usdcToRaw, bv as validateAddress, cE as verifyCetusRouteCoinMatch, bw as verifyJobForSeller } from './commerce-D14qzqAV.cjs';
|
|
6
6
|
import { TransactionObjectArgument, Transaction } from '@mysten/sui/transactions';
|
|
7
7
|
import { SuinsClient } from '@mysten/suins';
|
|
8
8
|
import '@mysten/sui/client';
|
|
@@ -552,6 +552,9 @@ interface OpenJobRow {
|
|
|
552
552
|
* (render with `claimPolicyLabel`, never the raw number). Absent on
|
|
553
553
|
* pre-S.1054 rows = 0. */
|
|
554
554
|
claimPolicy?: number;
|
|
555
|
+
/** S.1192 — minimum EFFECTIVE seller level to claim (render with
|
|
556
|
+
* `sellerLevelLabel`). Absent on pre-S.1192 rows = 0 (no floor). */
|
|
557
|
+
minSellerLevel?: number;
|
|
555
558
|
createdAtMs: number;
|
|
556
559
|
updatedAtMs: number;
|
|
557
560
|
}
|
|
@@ -595,6 +598,9 @@ declare function postOpenJob(base: string, signer: TransactionSigner, input: {
|
|
|
595
598
|
openHours?: number;
|
|
596
599
|
/** S.1054 — 0 Anyone (default), 1 Proven, 2 Proven · 4★+. */
|
|
597
600
|
claimPolicy?: number;
|
|
601
|
+
/** S.1192 — minimum EFFECTIVE seller level to claim: 0 none
|
|
602
|
+
* (default), 1..4. Independent of claimPolicy. */
|
|
603
|
+
minSellerLevel?: number;
|
|
598
604
|
}): Promise<string>;
|
|
599
605
|
/** Review a settled job you bought — RELEASED or REJECTED (S.1064),
|
|
600
606
|
* always with a real delivery — writes the STARS ON-CHAIN (S.1054:
|
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 { ad as T2000Error, bx as T2000Options, ak as TransactionSigner, V as PayOptions, by as X402Probe, W as PayResult, bz as SerializedCetusRoute, bA as SwapResult, bB as SwapQuoteResult, a5 as SendResult, B as BalanceResponse, aj as TransactionRecord, j as DepositInfo, bC as PaymentRequest, au as ZkLoginProof, bD as SuiCoreClient, Q as OverlayFeeConfig, bE as SponsoredCoinMergeCache, ab as SupportedAsset, ac as SwapRouteResult, bF as SendableAsset } from './commerce-D14qzqAV.js';
|
|
5
|
+
export { A as A2A_ESCROW_FEE_CONFIG_ID, bG as A2A_ESCROW_LATEST_PACKAGE_ID, bH as A2A_ESCROW_OPENING_PACKAGE_ID, a as A2A_ESCROW_PACKAGE_ID, bI as A2A_ESCROW_PACKAGE_V10_ID, bJ as A2A_ESCROW_PACKAGE_V2_ID, bK as A2A_ESCROW_PACKAGE_V3_ID, bL as A2A_ESCROW_PACKAGE_V6_ID, bM as A2A_ESCROW_PACKAGE_V7_ID, bN as A2A_ESCROW_PACKAGE_V8_ID, bO as A2A_SCORE_BOARD_ID, b as ActivityReportConfig, c as AgentScore, bP as ApiRouteListing, bQ as CETUS_USDC_SUI_POOL, C as CLOCK_ID, d as COIN_REGISTRY, e as ClassifyBalanceChange, f as ClassifyResult, g as CoinMeta, bR as CoinPage, D as DEFAULT_ACTIVITY_REPORT_URL, h as DEFAULT_COMMERCE_API_BASE, bS as DEFAULT_GRPC_URL, i as DEFAULT_NETWORK, E as ETH_TYPE, k as ExtractedTransfer, bT as GASLESS_MIN_STABLE_AMOUNT, bU 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 LEVEL4_MAX_NO_DELIVERY, r as LEVEL4_MIN_REVIEWS, s as LOFI_TYPE, bV as MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID, bW as MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID, bX as MAINNET_A2A_ESCROW_PACKAGE_ID, bY as MAINNET_A2A_SCORE_BOARD_ID, M as MANIFEST_TYPE, t as MAX_DELIVER_HORIZON_MS, u as MAX_JOB_USDC, bZ as MAX_OPEN_WINDOW_MS, v as MAX_REVIEW_WINDOW_MS, w as MIN_JOB_USDC, x as MIST_PER_SUI, N as NAVX_TYPE, y as NO_DELIVERY_REGRESSION_FLOOR, O as OPENING_CLAIM_POLICIES, z as OPENING_CLAIM_POLICY_ANY_ACTIVE, F as OPENING_CLAIM_POLICY_PROVEN, H as OPENING_CLAIM_POLICY_PROVEN_4STAR, b_ as OPERATION_ASSETS, P as OVERLAY_FEE_RATE, b$ as Opening, c0 as OpeningTerms, c1 as Operation, R as PREFLIGHT_MAX_AMOUNT, S as PREFLIGHT_OK, T as PROVEN_MIN_AVG_STARS_X10, U as PROVEN_MIN_REVIEWS, X as PreflightResult, Y as REVIEW_MAX_STARS, Z as REVIEW_MIN_STARS, _ as SELLER_LEVEL_ACTIVE_CAPS, c2 as SENDABLE_ASSETS, $ as STABLE_ASSETS, a0 as SUI_DECIMALS, a1 as SUI_TYPE, a2 as SUPPORTED_ASSETS, c3 as SelectAndSplitResult, a3 as SellerLevel, a4 as SendAssetClass, c4 as SerializedCetusRoutePath, c5 as SerializedRouterDataV3, a6 as ServiceListing, c6 as ServicesRail, c7 as ServicesRow, a7 as SimulationResult, a8 as StableAsset, a9 as SuiHolding, aa as SuiRpcTxBlock, ae as T2000ErrorCode, af as T2000ErrorData, ag as T2000_OVERLAY_FEE_WALLET, ah as TOKEN_MAP, ai as TransactionLeg, al as TxDirection, am as USDC_DECIMALS, an as USDC_TYPE, ao as USDE_TYPE, ap as USDSUI_TYPE, aq as USDT_TYPE, ar as WAL_TYPE, as as WBTC_TYPE, at as X402ActivityPayload, av as ZkLoginSigner, aw as activeCapForLevel, c8 as addSendToTx, c9 as addSwapToTx, ca as assertAllowedAsset, cb as assertBuyerRequirements, cc as buildCancelOpeningTx, cd as buildClaimOpeningTx, ce as buildCreateEmptyScoreTx, ax as buildCreateJobTx, cf as buildCreateOpeningTx, cg as buildDeclineJobTx, ay as buildDeliverJobTx, az as buildRefundJobTx, ch as buildRefundUnclaimedTx, aA as buildRejectJobTx, aB as buildReleaseJobTx, aC as buildSendTx, ci as buildSubmitFirstReviewTx, cj as buildSubmitReviewTx, aD as buildSwapTx, aE as checkPositiveAmount, aF as checkSuiAddress, aG as claimPolicyLabel, aH as claimPolicyRequirement, aI as classifyAction, aJ as classifyLabel, aK as classifySendAsset, aL as classifyTransaction, aM as deriveAgentScoreId, ck as deserializeCetusRoute, aN as effectiveSellerLevel, aO as executeTx, aP as extractAllUserLegs, aQ as extractTransferDetails, aR as extractTxCommands, aS as extractTxSender, aT as fallbackLabel, cl as fetchAllCoins, aU as fetchService, aV as findSwapRoute, aW as formatAssetAmount, aX as formatSui, aY as formatUsd, aZ as getAgentScore, cm as getCoinMeta, a_ as getDecimals, a$ as getDecimalsForCoinType, b0 as getJob, b1 as getJobSpec, cn as getOpening, co as getSuiClient, cp as getSuiGrpcClient, b2 as invalidSendAssetMessage, cq as isAllowedAsset, cr as isCetusRouteFresh, cs as isInRegistry, b3 as jobActionsFor, b4 as listServices, b5 as mapMoveAbortCode, b6 as mapWalletError, b7 as meetsClaimPolicy, b8 as meetsMinSellerLevel, b9 as mistToSui, ct as normalizeAsset, cu as normalizeCoinType, ba as parseSuiRpcTx, bb as payWithX402, bc as preflightClaimOpening, bd as preflightCreateJob, cv as preflightCreateOpening, be as preflightFail, bf as preflightPay, bg as preflightSend, bh as preflightSwap, cw as probeX402, bi as putJobSpec, cx as queryHistory, cy as queryTransaction, bj as rawToStable, bk as rawToUsdc, bl as refineLendingLabel, bm as reportX402Activity, bn as resolveSymbol, bo as resolveTokenType, cz as selectAndSplitCoin, cA as selectSuiCoin, bp as sellerLevel, bq as sellerLevelLabel, cB as serializeCetusRoute, cC as simulateTransaction, br as stableToRaw, bs as suiToMist, cD as throwIfSimulationFailed, bt as truncateAddress, bu as usdcToRaw, bv as validateAddress, cE as verifyCetusRouteCoinMatch, bw as verifyJobForSeller } from './commerce-D14qzqAV.js';
|
|
6
6
|
import { TransactionObjectArgument, Transaction } from '@mysten/sui/transactions';
|
|
7
7
|
import { SuinsClient } from '@mysten/suins';
|
|
8
8
|
import '@mysten/sui/client';
|
|
@@ -552,6 +552,9 @@ interface OpenJobRow {
|
|
|
552
552
|
* (render with `claimPolicyLabel`, never the raw number). Absent on
|
|
553
553
|
* pre-S.1054 rows = 0. */
|
|
554
554
|
claimPolicy?: number;
|
|
555
|
+
/** S.1192 — minimum EFFECTIVE seller level to claim (render with
|
|
556
|
+
* `sellerLevelLabel`). Absent on pre-S.1192 rows = 0 (no floor). */
|
|
557
|
+
minSellerLevel?: number;
|
|
555
558
|
createdAtMs: number;
|
|
556
559
|
updatedAtMs: number;
|
|
557
560
|
}
|
|
@@ -595,6 +598,9 @@ declare function postOpenJob(base: string, signer: TransactionSigner, input: {
|
|
|
595
598
|
openHours?: number;
|
|
596
599
|
/** S.1054 — 0 Anyone (default), 1 Proven, 2 Proven · 4★+. */
|
|
597
600
|
claimPolicy?: number;
|
|
601
|
+
/** S.1192 — minimum EFFECTIVE seller level to claim: 0 none
|
|
602
|
+
* (default), 1..4. Independent of claimPolicy. */
|
|
603
|
+
minSellerLevel?: number;
|
|
598
604
|
}): Promise<string>;
|
|
599
605
|
/** Review a settled job you bought — RELEASED or REJECTED (S.1064),
|
|
600
606
|
* always with a real delivery — writes the STARS ON-CHAIN (S.1054:
|