@t2000/sdk 10.37.2 → 10.38.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.cjs +105 -22
- package/dist/browser.d.cts +1 -1
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +96 -23
- package/dist/{commerce-gDWVYXP8.d.cts → commerce-D14qzqAV.d.cts} +91 -14
- package/dist/{commerce-gDWVYXP8.d.ts → commerce-D14qzqAV.d.ts} +91 -14
- package/dist/index.cjs +149 -31
- package/dist/index.d.cts +8 -2
- package/dist/index.d.ts +8 -2
- package/dist/index.js +139 -32
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -281,6 +281,14 @@ __export(coinSelection_exports, {
|
|
|
281
281
|
selectAndSplitCoin: () => selectAndSplitCoin,
|
|
282
282
|
selectSuiCoin: () => selectSuiCoin
|
|
283
283
|
});
|
|
284
|
+
function formatRawAmount(raw, coinType) {
|
|
285
|
+
const decimals = getDecimalsForCoinType(coinType);
|
|
286
|
+
const dp = Math.min(decimals, 8);
|
|
287
|
+
const s = raw.toString().padStart(decimals + 1, "0");
|
|
288
|
+
const whole = s.slice(0, s.length - decimals);
|
|
289
|
+
const frac = s.slice(s.length - decimals).slice(0, dp).replace(/0+$/, "");
|
|
290
|
+
return frac ? `${whole}.${frac}` : whole;
|
|
291
|
+
}
|
|
284
292
|
async function fetchAllCoins(client, owner, coinType) {
|
|
285
293
|
const [balance, ids] = await Promise.all([
|
|
286
294
|
client.core.getBalance({ owner, coinType }),
|
|
@@ -313,15 +321,25 @@ async function selectAndSplitCoin(tx, client, owner, coinType, amount, options =
|
|
|
313
321
|
}
|
|
314
322
|
const balanceResp = await client.core.getBalance({ owner, coinType });
|
|
315
323
|
const totalBalance = BigInt(balanceResp.balance.balance);
|
|
324
|
+
const symbol = resolveSymbol(coinType);
|
|
316
325
|
if (totalBalance === 0n) {
|
|
317
|
-
throw new exports.T2000Error(
|
|
326
|
+
throw new exports.T2000Error(
|
|
327
|
+
"INSUFFICIENT_BALANCE",
|
|
328
|
+
amount === "all" ? `No ${symbol} in this wallet.` : `Insufficient ${symbol}: need ${formatRawAmount(amount, coinType)}, the wallet holds 0.`,
|
|
329
|
+
{ available: "0", required: amount === "all" ? "0" : amount.toString(), coinType }
|
|
330
|
+
);
|
|
318
331
|
}
|
|
319
332
|
const allowSwapAll = options.allowSwapAll ?? true;
|
|
320
333
|
if (amount !== "all" && amount > totalBalance && !allowSwapAll) {
|
|
321
|
-
throw new exports.T2000Error(
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
334
|
+
throw new exports.T2000Error(
|
|
335
|
+
"INSUFFICIENT_BALANCE",
|
|
336
|
+
`Insufficient ${symbol}: need ${formatRawAmount(amount, coinType)}, the wallet holds ${formatRawAmount(totalBalance, coinType)}.`,
|
|
337
|
+
{
|
|
338
|
+
available: totalBalance.toString(),
|
|
339
|
+
required: amount.toString(),
|
|
340
|
+
coinType
|
|
341
|
+
}
|
|
342
|
+
);
|
|
325
343
|
}
|
|
326
344
|
const requested = amount === "all" ? totalBalance : amount;
|
|
327
345
|
const swapAll = amount === "all" || requested >= totalBalance;
|
|
@@ -336,7 +354,7 @@ async function selectCoinObjectsOnly(tx, client, owner, coinType, amount, allowS
|
|
|
336
354
|
if (cached.remaining === 0n || requested2 > cached.remaining) {
|
|
337
355
|
throw new exports.T2000Error(
|
|
338
356
|
"ADDRESS_BALANCE_UNSPONSORABLE",
|
|
339
|
-
`Not enough ${coinType} in coin objects to cover all legs of this sponsored bundle. The remaining funds are in your address balance, which sponsored transactions can't access yet.`,
|
|
357
|
+
`Not enough ${resolveSymbol(coinType)} in coin objects to cover all legs of this sponsored bundle. The remaining funds are in your address balance, which sponsored transactions can't access yet.`,
|
|
340
358
|
{ remaining: cached.remaining.toString(), requested: requested2.toString(), coinType }
|
|
341
359
|
);
|
|
342
360
|
}
|
|
@@ -401,7 +419,7 @@ function buildCoinToAddressBalanceMigration(args) {
|
|
|
401
419
|
migratedRaw += c.balance;
|
|
402
420
|
}
|
|
403
421
|
if (migratedRaw < minAmount) {
|
|
404
|
-
throw new exports.T2000Error("INSUFFICIENT_BALANCE", `Insufficient ${coinType} coin objects to migrate`, {
|
|
422
|
+
throw new exports.T2000Error("INSUFFICIENT_BALANCE", `Insufficient ${resolveSymbol(coinType)} coin objects to migrate`, {
|
|
405
423
|
available: migratedRaw.toString(),
|
|
406
424
|
required: minAmount.toString()
|
|
407
425
|
});
|
|
@@ -427,6 +445,7 @@ async function selectSuiCoin(tx, client, owner, amountMist, sponsoredContext, me
|
|
|
427
445
|
var init_coinSelection = __esm({
|
|
428
446
|
"src/wallet/coinSelection.ts"() {
|
|
429
447
|
init_errors();
|
|
448
|
+
init_token_registry();
|
|
430
449
|
}
|
|
431
450
|
});
|
|
432
451
|
|
|
@@ -2986,7 +3005,7 @@ init_coinSelection();
|
|
|
2986
3005
|
init_errors();
|
|
2987
3006
|
init_token_registry();
|
|
2988
3007
|
init_coinSelection();
|
|
2989
|
-
var MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID = "
|
|
3008
|
+
var MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID = "0x5c90ec07da01bf885a4e65247ce98b75ab8a042cd965d30d7213856d579c4afa";
|
|
2990
3009
|
var MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID = MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID;
|
|
2991
3010
|
var A2A_ESCROW_LATEST_PACKAGE_ID = process.env.A2A_ESCROW_OPENING_PACKAGE_ID ?? process.env.A2A_ESCROW_PACKAGE_ID ?? MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID;
|
|
2992
3011
|
var A2A_ESCROW_OPENING_PACKAGE_ID = A2A_ESCROW_LATEST_PACKAGE_ID;
|
|
@@ -2995,6 +3014,7 @@ var A2A_ESCROW_PACKAGE_V3_ID = "0x69ad93c555519de520a5c7f7f2963ad6f8b91cefc098fc
|
|
|
2995
3014
|
var A2A_ESCROW_PACKAGE_V6_ID = "0xb065033b6f72c4899055a0b3afac28f09dc7b0b7b491eada793157de20000618";
|
|
2996
3015
|
var A2A_ESCROW_PACKAGE_V7_ID = "0x4249f0b242c47c7baf0c37304365bc4bbe769bcedf11f3525e84682d59a3b23e";
|
|
2997
3016
|
var A2A_ESCROW_PACKAGE_V8_ID = "0x1595b80bc05a03607f3908702c866ca63cf961025b4263b5ecbe419e07f8ff31";
|
|
3017
|
+
var A2A_ESCROW_PACKAGE_V10_ID = process.env.A2A_ESCROW_PACKAGE_V10_ID ?? "0x5c90ec07da01bf885a4e65247ce98b75ab8a042cd965d30d7213856d579c4afa";
|
|
2998
3018
|
var CLOCK_ID2 = "0x6";
|
|
2999
3019
|
var MODULE = "opening";
|
|
3000
3020
|
var SHA256_HEX_RE = /^(0x)?[0-9a-fA-F]{64}$/;
|
|
@@ -3069,6 +3089,14 @@ function preflightCreateOpening(terms) {
|
|
|
3069
3089
|
error: "claimPolicy must be 0 (Anyone), 1 (Proven) or 2 (Proven \xB7 4\u2605+) \u2014 anything else aborts on-chain."
|
|
3070
3090
|
};
|
|
3071
3091
|
}
|
|
3092
|
+
const minLevel = terms.minSellerLevel ?? 0;
|
|
3093
|
+
if (!Number.isInteger(minLevel) || minLevel < 0 || minLevel > 4) {
|
|
3094
|
+
return {
|
|
3095
|
+
valid: false,
|
|
3096
|
+
code: "INVALID_INPUT",
|
|
3097
|
+
error: "minSellerLevel must be 0 (no floor) or 1\u20134 (Level 1\u20134) \u2014 anything else aborts on-chain (S.1192)."
|
|
3098
|
+
};
|
|
3099
|
+
}
|
|
3072
3100
|
return { valid: true };
|
|
3073
3101
|
}
|
|
3074
3102
|
async function buildCreateOpeningTx({
|
|
@@ -3084,7 +3112,9 @@ async function buildCreateOpeningTx({
|
|
|
3084
3112
|
allowSwapAll: false
|
|
3085
3113
|
});
|
|
3086
3114
|
tx.moveCall({
|
|
3087
|
-
|
|
3115
|
+
// S.1192: create_open is a dead abort stub after the v10 migrate —
|
|
3116
|
+
// every post rides v2 (adds the min_seller_level DF write).
|
|
3117
|
+
target: `${A2A_ESCROW_OPENING_PACKAGE_ID}::${MODULE}::create_open_v2`,
|
|
3088
3118
|
typeArguments: [exports.USDC_TYPE],
|
|
3089
3119
|
arguments: [
|
|
3090
3120
|
coin,
|
|
@@ -3094,6 +3124,7 @@ async function buildCreateOpeningTx({
|
|
|
3094
3124
|
tx.pure.u64(terms.reviewWindowMs),
|
|
3095
3125
|
tx.pure.u64(terms.rejectSplitBps),
|
|
3096
3126
|
tx.pure.u8(terms.claimPolicy ?? OPENING_CLAIM_POLICY_ANY_ACTIVE),
|
|
3127
|
+
tx.pure.u8(terms.minSellerLevel ?? 0),
|
|
3097
3128
|
feeConfigArg(tx),
|
|
3098
3129
|
tx.object(CLOCK_ID2)
|
|
3099
3130
|
]
|
|
@@ -3103,23 +3134,26 @@ async function buildCreateOpeningTx({
|
|
|
3103
3134
|
function buildClaimOpeningTx({
|
|
3104
3135
|
openingId,
|
|
3105
3136
|
registryId,
|
|
3106
|
-
scoreId
|
|
3137
|
+
scoreId,
|
|
3138
|
+
claimPolicy = OPENING_CLAIM_POLICY_ANY_ACTIVE
|
|
3107
3139
|
}) {
|
|
3140
|
+
if (!scoreId) {
|
|
3141
|
+
throw new exports.T2000Error(
|
|
3142
|
+
"INVALID_INPUT",
|
|
3143
|
+
"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."
|
|
3144
|
+
);
|
|
3145
|
+
}
|
|
3146
|
+
const proven = claimPolicy !== OPENING_CLAIM_POLICY_ANY_ACTIVE;
|
|
3108
3147
|
const tx = new transactions.Transaction();
|
|
3109
3148
|
tx.moveCall({
|
|
3110
|
-
target: `${A2A_ESCROW_OPENING_PACKAGE_ID}::${MODULE}::${
|
|
3149
|
+
target: `${A2A_ESCROW_OPENING_PACKAGE_ID}::${MODULE}::${proven ? "claim_proven_v2" : "claim_v2"}`,
|
|
3111
3150
|
typeArguments: [exports.USDC_TYPE],
|
|
3112
|
-
arguments:
|
|
3151
|
+
arguments: [
|
|
3113
3152
|
tx.object(openingId),
|
|
3114
3153
|
tx.object(registryId),
|
|
3115
3154
|
tx.object(scoreId),
|
|
3116
3155
|
feeConfigArg(tx),
|
|
3117
3156
|
tx.object(CLOCK_ID2)
|
|
3118
|
-
] : [
|
|
3119
|
-
tx.object(openingId),
|
|
3120
|
-
tx.object(registryId),
|
|
3121
|
-
feeConfigArg(tx),
|
|
3122
|
-
tx.object(CLOCK_ID2)
|
|
3123
3157
|
]
|
|
3124
3158
|
});
|
|
3125
3159
|
return tx;
|
|
@@ -3139,6 +3173,24 @@ function buildCancelOpeningTx(openingId) {
|
|
|
3139
3173
|
function buildRefundUnclaimedTx(openingId) {
|
|
3140
3174
|
return openingCall(openingId, "refund_unclaimed");
|
|
3141
3175
|
}
|
|
3176
|
+
async function readMinSellerLevelDf(client, openingId) {
|
|
3177
|
+
if (!A2A_ESCROW_PACKAGE_V10_ID) return 0;
|
|
3178
|
+
try {
|
|
3179
|
+
const fieldId = utils.deriveDynamicFieldID(
|
|
3180
|
+
openingId,
|
|
3181
|
+
`${A2A_ESCROW_PACKAGE_V10_ID}::${MODULE}::MinSellerLevelKey`,
|
|
3182
|
+
new Uint8Array([0])
|
|
3183
|
+
);
|
|
3184
|
+
const resp = await client.core.getObject({
|
|
3185
|
+
objectId: fieldId,
|
|
3186
|
+
include: { json: true }
|
|
3187
|
+
});
|
|
3188
|
+
const json = resp?.object?.json;
|
|
3189
|
+
return Number(json?.value ?? 0);
|
|
3190
|
+
} catch {
|
|
3191
|
+
return 0;
|
|
3192
|
+
}
|
|
3193
|
+
}
|
|
3142
3194
|
function bytesToHex(bytes) {
|
|
3143
3195
|
return `0x${Array.from(bytes).map((b) => b.toString(16).padStart(2, "0")).join("")}`;
|
|
3144
3196
|
}
|
|
@@ -3149,6 +3201,7 @@ async function getOpening(client, openingId) {
|
|
|
3149
3201
|
if (!json || !objType.includes(`::${MODULE}::Opening<`)) {
|
|
3150
3202
|
return null;
|
|
3151
3203
|
}
|
|
3204
|
+
const minSellerLevel = await readMinSellerLevelDf(client, openingId);
|
|
3152
3205
|
return {
|
|
3153
3206
|
id: openingId,
|
|
3154
3207
|
buyer: String(json.buyer),
|
|
@@ -3160,6 +3213,7 @@ async function getOpening(client, openingId) {
|
|
|
3160
3213
|
reviewWindowMs: Number(json.review_window_ms),
|
|
3161
3214
|
rejectSplitBps: Number(json.reject_split_bps),
|
|
3162
3215
|
claimPolicy: Number(json.claim_policy ?? 0),
|
|
3216
|
+
minSellerLevel,
|
|
3163
3217
|
createdAtMs: Number(json.created_at_ms ?? 0)
|
|
3164
3218
|
};
|
|
3165
3219
|
}
|
|
@@ -3289,15 +3343,6 @@ function buildDeclineJobTx(jobId) {
|
|
|
3289
3343
|
});
|
|
3290
3344
|
return tx;
|
|
3291
3345
|
}
|
|
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
3346
|
function buildRejectJobTx(jobId, v2) {
|
|
3302
3347
|
const tx = new transactions.Transaction();
|
|
3303
3348
|
tx.moveCall({
|
|
@@ -3348,8 +3393,19 @@ function buildDeliverJobTx(jobId, deliveryHash) {
|
|
|
3348
3393
|
});
|
|
3349
3394
|
return tx;
|
|
3350
3395
|
}
|
|
3351
|
-
function buildReleaseJobTx(jobId) {
|
|
3352
|
-
|
|
3396
|
+
function buildReleaseJobTx(jobId, v2) {
|
|
3397
|
+
const tx = new transactions.Transaction();
|
|
3398
|
+
tx.moveCall({
|
|
3399
|
+
target: `${A2A_ESCROW_LATEST_PACKAGE_ID}::reputation::release_v2`,
|
|
3400
|
+
typeArguments: [exports.USDC_TYPE],
|
|
3401
|
+
arguments: [
|
|
3402
|
+
tx.object(jobId),
|
|
3403
|
+
tx.object(v2.sellerScoreId),
|
|
3404
|
+
feeConfigArg2(tx),
|
|
3405
|
+
tx.object(CLOCK_ID3)
|
|
3406
|
+
]
|
|
3407
|
+
});
|
|
3408
|
+
return tx;
|
|
3353
3409
|
}
|
|
3354
3410
|
async function getJob(client, jobId) {
|
|
3355
3411
|
const resp = await client.core.getObject({ objectId: jobId, include: { json: true } }).catch((e) => {
|
|
@@ -3438,6 +3494,10 @@ var PROVEN_MIN_REVIEWS = 3;
|
|
|
3438
3494
|
var PROVEN_MIN_AVG_STARS_X10 = 40;
|
|
3439
3495
|
var REVIEW_MIN_STARS = 1;
|
|
3440
3496
|
var REVIEW_MAX_STARS = 5;
|
|
3497
|
+
var SELLER_LEVEL_ACTIVE_CAPS = [4, 10, 20, 30];
|
|
3498
|
+
var NO_DELIVERY_REGRESSION_FLOOR = 3;
|
|
3499
|
+
var LEVEL4_MIN_REVIEWS = 20;
|
|
3500
|
+
var LEVEL4_MAX_NO_DELIVERY = 2;
|
|
3441
3501
|
function boardIdOrThrow(boardId) {
|
|
3442
3502
|
const id = boardId ?? A2A_SCORE_BOARD_ID;
|
|
3443
3503
|
if (!id) {
|
|
@@ -3483,11 +3543,12 @@ async function getAgentScore(client, agent, boardId) {
|
|
|
3483
3543
|
}
|
|
3484
3544
|
const reviewCount = Number(json.review_count ?? 0);
|
|
3485
3545
|
const starsSum = Number(json.stars_sum ?? 0);
|
|
3486
|
-
const [distinctBuyers, rejectedAfterDelivery, noDelivery, asBuyerRejected] = await Promise.all([
|
|
3546
|
+
const [distinctBuyers, rejectedAfterDelivery, noDelivery, asBuyerRejected, activeSellerJobs] = await Promise.all([
|
|
3487
3547
|
readCounterDf(client, scoreId, A2A_ESCROW_PACKAGE_V7_ID, "DistinctCountKey"),
|
|
3488
3548
|
readCounterDf(client, scoreId, A2A_ESCROW_PACKAGE_V8_ID, "RejectedAfterDeliveryKey"),
|
|
3489
3549
|
readCounterDf(client, scoreId, A2A_ESCROW_PACKAGE_V8_ID, "NoDeliveryKey"),
|
|
3490
|
-
readCounterDf(client, scoreId, A2A_ESCROW_PACKAGE_V8_ID, "AsBuyerRejectedKey")
|
|
3550
|
+
readCounterDf(client, scoreId, A2A_ESCROW_PACKAGE_V8_ID, "AsBuyerRejectedKey"),
|
|
3551
|
+
readCounterDf(client, scoreId, A2A_ESCROW_PACKAGE_V10_ID, "ActiveSellerJobsKey")
|
|
3491
3552
|
]);
|
|
3492
3553
|
return {
|
|
3493
3554
|
id: scoreId,
|
|
@@ -3498,7 +3559,8 @@ async function getAgentScore(client, agent, boardId) {
|
|
|
3498
3559
|
distinctBuyers,
|
|
3499
3560
|
rejectedAfterDelivery,
|
|
3500
3561
|
noDelivery,
|
|
3501
|
-
asBuyerRejected
|
|
3562
|
+
asBuyerRejected,
|
|
3563
|
+
activeSellerJobs
|
|
3502
3564
|
};
|
|
3503
3565
|
}
|
|
3504
3566
|
function buildCreateEmptyScoreTx({
|
|
@@ -3543,6 +3605,51 @@ function claimPolicyRequirement(claimPolicy) {
|
|
|
3543
3605
|
}
|
|
3544
3606
|
return "Anyone can claim (active Agent ID required).";
|
|
3545
3607
|
}
|
|
3608
|
+
function sellerLevel(score) {
|
|
3609
|
+
if (!score) return 1;
|
|
3610
|
+
const provenAvg = score.distinctBuyers >= PROVEN_MIN_REVIEWS && score.starsSum * 10 >= score.reviewCount * PROVEN_MIN_AVG_STARS_X10;
|
|
3611
|
+
if (provenAvg) {
|
|
3612
|
+
return score.reviewCount >= LEVEL4_MIN_REVIEWS && score.noDelivery <= LEVEL4_MAX_NO_DELIVERY ? 4 : 3;
|
|
3613
|
+
}
|
|
3614
|
+
return score.distinctBuyers >= PROVEN_MIN_REVIEWS ? 2 : 1;
|
|
3615
|
+
}
|
|
3616
|
+
function effectiveSellerLevel(score) {
|
|
3617
|
+
if (!score) return 1;
|
|
3618
|
+
if (score.noDelivery >= NO_DELIVERY_REGRESSION_FLOOR) return 1;
|
|
3619
|
+
return sellerLevel(score);
|
|
3620
|
+
}
|
|
3621
|
+
function activeCapForLevel(level) {
|
|
3622
|
+
return SELLER_LEVEL_ACTIVE_CAPS[level - 1];
|
|
3623
|
+
}
|
|
3624
|
+
function meetsMinSellerLevel(score, minLevel) {
|
|
3625
|
+
if (minLevel <= 0) return true;
|
|
3626
|
+
return effectiveSellerLevel(score) >= minLevel;
|
|
3627
|
+
}
|
|
3628
|
+
function sellerLevelLabel(level) {
|
|
3629
|
+
return level >= 1 && level <= 4 ? `Level ${level}` : `Level ? (${level})`;
|
|
3630
|
+
}
|
|
3631
|
+
function preflightClaimOpening(score, opening) {
|
|
3632
|
+
if (!meetsClaimPolicy(score, opening.claimPolicy)) {
|
|
3633
|
+
return { valid: false, error: claimPolicyRequirement(opening.claimPolicy) };
|
|
3634
|
+
}
|
|
3635
|
+
const level = effectiveSellerLevel(score);
|
|
3636
|
+
const cap = activeCapForLevel(level);
|
|
3637
|
+
const active = score?.activeSellerJobs ?? 0;
|
|
3638
|
+
if (active >= cap) {
|
|
3639
|
+
return {
|
|
3640
|
+
valid: false,
|
|
3641
|
+
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.`
|
|
3642
|
+
};
|
|
3643
|
+
}
|
|
3644
|
+
const minLevel = opening.minSellerLevel ?? 0;
|
|
3645
|
+
if (!meetsMinSellerLevel(score, minLevel)) {
|
|
3646
|
+
return {
|
|
3647
|
+
valid: false,
|
|
3648
|
+
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.`
|
|
3649
|
+
};
|
|
3650
|
+
}
|
|
3651
|
+
return { valid: true };
|
|
3652
|
+
}
|
|
3546
3653
|
function assertStars(stars) {
|
|
3547
3654
|
if (!Number.isInteger(stars) || stars < REVIEW_MIN_STARS || stars > REVIEW_MAX_STARS) {
|
|
3548
3655
|
throw new exports.T2000Error("INVALID_INPUT", "Stars must be an integer 1-5.");
|
|
@@ -4809,6 +4916,7 @@ exports.A2A_ESCROW_FEE_CONFIG_ID = A2A_ESCROW_FEE_CONFIG_ID;
|
|
|
4809
4916
|
exports.A2A_ESCROW_LATEST_PACKAGE_ID = A2A_ESCROW_LATEST_PACKAGE_ID;
|
|
4810
4917
|
exports.A2A_ESCROW_OPENING_PACKAGE_ID = A2A_ESCROW_OPENING_PACKAGE_ID;
|
|
4811
4918
|
exports.A2A_ESCROW_PACKAGE_ID = A2A_ESCROW_PACKAGE_ID;
|
|
4919
|
+
exports.A2A_ESCROW_PACKAGE_V10_ID = A2A_ESCROW_PACKAGE_V10_ID;
|
|
4812
4920
|
exports.A2A_ESCROW_PACKAGE_V2_ID = A2A_ESCROW_PACKAGE_V2_ID;
|
|
4813
4921
|
exports.A2A_ESCROW_PACKAGE_V3_ID = A2A_ESCROW_PACKAGE_V3_ID;
|
|
4814
4922
|
exports.A2A_ESCROW_PACKAGE_V6_ID = A2A_ESCROW_PACKAGE_V6_ID;
|
|
@@ -4836,6 +4944,8 @@ exports.JOB_STATES = JOB_STATES;
|
|
|
4836
4944
|
exports.KNOWN_TARGETS = KNOWN_TARGETS;
|
|
4837
4945
|
exports.KeypairSigner = KeypairSigner;
|
|
4838
4946
|
exports.LABEL_PATTERNS = LABEL_PATTERNS;
|
|
4947
|
+
exports.LEVEL4_MAX_NO_DELIVERY = LEVEL4_MAX_NO_DELIVERY;
|
|
4948
|
+
exports.LEVEL4_MIN_REVIEWS = LEVEL4_MIN_REVIEWS;
|
|
4839
4949
|
exports.LimitEnforcer = LimitEnforcer;
|
|
4840
4950
|
exports.LimitExceededError = LimitExceededError;
|
|
4841
4951
|
exports.MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID = MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID;
|
|
@@ -4850,6 +4960,7 @@ exports.MAX_SLUG_LENGTH = MAX_SLUG_LENGTH;
|
|
|
4850
4960
|
exports.MAX_TIER_BASE_LENGTH = MAX_TIER_BASE_LENGTH;
|
|
4851
4961
|
exports.MIN_JOB_USDC = MIN_JOB_USDC;
|
|
4852
4962
|
exports.MIST_PER_SUI = MIST_PER_SUI;
|
|
4963
|
+
exports.NO_DELIVERY_REGRESSION_FLOOR = NO_DELIVERY_REGRESSION_FLOOR;
|
|
4853
4964
|
exports.OPENING_CLAIM_POLICIES = OPENING_CLAIM_POLICIES;
|
|
4854
4965
|
exports.OPENING_CLAIM_POLICY_ANY_ACTIVE = OPENING_CLAIM_POLICY_ANY_ACTIVE;
|
|
4855
4966
|
exports.OPENING_CLAIM_POLICY_PROVEN = OPENING_CLAIM_POLICY_PROVEN;
|
|
@@ -4860,6 +4971,7 @@ exports.PROVEN_MIN_AVG_STARS_X10 = PROVEN_MIN_AVG_STARS_X10;
|
|
|
4860
4971
|
exports.PROVEN_MIN_REVIEWS = PROVEN_MIN_REVIEWS;
|
|
4861
4972
|
exports.REVIEW_MAX_STARS = REVIEW_MAX_STARS;
|
|
4862
4973
|
exports.REVIEW_MIN_STARS = REVIEW_MIN_STARS;
|
|
4974
|
+
exports.SELLER_LEVEL_ACTIVE_CAPS = SELLER_LEVEL_ACTIVE_CAPS;
|
|
4863
4975
|
exports.SENDABLE_ASSETS = SENDABLE_ASSETS;
|
|
4864
4976
|
exports.SERVICE_SLUG_RE = SERVICE_SLUG_RE;
|
|
4865
4977
|
exports.SERVICE_TIERS = SERVICE_TIERS;
|
|
@@ -4877,6 +4989,7 @@ exports.T2000_OVERLAY_FEE_WALLET = T2000_OVERLAY_FEE_WALLET;
|
|
|
4877
4989
|
exports.USDC_DECIMALS = USDC_DECIMALS;
|
|
4878
4990
|
exports.WRITE_APPENDER_REGISTRY = WRITE_APPENDER_REGISTRY;
|
|
4879
4991
|
exports.ZkLoginSigner = ZkLoginSigner;
|
|
4992
|
+
exports.activeCapForLevel = activeCapForLevel;
|
|
4880
4993
|
exports.addSendToTx = addSendToTx;
|
|
4881
4994
|
exports.addSwapToTx = addSwapToTx;
|
|
4882
4995
|
exports.agentResolveUrl = agentResolveUrl;
|
|
@@ -4923,6 +5036,7 @@ exports.deriveAgentScoreId = deriveAgentScoreId;
|
|
|
4923
5036
|
exports.deriveAllowedAddressesFromPtb = deriveAllowedAddressesFromPtb;
|
|
4924
5037
|
exports.deserializeCetusRoute = deserializeCetusRoute;
|
|
4925
5038
|
exports.displayHandle = displayHandle;
|
|
5039
|
+
exports.effectiveSellerLevel = effectiveSellerLevel;
|
|
4926
5040
|
exports.endpointIssueLines = endpointIssueLines;
|
|
4927
5041
|
exports.ensureCategory = ensureCategory;
|
|
4928
5042
|
exports.executeTx = executeTx;
|
|
@@ -4973,6 +5087,7 @@ exports.looksLikeSuiNs = looksLikeSuiNs;
|
|
|
4973
5087
|
exports.mapMoveAbortCode = mapMoveAbortCode;
|
|
4974
5088
|
exports.mapWalletError = mapWalletError;
|
|
4975
5089
|
exports.meetsClaimPolicy = meetsClaimPolicy;
|
|
5090
|
+
exports.meetsMinSellerLevel = meetsMinSellerLevel;
|
|
4976
5091
|
exports.mistToSui = mistToSui;
|
|
4977
5092
|
exports.normalizeAddressInput = normalizeAddressInput;
|
|
4978
5093
|
exports.normalizeAsset = normalizeAsset;
|
|
@@ -4986,6 +5101,7 @@ exports.parseSuiRpcTx = parseSuiRpcTx;
|
|
|
4986
5101
|
exports.payWithX402 = payWithX402;
|
|
4987
5102
|
exports.planPackage = planPackage;
|
|
4988
5103
|
exports.postOpenJob = postOpenJob;
|
|
5104
|
+
exports.preflightClaimOpening = preflightClaimOpening;
|
|
4989
5105
|
exports.preflightCreateJob = preflightCreateJob;
|
|
4990
5106
|
exports.preflightCreateOpening = preflightCreateOpening;
|
|
4991
5107
|
exports.preflightFail = preflightFail;
|
|
@@ -5018,6 +5134,8 @@ exports.saveBech32 = saveBech32;
|
|
|
5018
5134
|
exports.saveKey = saveKey;
|
|
5019
5135
|
exports.selectAndSplitCoin = selectAndSplitCoin;
|
|
5020
5136
|
exports.selectSuiCoin = selectSuiCoin;
|
|
5137
|
+
exports.sellerLevel = sellerLevel;
|
|
5138
|
+
exports.sellerLevelLabel = sellerLevelLabel;
|
|
5021
5139
|
exports.serializeCetusRoute = serializeCetusRoute;
|
|
5022
5140
|
exports.serviceChallengeMessage = serviceChallengeMessage;
|
|
5023
5141
|
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:
|