@t2000/sdk 10.38.2 → 10.40.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 +370 -8
- package/dist/browser.d.cts +1 -1
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +356 -9
- package/dist/{commerce-D14qzqAV.d.cts → commerce-3ztE5Gg3.d.cts} +178 -8
- package/dist/{commerce-D14qzqAV.d.ts → commerce-3ztE5Gg3.d.ts} +178 -8
- package/dist/index.cjs +322 -1
- package/dist/index.d.cts +43 -4
- package/dist/index.d.ts +43 -4
- package/dist/index.js +302 -2
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -3005,7 +3005,7 @@ init_coinSelection();
|
|
|
3005
3005
|
init_errors();
|
|
3006
3006
|
init_token_registry();
|
|
3007
3007
|
init_coinSelection();
|
|
3008
|
-
var MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID = "
|
|
3008
|
+
var MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID = "0x1f88ca77b1980e3d0750e83d1363c6025cd677c2f420cae51a86d4a0bddf93c5";
|
|
3009
3009
|
var MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID = MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID;
|
|
3010
3010
|
var A2A_ESCROW_LATEST_PACKAGE_ID = process.env.A2A_ESCROW_OPENING_PACKAGE_ID ?? process.env.A2A_ESCROW_PACKAGE_ID ?? MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID;
|
|
3011
3011
|
var A2A_ESCROW_OPENING_PACKAGE_ID = A2A_ESCROW_LATEST_PACKAGE_ID;
|
|
@@ -3015,6 +3015,8 @@ var A2A_ESCROW_PACKAGE_V6_ID = "0xb065033b6f72c4899055a0b3afac28f09dc7b0b7b491ea
|
|
|
3015
3015
|
var A2A_ESCROW_PACKAGE_V7_ID = "0x4249f0b242c47c7baf0c37304365bc4bbe769bcedf11f3525e84682d59a3b23e";
|
|
3016
3016
|
var A2A_ESCROW_PACKAGE_V8_ID = "0x1595b80bc05a03607f3908702c866ca63cf961025b4263b5ecbe419e07f8ff31";
|
|
3017
3017
|
var A2A_ESCROW_PACKAGE_V10_ID = process.env.A2A_ESCROW_PACKAGE_V10_ID ?? "0x5c90ec07da01bf885a4e65247ce98b75ab8a042cd965d30d7213856d579c4afa";
|
|
3018
|
+
var A2A_ESCROW_PACKAGE_V11_ID = process.env.A2A_ESCROW_PACKAGE_V11_ID ?? "0x2a928916c859a159e6d6f4841073a31397d01336c1ea689ce74344e456463c8d";
|
|
3019
|
+
var A2A_ESCROW_PACKAGE_V12_ID = process.env.A2A_ESCROW_PACKAGE_V12_ID ?? "0x1f88ca77b1980e3d0750e83d1363c6025cd677c2f420cae51a86d4a0bddf93c5";
|
|
3018
3020
|
var CLOCK_ID2 = "0x6";
|
|
3019
3021
|
var MODULE = "opening";
|
|
3020
3022
|
var SHA256_HEX_RE = /^(0x)?[0-9a-fA-F]{64}$/;
|
|
@@ -3345,6 +3347,29 @@ function buildDeclineJobTx(jobId) {
|
|
|
3345
3347
|
}
|
|
3346
3348
|
function buildRejectJobTx(jobId, v2) {
|
|
3347
3349
|
const tx = new transactions.Transaction();
|
|
3350
|
+
if (v2.batchId) {
|
|
3351
|
+
tx.moveCall({
|
|
3352
|
+
target: `${A2A_ESCROW_LATEST_PACKAGE_ID}::batch::${v2.buyerScoreId ? "batch_reject_agent_buyer" : "batch_reject"}`,
|
|
3353
|
+
typeArguments: [exports.USDC_TYPE],
|
|
3354
|
+
arguments: v2.buyerScoreId ? [
|
|
3355
|
+
tx.object(v2.batchId),
|
|
3356
|
+
tx.object(jobId),
|
|
3357
|
+
tx.object(v2.sellerScoreId),
|
|
3358
|
+
tx.object(v2.buyerScoreId),
|
|
3359
|
+
tx.object(v2.registryId),
|
|
3360
|
+
feeConfigArg2(tx),
|
|
3361
|
+
tx.object(CLOCK_ID3)
|
|
3362
|
+
] : [
|
|
3363
|
+
tx.object(v2.batchId),
|
|
3364
|
+
tx.object(jobId),
|
|
3365
|
+
tx.object(v2.sellerScoreId),
|
|
3366
|
+
tx.object(v2.registryId),
|
|
3367
|
+
feeConfigArg2(tx),
|
|
3368
|
+
tx.object(CLOCK_ID3)
|
|
3369
|
+
]
|
|
3370
|
+
});
|
|
3371
|
+
return tx;
|
|
3372
|
+
}
|
|
3348
3373
|
tx.moveCall({
|
|
3349
3374
|
target: `${A2A_ESCROW_LATEST_PACKAGE_ID}::reputation::${v2.buyerScoreId ? "reject_v2_agent_buyer" : "reject_v2"}`,
|
|
3350
3375
|
typeArguments: [exports.USDC_TYPE],
|
|
@@ -3367,6 +3392,20 @@ function buildRejectJobTx(jobId, v2) {
|
|
|
3367
3392
|
}
|
|
3368
3393
|
function buildRefundJobTx(jobId, v2) {
|
|
3369
3394
|
const tx = new transactions.Transaction();
|
|
3395
|
+
if (v2.batchId) {
|
|
3396
|
+
tx.moveCall({
|
|
3397
|
+
target: `${A2A_ESCROW_LATEST_PACKAGE_ID}::batch::batch_refund`,
|
|
3398
|
+
typeArguments: [exports.USDC_TYPE],
|
|
3399
|
+
arguments: [
|
|
3400
|
+
tx.object(v2.batchId),
|
|
3401
|
+
tx.object(jobId),
|
|
3402
|
+
tx.object(v2.sellerScoreId),
|
|
3403
|
+
feeConfigArg2(tx),
|
|
3404
|
+
tx.object(CLOCK_ID3)
|
|
3405
|
+
]
|
|
3406
|
+
});
|
|
3407
|
+
return tx;
|
|
3408
|
+
}
|
|
3370
3409
|
tx.moveCall({
|
|
3371
3410
|
target: `${A2A_ESCROW_LATEST_PACKAGE_ID}::reputation::refund_v2`,
|
|
3372
3411
|
typeArguments: [exports.USDC_TYPE],
|
|
@@ -3395,6 +3434,20 @@ function buildDeliverJobTx(jobId, deliveryHash) {
|
|
|
3395
3434
|
}
|
|
3396
3435
|
function buildReleaseJobTx(jobId, v2) {
|
|
3397
3436
|
const tx = new transactions.Transaction();
|
|
3437
|
+
if (v2.batchId) {
|
|
3438
|
+
tx.moveCall({
|
|
3439
|
+
target: `${A2A_ESCROW_LATEST_PACKAGE_ID}::batch::batch_release`,
|
|
3440
|
+
typeArguments: [exports.USDC_TYPE],
|
|
3441
|
+
arguments: [
|
|
3442
|
+
tx.object(v2.batchId),
|
|
3443
|
+
tx.object(jobId),
|
|
3444
|
+
tx.object(v2.sellerScoreId),
|
|
3445
|
+
feeConfigArg2(tx),
|
|
3446
|
+
tx.object(CLOCK_ID3)
|
|
3447
|
+
]
|
|
3448
|
+
});
|
|
3449
|
+
return tx;
|
|
3450
|
+
}
|
|
3398
3451
|
tx.moveCall({
|
|
3399
3452
|
target: `${A2A_ESCROW_LATEST_PACKAGE_ID}::reputation::release_v2`,
|
|
3400
3453
|
typeArguments: [exports.USDC_TYPE],
|
|
@@ -3444,6 +3497,26 @@ async function getJob(client, jobId) {
|
|
|
3444
3497
|
createdAtMs: Number(json.created_at_ms)
|
|
3445
3498
|
};
|
|
3446
3499
|
}
|
|
3500
|
+
var BATCH_ORIGIN_KEY_TYPE_SUFFIX = "::escrow::BatchOriginKey";
|
|
3501
|
+
async function getJobBatchOrigin(client, jobId) {
|
|
3502
|
+
let cursor = null;
|
|
3503
|
+
do {
|
|
3504
|
+
const page = await client.core.listDynamicFields({
|
|
3505
|
+
parentId: jobId,
|
|
3506
|
+
cursor: cursor ?? void 0
|
|
3507
|
+
});
|
|
3508
|
+
for (const field of page.dynamicFields) {
|
|
3509
|
+
if (!field.name.type.endsWith(BATCH_ORIGIN_KEY_TYPE_SUFFIX)) continue;
|
|
3510
|
+
const resp = await client.core.getDynamicField({
|
|
3511
|
+
parentId: jobId,
|
|
3512
|
+
name: field.name
|
|
3513
|
+
});
|
|
3514
|
+
return bcs.bcs.Address.parse(resp.dynamicField.value.bcs);
|
|
3515
|
+
}
|
|
3516
|
+
cursor = page.hasNextPage ? page.cursor : null;
|
|
3517
|
+
} while (cursor);
|
|
3518
|
+
return null;
|
|
3519
|
+
}
|
|
3447
3520
|
function jobActionsFor(job, caller, nowMs = Date.now()) {
|
|
3448
3521
|
const me = validateAddress(caller);
|
|
3449
3522
|
const isBuyer = me === job.buyer;
|
|
@@ -3483,6 +3556,11 @@ async function verifyJobForSeller({
|
|
|
3483
3556
|
return { ok: problems.length === 0, job, problems };
|
|
3484
3557
|
}
|
|
3485
3558
|
|
|
3559
|
+
// src/wallet/batch.ts
|
|
3560
|
+
init_errors();
|
|
3561
|
+
init_token_registry();
|
|
3562
|
+
init_coinSelection();
|
|
3563
|
+
|
|
3486
3564
|
// src/wallet/reputation.ts
|
|
3487
3565
|
init_errors();
|
|
3488
3566
|
init_token_registry();
|
|
@@ -3696,6 +3774,210 @@ function buildSubmitFirstReviewTx({
|
|
|
3696
3774
|
return tx;
|
|
3697
3775
|
}
|
|
3698
3776
|
|
|
3777
|
+
// src/wallet/batch.ts
|
|
3778
|
+
var MODULE4 = "batch";
|
|
3779
|
+
var CLOCK_ID5 = "0x6";
|
|
3780
|
+
var MAX_BATCH_SLOTS_DEFAULT = 250;
|
|
3781
|
+
var BATCH_OPENING_TYPE_MARKER = "::batch::BatchOpening<";
|
|
3782
|
+
var BATCH_ABORT_CODES = {
|
|
3783
|
+
/** At your wave cap RIGHT NOW — min(buyer ceiling, level cap) active
|
|
3784
|
+
* holds. Settle one to reclaim; never "lifetime". */
|
|
3785
|
+
EMaxClaimsReached: 12,
|
|
3786
|
+
/** Pre-S.1202 wave — lifetime rows never free, so new claims refuse.
|
|
3787
|
+
* The wave's cancel / expired-refund still work. */
|
|
3788
|
+
ELegacyBatch: 22,
|
|
3789
|
+
/** The Job passed to a batch settle door has no BatchOriginKey. */
|
|
3790
|
+
ENotBatchJob: 23,
|
|
3791
|
+
/** The attached wave is not this Job's origin batch. */
|
|
3792
|
+
EWrongBatch: 24,
|
|
3793
|
+
EWrongSellerScore: 25,
|
|
3794
|
+
EWrongBuyerScore: 26,
|
|
3795
|
+
/** Registered Agent-ID buyer must reject via the agent-buyer variant. */
|
|
3796
|
+
EBuyerIsAgent: 27,
|
|
3797
|
+
EBuyerNotAgent: 28
|
|
3798
|
+
};
|
|
3799
|
+
var REPUTATION_ABORT_CODES = {
|
|
3800
|
+
/** A bare v2 door (release_v2 / reject_v2 variants / refund_v2) on a
|
|
3801
|
+
* batch-origin Job — the client must attach the batch and settle via
|
|
3802
|
+
* the batch doors. */
|
|
3803
|
+
EUseBatchSettle: 9
|
|
3804
|
+
};
|
|
3805
|
+
var ESCROW_ABORT_CODES = {
|
|
3806
|
+
/** Stale package flow (FeeConfig VERSION moved) — update @t2000/*. */
|
|
3807
|
+
EWrongVersion: 13,
|
|
3808
|
+
/** Second wave-hold free on one Job (unreachable via the doors). */
|
|
3809
|
+
EBatchHoldReleased: 23
|
|
3810
|
+
};
|
|
3811
|
+
function preflightCreateBatchOpening(terms) {
|
|
3812
|
+
const single = preflightCreateOpening(terms);
|
|
3813
|
+
if (!single.valid) return single;
|
|
3814
|
+
if (!Number.isInteger(terms.slots) || terms.slots < 1 || terms.slots > MAX_BATCH_SLOTS_DEFAULT) {
|
|
3815
|
+
return {
|
|
3816
|
+
valid: false,
|
|
3817
|
+
code: "INVALID_INPUT",
|
|
3818
|
+
error: `slots must be an integer 1\u2013${MAX_BATCH_SLOTS_DEFAULT} (the live max is AdminCap-tunable on-chain).`
|
|
3819
|
+
};
|
|
3820
|
+
}
|
|
3821
|
+
const maxClaims = terms.maxClaimsPerAgent ?? 1;
|
|
3822
|
+
if (!Number.isInteger(maxClaims) || maxClaims < 1 || maxClaims > terms.slots) {
|
|
3823
|
+
return {
|
|
3824
|
+
valid: false,
|
|
3825
|
+
code: "INVALID_INPUT",
|
|
3826
|
+
error: "maxClaimsPerAgent must be an integer \u22651 and \u2264 slots."
|
|
3827
|
+
};
|
|
3828
|
+
}
|
|
3829
|
+
return { valid: true };
|
|
3830
|
+
}
|
|
3831
|
+
async function buildCreateBatchOpeningTx({
|
|
3832
|
+
client,
|
|
3833
|
+
buyer,
|
|
3834
|
+
terms
|
|
3835
|
+
}) {
|
|
3836
|
+
const pf = preflightCreateBatchOpening(terms);
|
|
3837
|
+
if (!pf.valid) throw new exports.T2000Error(pf.code ?? "INVALID_INPUT", pf.error ?? "Invalid batch.");
|
|
3838
|
+
const perSlotRaw = BigInt(Math.floor(terms.amountUsdc * 10 ** USDC_DECIMALS));
|
|
3839
|
+
const totalRaw = perSlotRaw * BigInt(terms.slots);
|
|
3840
|
+
const tx = new transactions.Transaction();
|
|
3841
|
+
const { coin } = await selectAndSplitCoin(
|
|
3842
|
+
tx,
|
|
3843
|
+
client,
|
|
3844
|
+
validateAddress(buyer),
|
|
3845
|
+
exports.USDC_TYPE,
|
|
3846
|
+
totalRaw,
|
|
3847
|
+
{ allowSwapAll: false }
|
|
3848
|
+
);
|
|
3849
|
+
tx.moveCall({
|
|
3850
|
+
target: `${A2A_ESCROW_OPENING_PACKAGE_ID}::${MODULE4}::create_batch_open`,
|
|
3851
|
+
typeArguments: [exports.USDC_TYPE],
|
|
3852
|
+
arguments: [
|
|
3853
|
+
coin,
|
|
3854
|
+
tx.pure.u64(terms.slots),
|
|
3855
|
+
tx.pure.vector("u8", hexToBytes3(terms.specHash)),
|
|
3856
|
+
tx.pure.u64(terms.openUntilMs),
|
|
3857
|
+
tx.pure.u64(terms.slaMs),
|
|
3858
|
+
tx.pure.u64(terms.reviewWindowMs),
|
|
3859
|
+
tx.pure.u64(terms.rejectSplitBps),
|
|
3860
|
+
tx.pure.u8(terms.claimPolicy ?? OPENING_CLAIM_POLICY_ANY_ACTIVE),
|
|
3861
|
+
tx.pure.u8(terms.minSellerLevel ?? 0),
|
|
3862
|
+
tx.pure.u8(terms.maxClaimsPerAgent ?? 1),
|
|
3863
|
+
feeConfigArg(tx),
|
|
3864
|
+
tx.object(CLOCK_ID5)
|
|
3865
|
+
]
|
|
3866
|
+
});
|
|
3867
|
+
return tx;
|
|
3868
|
+
}
|
|
3869
|
+
function buildBatchClaimTx({
|
|
3870
|
+
batchId,
|
|
3871
|
+
registryId,
|
|
3872
|
+
scoreId
|
|
3873
|
+
}) {
|
|
3874
|
+
if (!scoreId) {
|
|
3875
|
+
throw new exports.T2000Error(
|
|
3876
|
+
"INVALID_INPUT",
|
|
3877
|
+
"Claiming needs the claimer's own AgentScore id (derive with deriveAgentScoreId; create it first with buildCreateEmptyScoreTx when missing)."
|
|
3878
|
+
);
|
|
3879
|
+
}
|
|
3880
|
+
const tx = new transactions.Transaction();
|
|
3881
|
+
tx.moveCall({
|
|
3882
|
+
target: `${A2A_ESCROW_OPENING_PACKAGE_ID}::${MODULE4}::batch_claim`,
|
|
3883
|
+
typeArguments: [exports.USDC_TYPE],
|
|
3884
|
+
arguments: [
|
|
3885
|
+
tx.object(batchId),
|
|
3886
|
+
tx.object(registryId),
|
|
3887
|
+
tx.object(scoreId),
|
|
3888
|
+
feeConfigArg(tx),
|
|
3889
|
+
tx.object(CLOCK_ID5)
|
|
3890
|
+
]
|
|
3891
|
+
});
|
|
3892
|
+
return tx;
|
|
3893
|
+
}
|
|
3894
|
+
function batchCall(batchId, fn) {
|
|
3895
|
+
const tx = new transactions.Transaction();
|
|
3896
|
+
tx.moveCall({
|
|
3897
|
+
target: `${A2A_ESCROW_OPENING_PACKAGE_ID}::${MODULE4}::${fn}`,
|
|
3898
|
+
typeArguments: [exports.USDC_TYPE],
|
|
3899
|
+
arguments: [tx.object(batchId), feeConfigArg(tx), tx.object(CLOCK_ID5)]
|
|
3900
|
+
});
|
|
3901
|
+
return tx;
|
|
3902
|
+
}
|
|
3903
|
+
function buildCancelBatchOpeningTx(batchId) {
|
|
3904
|
+
return batchCall(batchId, "cancel_batch_open");
|
|
3905
|
+
}
|
|
3906
|
+
function buildRefundBatchExpiredTx(batchId) {
|
|
3907
|
+
return batchCall(batchId, "refund_batch_expired");
|
|
3908
|
+
}
|
|
3909
|
+
function bytesToHex3(bytes) {
|
|
3910
|
+
return `0x${Array.from(bytes).map((b) => b.toString(16).padStart(2, "0")).join("")}`;
|
|
3911
|
+
}
|
|
3912
|
+
function hexToBytes3(hex) {
|
|
3913
|
+
const clean = hex.replace(/^0x/, "");
|
|
3914
|
+
const bytes = [];
|
|
3915
|
+
for (let i = 0; i < clean.length; i += 2) {
|
|
3916
|
+
bytes.push(Number.parseInt(clean.slice(i, i + 2), 16));
|
|
3917
|
+
}
|
|
3918
|
+
return bytes;
|
|
3919
|
+
}
|
|
3920
|
+
async function getBatchOpening(client, batchId) {
|
|
3921
|
+
const resp = await client.core.getObject({ objectId: batchId, include: { json: true } }).catch(() => null);
|
|
3922
|
+
const objType = resp?.object?.type ?? "";
|
|
3923
|
+
const json = resp?.object?.json;
|
|
3924
|
+
if (!json || !objType.includes(BATCH_OPENING_TYPE_MARKER)) {
|
|
3925
|
+
return null;
|
|
3926
|
+
}
|
|
3927
|
+
const table = json.claims_by_agent;
|
|
3928
|
+
return {
|
|
3929
|
+
id: batchId,
|
|
3930
|
+
buyer: String(json.buyer),
|
|
3931
|
+
amountUsdc: Number(json.amount) / 10 ** USDC_DECIMALS,
|
|
3932
|
+
slotsTotal: Number(json.slots_total),
|
|
3933
|
+
slotsRemaining: Number(json.slots_remaining),
|
|
3934
|
+
feeBps: Number(json.fee_bps ?? 0),
|
|
3935
|
+
specHash: bytesToHex3(json.spec_hash ?? []),
|
|
3936
|
+
openUntilMs: Number(json.open_until_ms),
|
|
3937
|
+
slaMs: Number(json.sla_ms),
|
|
3938
|
+
reviewWindowMs: Number(json.review_window_ms),
|
|
3939
|
+
rejectSplitBps: Number(json.reject_split_bps),
|
|
3940
|
+
claimPolicy: Number(json.claim_policy ?? 0),
|
|
3941
|
+
minSellerLevel: Number(json.min_seller_level ?? 0),
|
|
3942
|
+
maxClaimsPerAgent: Number(json.max_claims_per_agent ?? 1),
|
|
3943
|
+
claimsTableId: table?.id ? String(table.id) : null,
|
|
3944
|
+
createdAtMs: Number(json.created_at_ms ?? 0)
|
|
3945
|
+
};
|
|
3946
|
+
}
|
|
3947
|
+
async function getBatchClaimsByAgent(client, batch, agent) {
|
|
3948
|
+
if (!batch.claimsTableId) return 0;
|
|
3949
|
+
try {
|
|
3950
|
+
const fieldId = utils.deriveDynamicFieldID(
|
|
3951
|
+
batch.claimsTableId,
|
|
3952
|
+
"address",
|
|
3953
|
+
bcs.bcs.Address.serialize(validateAddress(agent)).toBytes()
|
|
3954
|
+
);
|
|
3955
|
+
const resp = await client.core.getObject({
|
|
3956
|
+
objectId: fieldId,
|
|
3957
|
+
include: { json: true }
|
|
3958
|
+
});
|
|
3959
|
+
const json = resp?.object?.json;
|
|
3960
|
+
return Number(json?.value ?? 0);
|
|
3961
|
+
} catch {
|
|
3962
|
+
return 0;
|
|
3963
|
+
}
|
|
3964
|
+
}
|
|
3965
|
+
function preflightBatchClaim(score, batch, myClaims) {
|
|
3966
|
+
if (batch.slotsRemaining <= 0) {
|
|
3967
|
+
return {
|
|
3968
|
+
valid: false,
|
|
3969
|
+
error: "No slots left on this batch \u2014 every slot is claimed. Find open waves on the board."
|
|
3970
|
+
};
|
|
3971
|
+
}
|
|
3972
|
+
if (myClaims >= batch.maxClaimsPerAgent) {
|
|
3973
|
+
return {
|
|
3974
|
+
valid: false,
|
|
3975
|
+
error: `This wave allows ${batch.maxClaimsPerAgent} slot${batch.maxClaimsPerAgent === 1 ? "" : "s"} per agent and this wallet already holds ${myClaims}. Deliver what you claimed; other waves on the board are open.`
|
|
3976
|
+
};
|
|
3977
|
+
}
|
|
3978
|
+
return preflightClaimOpening(score, batch);
|
|
3979
|
+
}
|
|
3980
|
+
|
|
3699
3981
|
// src/commerce.ts
|
|
3700
3982
|
var DEFAULT_COMMERCE_API_BASE = "https://api.t2000.ai/v1";
|
|
3701
3983
|
async function commerceFetchJson(url, init) {
|
|
@@ -3971,6 +4253,24 @@ function refundOpenJob(base, signer, openingId) {
|
|
|
3971
4253
|
openingId: openingId.trim()
|
|
3972
4254
|
});
|
|
3973
4255
|
}
|
|
4256
|
+
function postBatchOpenJob(base, signer, input) {
|
|
4257
|
+
return sponsoredOpeningVerb(base, signer, "batch-open-create", input);
|
|
4258
|
+
}
|
|
4259
|
+
function claimBatchOpenJob(base, signer, batchId) {
|
|
4260
|
+
return sponsoredOpeningVerb(base, signer, "batch-open-claim", {
|
|
4261
|
+
batchId: batchId.trim()
|
|
4262
|
+
});
|
|
4263
|
+
}
|
|
4264
|
+
function cancelBatchOpenJob(base, signer, batchId) {
|
|
4265
|
+
return sponsoredOpeningVerb(base, signer, "batch-open-cancel", {
|
|
4266
|
+
batchId: batchId.trim()
|
|
4267
|
+
});
|
|
4268
|
+
}
|
|
4269
|
+
function refundBatchOpenJob(base, signer, batchId) {
|
|
4270
|
+
return sponsoredOpeningVerb(base, signer, "batch-open-refund", {
|
|
4271
|
+
batchId: batchId.trim()
|
|
4272
|
+
});
|
|
4273
|
+
}
|
|
3974
4274
|
|
|
3975
4275
|
// src/commerce/endpoint.ts
|
|
3976
4276
|
init_errors();
|
|
@@ -4917,6 +5217,8 @@ exports.A2A_ESCROW_LATEST_PACKAGE_ID = A2A_ESCROW_LATEST_PACKAGE_ID;
|
|
|
4917
5217
|
exports.A2A_ESCROW_OPENING_PACKAGE_ID = A2A_ESCROW_OPENING_PACKAGE_ID;
|
|
4918
5218
|
exports.A2A_ESCROW_PACKAGE_ID = A2A_ESCROW_PACKAGE_ID;
|
|
4919
5219
|
exports.A2A_ESCROW_PACKAGE_V10_ID = A2A_ESCROW_PACKAGE_V10_ID;
|
|
5220
|
+
exports.A2A_ESCROW_PACKAGE_V11_ID = A2A_ESCROW_PACKAGE_V11_ID;
|
|
5221
|
+
exports.A2A_ESCROW_PACKAGE_V12_ID = A2A_ESCROW_PACKAGE_V12_ID;
|
|
4920
5222
|
exports.A2A_ESCROW_PACKAGE_V2_ID = A2A_ESCROW_PACKAGE_V2_ID;
|
|
4921
5223
|
exports.A2A_ESCROW_PACKAGE_V3_ID = A2A_ESCROW_PACKAGE_V3_ID;
|
|
4922
5224
|
exports.A2A_ESCROW_PACKAGE_V6_ID = A2A_ESCROW_PACKAGE_V6_ID;
|
|
@@ -4927,6 +5229,9 @@ exports.AGENT_CATEGORIES = AGENT_CATEGORIES;
|
|
|
4927
5229
|
exports.AUDRIC_PARENT = AUDRIC_PARENT;
|
|
4928
5230
|
exports.AUDRIC_PARENT_NAME = AUDRIC_PARENT_NAME;
|
|
4929
5231
|
exports.AUDRIC_PARENT_NFT_ID = AUDRIC_PARENT_NFT_ID;
|
|
5232
|
+
exports.BATCH_ABORT_CODES = BATCH_ABORT_CODES;
|
|
5233
|
+
exports.BATCH_OPENING_TYPE_MARKER = BATCH_OPENING_TYPE_MARKER;
|
|
5234
|
+
exports.BATCH_ORIGIN_KEY_TYPE_SUFFIX = BATCH_ORIGIN_KEY_TYPE_SUFFIX;
|
|
4930
5235
|
exports.CETUS_USDC_SUI_POOL = CETUS_USDC_SUI_POOL;
|
|
4931
5236
|
exports.CLOCK_ID = CLOCK_ID;
|
|
4932
5237
|
exports.CommerceClient = CommerceClient;
|
|
@@ -4935,6 +5240,7 @@ exports.DEFAULT_API_BASE = DEFAULT_API_BASE;
|
|
|
4935
5240
|
exports.DEFAULT_COMMERCE_API_BASE = DEFAULT_COMMERCE_API_BASE;
|
|
4936
5241
|
exports.DEFAULT_GRPC_URL = DEFAULT_GRPC_URL;
|
|
4937
5242
|
exports.DEFAULT_NETWORK = DEFAULT_NETWORK;
|
|
5243
|
+
exports.ESCROW_ABORT_CODES = ESCROW_ABORT_CODES;
|
|
4938
5244
|
exports.ESCROW_JOB_TYPE_MARKER = ESCROW_JOB_TYPE_MARKER;
|
|
4939
5245
|
exports.GASLESS_MIN_STABLE_AMOUNT = GASLESS_MIN_STABLE_AMOUNT;
|
|
4940
5246
|
exports.GASLESS_STABLE_TYPES = GASLESS_STABLE_TYPES;
|
|
@@ -4952,6 +5258,7 @@ exports.MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID = MAINNET_A2A_ESCROW_LATEST_PACKAGE
|
|
|
4952
5258
|
exports.MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID = MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID;
|
|
4953
5259
|
exports.MAINNET_A2A_ESCROW_PACKAGE_ID = MAINNET_A2A_ESCROW_PACKAGE_ID;
|
|
4954
5260
|
exports.MAINNET_A2A_SCORE_BOARD_ID = MAINNET_A2A_SCORE_BOARD_ID;
|
|
5261
|
+
exports.MAX_BATCH_SLOTS_DEFAULT = MAX_BATCH_SLOTS_DEFAULT;
|
|
4955
5262
|
exports.MAX_DELIVER_HORIZON_MS = MAX_DELIVER_HORIZON_MS;
|
|
4956
5263
|
exports.MAX_JOB_USDC = MAX_JOB_USDC;
|
|
4957
5264
|
exports.MAX_OPEN_WINDOW_MS = MAX_OPEN_WINDOW_MS;
|
|
@@ -4969,6 +5276,7 @@ exports.OPENING_TYPE_MARKER = OPENING_TYPE_MARKER;
|
|
|
4969
5276
|
exports.OPERATION_ASSETS = OPERATION_ASSETS;
|
|
4970
5277
|
exports.PROVEN_MIN_AVG_STARS_X10 = PROVEN_MIN_AVG_STARS_X10;
|
|
4971
5278
|
exports.PROVEN_MIN_REVIEWS = PROVEN_MIN_REVIEWS;
|
|
5279
|
+
exports.REPUTATION_ABORT_CODES = REPUTATION_ABORT_CODES;
|
|
4972
5280
|
exports.REVIEW_MAX_STARS = REVIEW_MAX_STARS;
|
|
4973
5281
|
exports.REVIEW_MIN_STARS = REVIEW_MIN_STARS;
|
|
4974
5282
|
exports.SELLER_LEVEL_ACTIVE_CAPS = SELLER_LEVEL_ACTIVE_CAPS;
|
|
@@ -4998,13 +5306,17 @@ exports.assertAllowedAsset = assertAllowedAsset;
|
|
|
4998
5306
|
exports.assertBuyerRequirements = assertBuyerRequirements;
|
|
4999
5307
|
exports.assertLimitConfig = assertLimitConfig;
|
|
5000
5308
|
exports.buildAddLeafTx = buildAddLeafTx;
|
|
5309
|
+
exports.buildBatchClaimTx = buildBatchClaimTx;
|
|
5310
|
+
exports.buildCancelBatchOpeningTx = buildCancelBatchOpeningTx;
|
|
5001
5311
|
exports.buildCancelOpeningTx = buildCancelOpeningTx;
|
|
5002
5312
|
exports.buildClaimOpeningTx = buildClaimOpeningTx;
|
|
5313
|
+
exports.buildCreateBatchOpeningTx = buildCreateBatchOpeningTx;
|
|
5003
5314
|
exports.buildCreateEmptyScoreTx = buildCreateEmptyScoreTx;
|
|
5004
5315
|
exports.buildCreateJobTx = buildCreateJobTx;
|
|
5005
5316
|
exports.buildCreateOpeningTx = buildCreateOpeningTx;
|
|
5006
5317
|
exports.buildDeclineJobTx = buildDeclineJobTx;
|
|
5007
5318
|
exports.buildDeliverJobTx = buildDeliverJobTx;
|
|
5319
|
+
exports.buildRefundBatchExpiredTx = buildRefundBatchExpiredTx;
|
|
5008
5320
|
exports.buildRefundJobTx = buildRefundJobTx;
|
|
5009
5321
|
exports.buildRefundUnclaimedTx = buildRefundUnclaimedTx;
|
|
5010
5322
|
exports.buildRejectJobTx = buildRejectJobTx;
|
|
@@ -5014,12 +5326,14 @@ exports.buildSendTx = buildSendTx;
|
|
|
5014
5326
|
exports.buildSubmitFirstReviewTx = buildSubmitFirstReviewTx;
|
|
5015
5327
|
exports.buildSubmitReviewTx = buildSubmitReviewTx;
|
|
5016
5328
|
exports.buildSwapTx = buildSwapTx;
|
|
5329
|
+
exports.cancelBatchOpenJob = cancelBatchOpenJob;
|
|
5017
5330
|
exports.cancelOpenJob = cancelOpenJob;
|
|
5018
5331
|
exports.canonicalizeRecipientInput = canonicalizeRecipientInput;
|
|
5019
5332
|
exports.chatCompletion = chatCompletion;
|
|
5020
5333
|
exports.chatCompletionStream = chatCompletionStream;
|
|
5021
5334
|
exports.checkPositiveAmount = checkPositiveAmount;
|
|
5022
5335
|
exports.checkSuiAddress = checkSuiAddress;
|
|
5336
|
+
exports.claimBatchOpenJob = claimBatchOpenJob;
|
|
5023
5337
|
exports.claimOpenJob = claimOpenJob;
|
|
5024
5338
|
exports.claimPolicyLabel = claimPolicyLabel;
|
|
5025
5339
|
exports.claimPolicyRequirement = claimPolicyRequirement;
|
|
@@ -5058,10 +5372,13 @@ exports.generateKeypair = generateKeypair;
|
|
|
5058
5372
|
exports.getAddress = getAddress;
|
|
5059
5373
|
exports.getAgentProfile = getAgentProfile;
|
|
5060
5374
|
exports.getAgentScore = getAgentScore;
|
|
5375
|
+
exports.getBatchClaimsByAgent = getBatchClaimsByAgent;
|
|
5376
|
+
exports.getBatchOpening = getBatchOpening;
|
|
5061
5377
|
exports.getCoinMeta = getCoinMeta;
|
|
5062
5378
|
exports.getDecimals = getDecimals;
|
|
5063
5379
|
exports.getDecimalsForCoinType = getDecimalsForCoinType;
|
|
5064
5380
|
exports.getJob = getJob;
|
|
5381
|
+
exports.getJobBatchOrigin = getJobBatchOrigin;
|
|
5065
5382
|
exports.getJobSpec = getJobSpec;
|
|
5066
5383
|
exports.getLimits = getLimits;
|
|
5067
5384
|
exports.getOpenJob = getOpenJob;
|
|
@@ -5100,8 +5417,11 @@ exports.parseServiceTierSlug = parseServiceTierSlug;
|
|
|
5100
5417
|
exports.parseSuiRpcTx = parseSuiRpcTx;
|
|
5101
5418
|
exports.payWithX402 = payWithX402;
|
|
5102
5419
|
exports.planPackage = planPackage;
|
|
5420
|
+
exports.postBatchOpenJob = postBatchOpenJob;
|
|
5103
5421
|
exports.postOpenJob = postOpenJob;
|
|
5422
|
+
exports.preflightBatchClaim = preflightBatchClaim;
|
|
5104
5423
|
exports.preflightClaimOpening = preflightClaimOpening;
|
|
5424
|
+
exports.preflightCreateBatchOpening = preflightCreateBatchOpening;
|
|
5105
5425
|
exports.preflightCreateJob = preflightCreateJob;
|
|
5106
5426
|
exports.preflightCreateOpening = preflightCreateOpening;
|
|
5107
5427
|
exports.preflightFail = preflightFail;
|
|
@@ -5119,6 +5439,7 @@ exports.rawToUsdc = rawToUsdc;
|
|
|
5119
5439
|
exports.readLimitsFile = readLimitsFile;
|
|
5120
5440
|
exports.recordDailySpend = recordDailySpend;
|
|
5121
5441
|
exports.refineLendingLabel = refineLendingLabel;
|
|
5442
|
+
exports.refundBatchOpenJob = refundBatchOpenJob;
|
|
5122
5443
|
exports.refundOpenJob = refundOpenJob;
|
|
5123
5444
|
exports.registerAgent = registerAgent;
|
|
5124
5445
|
exports.removeEndpoint = removeEndpoint;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { EventEmitter } from 'eventemitter3';
|
|
2
2
|
import { SuiGrpcClient } from '@mysten/sui/grpc';
|
|
3
3
|
import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
|
|
4
|
-
import {
|
|
5
|
-
export { A as A2A_ESCROW_FEE_CONFIG_ID,
|
|
4
|
+
import { al as T2000Error, bO as T2000Options, as as TransactionSigner, a0 as PayOptions, bP as X402Probe, a1 as PayResult, bQ as SerializedCetusRoute, bR as SwapResult, bS as SwapQuoteResult, ad as SendResult, f as BalanceResponse, ar as TransactionRecord, o as DepositInfo, bT as PaymentRequest, aC as ZkLoginProof, bU as SuiCoreClient, X as OverlayFeeConfig, bV as SponsoredCoinMergeCache, aj as SupportedAsset, ak as SwapRouteResult, bW as SendableAsset } from './commerce-3ztE5Gg3.cjs';
|
|
5
|
+
export { A as A2A_ESCROW_FEE_CONFIG_ID, bX as A2A_ESCROW_LATEST_PACKAGE_ID, bY as A2A_ESCROW_OPENING_PACKAGE_ID, a as A2A_ESCROW_PACKAGE_ID, bZ as A2A_ESCROW_PACKAGE_V10_ID, b_ as A2A_ESCROW_PACKAGE_V11_ID, b$ as A2A_ESCROW_PACKAGE_V12_ID, c0 as A2A_ESCROW_PACKAGE_V2_ID, c1 as A2A_ESCROW_PACKAGE_V3_ID, c2 as A2A_ESCROW_PACKAGE_V6_ID, c3 as A2A_ESCROW_PACKAGE_V7_ID, c4 as A2A_ESCROW_PACKAGE_V8_ID, c5 as A2A_SCORE_BOARD_ID, b as ActivityReportConfig, c as AgentScore, c6 as ApiRouteListing, B as BATCH_ABORT_CODES, d as BATCH_OPENING_TYPE_MARKER, e as BATCH_ORIGIN_KEY_TYPE_SUFFIX, g as BatchOpening, h as BatchOpeningTerms, c7 as CETUS_USDC_SUI_POOL, C as CLOCK_ID, i as COIN_REGISTRY, j as ClassifyBalanceChange, k as ClassifyResult, l as CoinMeta, c8 as CoinPage, D as DEFAULT_ACTIVITY_REPORT_URL, m as DEFAULT_COMMERCE_API_BASE, c9 as DEFAULT_GRPC_URL, n as DEFAULT_NETWORK, E as ESCROW_ABORT_CODES, p as ETH_TYPE, q as ExtractedTransfer, ca as GASLESS_MIN_STABLE_AMOUNT, cb as GASLESS_STABLE_TYPES, G as GAS_RESERVE_MIN, I as IKA_TYPE, J as JOB_STATES, r as Job, s as JobState, t as JobTerms, u as JobVerification, K as KNOWN_TARGETS, v as KeypairSigner, L as LABEL_PATTERNS, w as LEVEL4_MAX_NO_DELIVERY, x as LEVEL4_MIN_REVIEWS, y as LOFI_TYPE, cc as MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID, cd as MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID, ce as MAINNET_A2A_ESCROW_PACKAGE_ID, cf as MAINNET_A2A_SCORE_BOARD_ID, M as MANIFEST_TYPE, z as MAX_BATCH_SLOTS_DEFAULT, F as MAX_DELIVER_HORIZON_MS, H as MAX_JOB_USDC, cg as MAX_OPEN_WINDOW_MS, N as MAX_REVIEW_WINDOW_MS, O as MIN_JOB_USDC, P as MIST_PER_SUI, Q as NAVX_TYPE, R as NO_DELIVERY_REGRESSION_FLOOR, S as OPENING_CLAIM_POLICIES, T as OPENING_CLAIM_POLICY_ANY_ACTIVE, U as OPENING_CLAIM_POLICY_PROVEN, V as OPENING_CLAIM_POLICY_PROVEN_4STAR, ch as OPERATION_ASSETS, W as OVERLAY_FEE_RATE, ci as Opening, cj as OpeningTerms, ck as Operation, Y as PREFLIGHT_MAX_AMOUNT, Z as PREFLIGHT_OK, _ as PROVEN_MIN_AVG_STARS_X10, $ as PROVEN_MIN_REVIEWS, a2 as PreflightResult, a3 as REPUTATION_ABORT_CODES, a4 as REVIEW_MAX_STARS, a5 as REVIEW_MIN_STARS, a6 as SELLER_LEVEL_ACTIVE_CAPS, cl as SENDABLE_ASSETS, a7 as STABLE_ASSETS, a8 as SUI_DECIMALS, a9 as SUI_TYPE, aa as SUPPORTED_ASSETS, cm as SelectAndSplitResult, ab as SellerLevel, ac as SendAssetClass, cn as SerializedCetusRoutePath, co as SerializedRouterDataV3, ae as ServiceListing, cp as ServicesRail, cq as ServicesRow, af as SimulationResult, ag as StableAsset, ah as SuiHolding, ai as SuiRpcTxBlock, am as T2000ErrorCode, an as T2000ErrorData, ao as T2000_OVERLAY_FEE_WALLET, ap as TOKEN_MAP, aq as TransactionLeg, at as TxDirection, au as USDC_DECIMALS, av as USDC_TYPE, aw as USDE_TYPE, ax as USDSUI_TYPE, ay as USDT_TYPE, az as WAL_TYPE, aA as WBTC_TYPE, aB as X402ActivityPayload, aD as ZkLoginSigner, aE as activeCapForLevel, cr as addSendToTx, cs as addSwapToTx, ct as assertAllowedAsset, cu as assertBuyerRequirements, aF as buildBatchClaimTx, aG as buildCancelBatchOpeningTx, cv as buildCancelOpeningTx, cw as buildClaimOpeningTx, aH as buildCreateBatchOpeningTx, cx as buildCreateEmptyScoreTx, aI as buildCreateJobTx, cy as buildCreateOpeningTx, cz as buildDeclineJobTx, aJ as buildDeliverJobTx, aK as buildRefundBatchExpiredTx, aL as buildRefundJobTx, cA as buildRefundUnclaimedTx, aM as buildRejectJobTx, aN as buildReleaseJobTx, aO as buildSendTx, cB as buildSubmitFirstReviewTx, cC as buildSubmitReviewTx, aP as buildSwapTx, aQ as checkPositiveAmount, aR as checkSuiAddress, aS as claimPolicyLabel, aT as claimPolicyRequirement, aU as classifyAction, aV as classifyLabel, aW as classifySendAsset, aX as classifyTransaction, aY as deriveAgentScoreId, cD as deserializeCetusRoute, aZ as effectiveSellerLevel, a_ as executeTx, a$ as extractAllUserLegs, b0 as extractTransferDetails, b1 as extractTxCommands, b2 as extractTxSender, b3 as fallbackLabel, cE as fetchAllCoins, b4 as fetchService, b5 as findSwapRoute, b6 as formatAssetAmount, b7 as formatSui, b8 as formatUsd, b9 as getAgentScore, ba as getBatchClaimsByAgent, bb as getBatchOpening, cF as getCoinMeta, bc as getDecimals, bd as getDecimalsForCoinType, be as getJob, bf as getJobBatchOrigin, bg as getJobSpec, cG as getOpening, cH as getSuiClient, cI as getSuiGrpcClient, bh as invalidSendAssetMessage, cJ as isAllowedAsset, cK as isCetusRouteFresh, cL as isInRegistry, bi as jobActionsFor, bj as listServices, bk as mapMoveAbortCode, bl as mapWalletError, bm as meetsClaimPolicy, bn as meetsMinSellerLevel, bo as mistToSui, cM as normalizeAsset, cN as normalizeCoinType, bp as parseSuiRpcTx, bq as payWithX402, br as preflightBatchClaim, bs as preflightClaimOpening, bt as preflightCreateBatchOpening, bu as preflightCreateJob, cO as preflightCreateOpening, bv as preflightFail, bw as preflightPay, bx as preflightSend, by as preflightSwap, cP as probeX402, bz as putJobSpec, cQ as queryHistory, cR as queryTransaction, bA as rawToStable, bB as rawToUsdc, bC as refineLendingLabel, bD as reportX402Activity, bE as resolveSymbol, bF as resolveTokenType, cS as selectAndSplitCoin, cT as selectSuiCoin, bG as sellerLevel, bH as sellerLevelLabel, cU as serializeCetusRoute, cV as simulateTransaction, bI as stableToRaw, bJ as suiToMist, cW as throwIfSimulationFailed, bK as truncateAddress, bL as usdcToRaw, bM as validateAddress, cX as verifyCetusRouteCoinMatch, bN as verifyJobForSeller } from './commerce-3ztE5Gg3.cjs';
|
|
6
6
|
import { TransactionObjectArgument, Transaction } from '@mysten/sui/transactions';
|
|
7
7
|
import { SuinsClient } from '@mysten/suins';
|
|
8
8
|
import '@mysten/sui/client';
|
|
@@ -535,7 +535,9 @@ interface OpenJobRow {
|
|
|
535
535
|
briefPreview?: string | null;
|
|
536
536
|
maxUsdc: number;
|
|
537
537
|
slaMinutes: number;
|
|
538
|
-
|
|
538
|
+
/** S.1193 adds `filled` — a batch row whose every slot is claimed
|
|
539
|
+
* (terminal; the escrow moved onto the slot Jobs, never refunded). */
|
|
540
|
+
status: 'open' | 'claimed' | 'cancelled' | 'refunded' | 'expired' | 'filled';
|
|
539
541
|
openUntilMs: number;
|
|
540
542
|
seller: string | null;
|
|
541
543
|
sellerAgent: {
|
|
@@ -555,6 +557,16 @@ interface OpenJobRow {
|
|
|
555
557
|
/** S.1192 — minimum EFFECTIVE seller level to claim (render with
|
|
556
558
|
* `sellerLevelLabel`). Absent on pre-S.1192 rows = 0 (no floor). */
|
|
557
559
|
minSellerLevel?: number;
|
|
560
|
+
/** S.1193 — row kind: absent or "single" = one Opening; "batch" = a
|
|
561
|
+
* wave (ONE row for the whole batch — never N duplicate rows). */
|
|
562
|
+
kind?: 'single' | 'batch';
|
|
563
|
+
/** S.1193 — wave size (batch rows only). */
|
|
564
|
+
slotsTotal?: number;
|
|
565
|
+
/** S.1193 — unclaimed slots left (batch rows only; a batch row is
|
|
566
|
+
* claimable while status is open AND slotsRemaining > 0). */
|
|
567
|
+
slotsRemaining?: number;
|
|
568
|
+
/** S.1193 — slots one agent may claim of this wave (batch rows only). */
|
|
569
|
+
maxClaimsPerAgent?: number;
|
|
558
570
|
createdAtMs: number;
|
|
559
571
|
updatedAtMs: number;
|
|
560
572
|
}
|
|
@@ -626,6 +638,33 @@ declare function cancelOpenJob(base: string, signer: TransactionSigner, openingI
|
|
|
626
638
|
/** Permissionless refund crank for an opening past `open_until` — funds can
|
|
627
639
|
* only ever go back to the buyer. */
|
|
628
640
|
declare function refundOpenJob(base: string, signer: TransactionSigner, openingId: string): Promise<string>;
|
|
641
|
+
/** S.1193 — post a WAVE: N homogeneous slots, one tx, one escrow of
|
|
642
|
+
* `slots × maxUsdc`. Each claimed slot becomes a normal Job. `maxUsdc`
|
|
643
|
+
* is PER SLOT (the live job bounds apply per slot); the wave total is
|
|
644
|
+
* bounded by your wallet, not the protocol. */
|
|
645
|
+
declare function postBatchOpenJob(base: string, signer: TransactionSigner, input: {
|
|
646
|
+
title: string;
|
|
647
|
+
brief: string;
|
|
648
|
+
/** PER-SLOT budget in USDC. */
|
|
649
|
+
maxUsdc: number;
|
|
650
|
+
/** Slots in the wave (1..live max, default max 250). */
|
|
651
|
+
slots: number;
|
|
652
|
+
slaMinutes?: number;
|
|
653
|
+
openHours?: number;
|
|
654
|
+
claimPolicy?: number;
|
|
655
|
+
minSellerLevel?: number;
|
|
656
|
+
/** Slots one agent may claim of this wave (default 1). */
|
|
657
|
+
maxClaimsPerAgent?: number;
|
|
658
|
+
}): Promise<string>;
|
|
659
|
+
/** S.1193 — claim ONE slot of a wave (v1 lock: one claim per tx; a
|
|
660
|
+
* `maxClaimsPerAgent > 1` wave means calling this again). Same $0 FCFS
|
|
661
|
+
* and the same Phase C gates as a single claim. */
|
|
662
|
+
declare function claimBatchOpenJob(base: string, signer: TransactionSigner, batchId: string): Promise<string>;
|
|
663
|
+
/** S.1193 — withdraw a wave's UNCLAIMED remainder — fee-free, any time.
|
|
664
|
+
* Already-claimed slots are normal Jobs and are untouched. */
|
|
665
|
+
declare function cancelBatchOpenJob(base: string, signer: TransactionSigner, batchId: string): Promise<string>;
|
|
666
|
+
/** S.1193 — permissionless remainder refund once the wave expires. */
|
|
667
|
+
declare function refundBatchOpenJob(base: string, signer: TransactionSigner, batchId: string): Promise<string>;
|
|
629
668
|
|
|
630
669
|
interface CommerceClientOptions {
|
|
631
670
|
/** The seller's signer — a keypair (`KeypairSigner`) or zkLogin Passport. */
|
|
@@ -1459,4 +1498,4 @@ declare function fullHandle(label: string, parentName?: string): string;
|
|
|
1459
1498
|
*/
|
|
1460
1499
|
declare function displayHandle(label: string, parentName?: string): string;
|
|
1461
1500
|
|
|
1462
|
-
export { AGENT_CATEGORIES, AUDRIC_PARENT, AUDRIC_PARENT_NAME, AUDRIC_PARENT_NFT_ID, type AgentCategory, type AgentProfile, type AgentRef, type ApiModel, type AppenderContext, BalanceResponse, type BuildAddLeafParams, type BuildRevokeLeafParams, type ChatMessage, type ChatParams, type ChatResult, type ChatUsage, CommerceClient, type CommerceClientOptions, type ComposeTxOptions, type ComposeTxResult, type CreatePackageInput, type CreatePackageResult, DEFAULT_API_BASE, type DailySpend, DepositInfo, ESCROW_JOB_TYPE_MARKER, type EndpointIssue, type EndpointListing, type EndpointRoute, InvalidAddressError, type LabelValidationResult, type LimitAssertInput, LimitEnforcer, LimitExceededError, type LimitKind, type LimitOperation, type LimitsConfig, type LimitsFile, MAX_SLUG_LENGTH, MAX_TIER_BASE_LENGTH, type NormalizedAddress, OPENING_TYPE_MARKER, type OpenJobFilter, type OpenJobRow, type OpenJobsPage, OverlayFeeConfig, type PackageTierInput, PayOptions, PayResult, PaymentRequest, type ProfileUpdateInput, type RegisterResult, SERVICE_SLUG_RE, SERVICE_TIERS, SPONSORED_PYTH_DEPENDENT_PROVIDERS, SUINS_NAME_REGEX, SUI_ADDRESS_REGEX, SUI_ADDRESS_STRICT_REGEX, SendResult, type SendTransferInput, SendableAsset, SerializedCetusRoute, type ServiceTier, type ServiceUpsertInput, type ServiceWriteResult, type SponsoredTxGuard, type StepPreview, SuinsNotRegisteredError, type SuinsParent, SuinsRpcError, SupportedAsset, type SwapExecuteInput, SwapQuoteResult, SwapResult, SwapRouteResult, T2000, T2000Error, T2000Options, TransactionRecord, TransactionSigner, WRITE_APPENDER_REGISTRY, type WriteStep, type WriteToolName, X402Probe, ZkLoginProof, agentResolveUrl, approxUsdValue, assertLimitConfig, buildAddLeafTx, buildRevokeLeafTx, cancelOpenJob, canonicalizeRecipientInput, chatCompletion, chatCompletionStream, claimOpenJob, clearLimits, composeTx, createPackage, customHireEnvelope, dailySpentToday, deriveAllowedAddressesFromPtb, displayHandle, endpointIssueLines, ensureCategory, exportPrivateKey, fetchChallengeNonce, fullHandle, generateKeypair, getAddress, getAgentProfile, getLimits, getOpenJob, getSponsoredSwapProviders, getSwapQuote, hasLimits, isCustomHireEnvelope, keypairFromPrivateKey, listEndpoint, listModels, listOpenJobs, loadKey, looksLikeSuiNs, normalizeAddressInput, packageBaseFromName, packageBaseSlug, packageTierSlugs, parseAgentCategory, parseServiceTierSlug, planPackage, postOpenJob, profileChallengeMessage, queryBalance, readLimitsFile, recordDailySpend, refundOpenJob, registerAgent, removeEndpoint, resolveAddressToSuinsViaRpc, resolveAgentRef, resolveCreatedObjectId, resolveSuinsViaRpc, retireService, saveBech32, saveKey, serviceChallengeMessage, servicePayloadSha256, serviceUpsertPayload, setLimits, setSponsoredTxGuard, signChallenge, slugify, slugifyLoner, slugifyUnbounded, submitJobReview, trimDashes, updateProfile, upsertService, validateLabel, walletExists, writeLimitsFile };
|
|
1501
|
+
export { AGENT_CATEGORIES, AUDRIC_PARENT, AUDRIC_PARENT_NAME, AUDRIC_PARENT_NFT_ID, type AgentCategory, type AgentProfile, type AgentRef, type ApiModel, type AppenderContext, BalanceResponse, type BuildAddLeafParams, type BuildRevokeLeafParams, type ChatMessage, type ChatParams, type ChatResult, type ChatUsage, CommerceClient, type CommerceClientOptions, type ComposeTxOptions, type ComposeTxResult, type CreatePackageInput, type CreatePackageResult, DEFAULT_API_BASE, type DailySpend, DepositInfo, ESCROW_JOB_TYPE_MARKER, type EndpointIssue, type EndpointListing, type EndpointRoute, InvalidAddressError, type LabelValidationResult, type LimitAssertInput, LimitEnforcer, LimitExceededError, type LimitKind, type LimitOperation, type LimitsConfig, type LimitsFile, MAX_SLUG_LENGTH, MAX_TIER_BASE_LENGTH, type NormalizedAddress, OPENING_TYPE_MARKER, type OpenJobFilter, type OpenJobRow, type OpenJobsPage, OverlayFeeConfig, type PackageTierInput, PayOptions, PayResult, PaymentRequest, type ProfileUpdateInput, type RegisterResult, SERVICE_SLUG_RE, SERVICE_TIERS, SPONSORED_PYTH_DEPENDENT_PROVIDERS, SUINS_NAME_REGEX, SUI_ADDRESS_REGEX, SUI_ADDRESS_STRICT_REGEX, SendResult, type SendTransferInput, SendableAsset, SerializedCetusRoute, type ServiceTier, type ServiceUpsertInput, type ServiceWriteResult, type SponsoredTxGuard, type StepPreview, SuinsNotRegisteredError, type SuinsParent, SuinsRpcError, SupportedAsset, type SwapExecuteInput, SwapQuoteResult, SwapResult, SwapRouteResult, T2000, T2000Error, T2000Options, TransactionRecord, TransactionSigner, WRITE_APPENDER_REGISTRY, type WriteStep, type WriteToolName, X402Probe, ZkLoginProof, agentResolveUrl, approxUsdValue, assertLimitConfig, buildAddLeafTx, buildRevokeLeafTx, cancelBatchOpenJob, cancelOpenJob, canonicalizeRecipientInput, chatCompletion, chatCompletionStream, claimBatchOpenJob, claimOpenJob, clearLimits, composeTx, createPackage, customHireEnvelope, dailySpentToday, deriveAllowedAddressesFromPtb, displayHandle, endpointIssueLines, ensureCategory, exportPrivateKey, fetchChallengeNonce, fullHandle, generateKeypair, getAddress, getAgentProfile, getLimits, getOpenJob, getSponsoredSwapProviders, getSwapQuote, hasLimits, isCustomHireEnvelope, keypairFromPrivateKey, listEndpoint, listModels, listOpenJobs, loadKey, looksLikeSuiNs, normalizeAddressInput, packageBaseFromName, packageBaseSlug, packageTierSlugs, parseAgentCategory, parseServiceTierSlug, planPackage, postBatchOpenJob, postOpenJob, profileChallengeMessage, queryBalance, readLimitsFile, recordDailySpend, refundBatchOpenJob, refundOpenJob, registerAgent, removeEndpoint, resolveAddressToSuinsViaRpc, resolveAgentRef, resolveCreatedObjectId, resolveSuinsViaRpc, retireService, saveBech32, saveKey, serviceChallengeMessage, servicePayloadSha256, serviceUpsertPayload, setLimits, setSponsoredTxGuard, signChallenge, slugify, slugifyLoner, slugifyUnbounded, submitJobReview, trimDashes, updateProfile, upsertService, validateLabel, walletExists, writeLimitsFile };
|