@t2000/sdk 10.30.3 → 10.30.5
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 +1 -1
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.js +1 -1
- package/dist/browser.js.map +1 -1
- package/dist/index.cjs +9 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -4
- package/dist/index.d.ts +9 -4
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -590,8 +590,10 @@ declare function getAddress(keypair: Ed25519Keypair): string;
|
|
|
590
590
|
* target the LATEST published id — the original id (types, Job verbs) is
|
|
591
591
|
* unchanged.
|
|
592
592
|
*/
|
|
593
|
-
/** The LATEST published `a2a_escrow` package id on MAINNET (
|
|
594
|
-
* 2026-
|
|
593
|
+
/** The LATEST published `a2a_escrow` package id on MAINNET (v5 upgrade
|
|
594
|
+
* 2026-08-12, S.1019 — create_open requires reject_split 10000; v4 added
|
|
595
|
+
* amount bounds (S.981); v3 added `escrow::decline`; v2 the `opening`
|
|
596
|
+
* module).
|
|
595
597
|
* A literal, never an env read, so it can serve as a signature-time trust
|
|
596
598
|
* anchor (S.930). Must match the Move upgrade publish notes.
|
|
597
599
|
*
|
|
@@ -600,9 +602,9 @@ declare function getAddress(keypair: Ed25519Keypair): string;
|
|
|
600
602
|
* upgrade + `migrate` cutover is a ONE-VALUE change here. The original id
|
|
601
603
|
* (`MAINNET_A2A_ESCROW_PACKAGE_ID` in job.ts) remains the anchor for type
|
|
602
604
|
* strings, event filters, and object-type queries — those never move. */
|
|
603
|
-
declare const MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID = "
|
|
605
|
+
declare const MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID = "0xc84fc8a6d7e8766e36abb16acf5f0c0d15444797137274bbbe027ac7972c56a7";
|
|
604
606
|
/** Back-compat name for the latest id (pre-S.981 consumers import this). */
|
|
605
|
-
declare const MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID = "
|
|
607
|
+
declare const MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID = "0xc84fc8a6d7e8766e36abb16acf5f0c0d15444797137274bbbe027ac7972c56a7";
|
|
606
608
|
/** Env-overridable latest id for testnet/dev (NOT a trust anchor). A fresh
|
|
607
609
|
* dev publish has original == latest, so `A2A_ESCROW_PACKAGE_ID` alone is
|
|
608
610
|
* honored as the fallback override. */
|
|
@@ -638,6 +640,9 @@ interface OpeningTerms {
|
|
|
638
640
|
/** Delivery window the claiming ASP gets: deliver_by = claim + sla. */
|
|
639
641
|
slaMs: number;
|
|
640
642
|
reviewWindowMs: number;
|
|
643
|
+
/** v5 (S.1019): MUST be 10000 — open-board reject pays the buyer in
|
|
644
|
+
* full (contract-asserted; a partial split made junk delivery +EV over
|
|
645
|
+
* an honest decline). Hire/`escrow::create` keeps the 0–10000 range. */
|
|
641
646
|
rejectSplitBps: number;
|
|
642
647
|
}
|
|
643
648
|
/** Client-side preflight — mirrors the contract's `create_open` bounds plus
|
package/dist/index.d.ts
CHANGED
|
@@ -590,8 +590,10 @@ declare function getAddress(keypair: Ed25519Keypair): string;
|
|
|
590
590
|
* target the LATEST published id — the original id (types, Job verbs) is
|
|
591
591
|
* unchanged.
|
|
592
592
|
*/
|
|
593
|
-
/** The LATEST published `a2a_escrow` package id on MAINNET (
|
|
594
|
-
* 2026-
|
|
593
|
+
/** The LATEST published `a2a_escrow` package id on MAINNET (v5 upgrade
|
|
594
|
+
* 2026-08-12, S.1019 — create_open requires reject_split 10000; v4 added
|
|
595
|
+
* amount bounds (S.981); v3 added `escrow::decline`; v2 the `opening`
|
|
596
|
+
* module).
|
|
595
597
|
* A literal, never an env read, so it can serve as a signature-time trust
|
|
596
598
|
* anchor (S.930). Must match the Move upgrade publish notes.
|
|
597
599
|
*
|
|
@@ -600,9 +602,9 @@ declare function getAddress(keypair: Ed25519Keypair): string;
|
|
|
600
602
|
* upgrade + `migrate` cutover is a ONE-VALUE change here. The original id
|
|
601
603
|
* (`MAINNET_A2A_ESCROW_PACKAGE_ID` in job.ts) remains the anchor for type
|
|
602
604
|
* strings, event filters, and object-type queries — those never move. */
|
|
603
|
-
declare const MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID = "
|
|
605
|
+
declare const MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID = "0xc84fc8a6d7e8766e36abb16acf5f0c0d15444797137274bbbe027ac7972c56a7";
|
|
604
606
|
/** Back-compat name for the latest id (pre-S.981 consumers import this). */
|
|
605
|
-
declare const MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID = "
|
|
607
|
+
declare const MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID = "0xc84fc8a6d7e8766e36abb16acf5f0c0d15444797137274bbbe027ac7972c56a7";
|
|
606
608
|
/** Env-overridable latest id for testnet/dev (NOT a trust anchor). A fresh
|
|
607
609
|
* dev publish has original == latest, so `A2A_ESCROW_PACKAGE_ID` alone is
|
|
608
610
|
* honored as the fallback override. */
|
|
@@ -638,6 +640,9 @@ interface OpeningTerms {
|
|
|
638
640
|
/** Delivery window the claiming ASP gets: deliver_by = claim + sla. */
|
|
639
641
|
slaMs: number;
|
|
640
642
|
reviewWindowMs: number;
|
|
643
|
+
/** v5 (S.1019): MUST be 10000 — open-board reject pays the buyer in
|
|
644
|
+
* full (contract-asserted; a partial split made junk delivery +EV over
|
|
645
|
+
* an honest decline). Hire/`escrow::create` keeps the 0–10000 range. */
|
|
641
646
|
rejectSplitBps: number;
|
|
642
647
|
}
|
|
643
648
|
/** Client-side preflight — mirrors the contract's `create_open` bounds plus
|
package/dist/index.js
CHANGED
|
@@ -3321,7 +3321,7 @@ init_coinSelection();
|
|
|
3321
3321
|
init_errors();
|
|
3322
3322
|
init_token_registry();
|
|
3323
3323
|
init_coinSelection();
|
|
3324
|
-
var MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID = "
|
|
3324
|
+
var MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID = "0xc84fc8a6d7e8766e36abb16acf5f0c0d15444797137274bbbe027ac7972c56a7";
|
|
3325
3325
|
var MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID = MAINNET_A2A_ESCROW_LATEST_PACKAGE_ID;
|
|
3326
3326
|
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;
|
|
3327
3327
|
var A2A_ESCROW_OPENING_PACKAGE_ID = A2A_ESCROW_LATEST_PACKAGE_ID;
|
|
@@ -3347,6 +3347,7 @@ function hexToBytes2(hex) {
|
|
|
3347
3347
|
}
|
|
3348
3348
|
return bytes;
|
|
3349
3349
|
}
|
|
3350
|
+
var OPEN_REJECT_SPLIT_BPS = 1e4;
|
|
3350
3351
|
function preflightCreateOpening(terms) {
|
|
3351
3352
|
if (!Number.isFinite(terms.amountUsdc) || terms.amountUsdc <= 0) {
|
|
3352
3353
|
return { valid: false, code: "INVALID_AMOUNT", error: "Budget must be positive." };
|
|
@@ -3378,6 +3379,13 @@ function preflightCreateOpening(terms) {
|
|
|
3378
3379
|
if (terms.slaMs <= 0) {
|
|
3379
3380
|
return { valid: false, code: "INVALID_INPUT", error: "Delivery window must be positive." };
|
|
3380
3381
|
}
|
|
3382
|
+
if (terms.rejectSplitBps !== OPEN_REJECT_SPLIT_BPS) {
|
|
3383
|
+
return {
|
|
3384
|
+
valid: false,
|
|
3385
|
+
code: "INVALID_INPUT",
|
|
3386
|
+
error: "Open postings lock reject at 100% buyer / 0% seller (rejectSplitBps must be 10000, contract-enforced since v5) \u2014 reject is economically a decline, so junk delivery has no edge."
|
|
3387
|
+
};
|
|
3388
|
+
}
|
|
3381
3389
|
return { valid: true };
|
|
3382
3390
|
}
|
|
3383
3391
|
async function buildCreateOpeningTx({
|