@esseyonsui/sui-sdk-v3 0.3.3 → 0.4.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/config.d.ts +3 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -0
- package/dist/errors.d.ts +3 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +5 -0
- package/dist/essey.d.ts +157 -131
- package/dist/essey.d.ts.map +1 -1
- package/dist/essey.js +641 -823
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/v3/collateral/bodies.d.ts +23 -14
- package/dist/v3/collateral/bodies.d.ts.map +1 -1
- package/dist/v3/collateral/bodies.js +42 -35
- package/dist/v3/collateral/ext.d.ts +18 -13
- package/dist/v3/collateral/ext.d.ts.map +1 -1
- package/dist/v3/collateral/ext.js +5 -6
- package/dist/v3/collateral/health.d.ts +16 -10
- package/dist/v3/collateral/health.d.ts.map +1 -1
- package/dist/v3/collateral/health.js +55 -30
- package/dist/v3/collateral/math.d.ts +0 -2
- package/dist/v3/collateral/math.d.ts.map +1 -1
- package/dist/v3/collateral/math.js +0 -5
- package/dist/v3/collateral/openings.d.ts +5 -1
- package/dist/v3/collateral/openings.d.ts.map +1 -1
- package/dist/v3/collateral/openings.js +7 -12
- package/dist/v3/credential/membership.d.ts +16 -2
- package/dist/v3/credential/membership.d.ts.map +1 -1
- package/dist/v3/credential/membership.js +36 -3
- package/dist/v3/domains.d.ts +9 -0
- package/dist/v3/domains.d.ts.map +1 -1
- package/dist/v3/domains.js +5 -0
- package/dist/v3/fees.d.ts +13 -1
- package/dist/v3/fees.d.ts.map +1 -1
- package/dist/v3/fees.js +32 -2
- package/dist/v3/funds.d.ts +34 -0
- package/dist/v3/funds.d.ts.map +1 -0
- package/dist/v3/funds.js +60 -0
- package/dist/v3/keeper-payload.d.ts +29 -7
- package/dist/v3/keeper-payload.d.ts.map +1 -1
- package/dist/v3/keeper-payload.js +33 -22
- package/dist/v3/kinds.d.ts +6 -6
- package/dist/v3/kinds.d.ts.map +1 -1
- package/dist/v3/kinds.js +5 -13
- package/dist/v3/loans/bodies.d.ts +40 -68
- package/dist/v3/loans/bodies.d.ts.map +1 -1
- package/dist/v3/loans/bodies.js +50 -73
- package/dist/v3/loans/offer-payload.d.ts +109 -0
- package/dist/v3/loans/offer-payload.d.ts.map +1 -0
- package/dist/v3/loans/offer-payload.js +207 -0
- package/dist/v3/loans/offer-plan.d.ts +8 -60
- package/dist/v3/loans/offer-plan.d.ts.map +1 -1
- package/dist/v3/loans/offer-plan.js +19 -95
- package/dist/v3/loans/open-plan.d.ts +15 -5
- package/dist/v3/loans/open-plan.d.ts.map +1 -1
- package/dist/v3/loans/open-plan.js +18 -7
- package/dist/v3/loans/reclaim-plan.d.ts +31 -15
- package/dist/v3/loans/reclaim-plan.d.ts.map +1 -1
- package/dist/v3/loans/reclaim-plan.js +63 -32
- package/dist/v3/loans/refi-plan.d.ts +8 -34
- package/dist/v3/loans/refi-plan.d.ts.map +1 -1
- package/dist/v3/loans/refi-plan.js +30 -111
- package/dist/v3/loans/repay-plan.d.ts.map +1 -1
- package/dist/v3/loans/repay-plan.js +2 -2
- package/dist/v3/loans/settle-plan.d.ts +88 -53
- package/dist/v3/loans/settle-plan.d.ts.map +1 -1
- package/dist/v3/loans/settle-plan.js +141 -150
- package/dist/v3/locks.d.ts +21 -0
- package/dist/v3/locks.d.ts.map +1 -0
- package/dist/v3/locks.js +15 -0
- package/dist/v3/memo.d.ts +14 -4
- package/dist/v3/memo.d.ts.map +1 -1
- package/dist/v3/memo.js +14 -7
- package/dist/v3/notes/derive.d.ts +5 -0
- package/dist/v3/notes/derive.d.ts.map +1 -1
- package/dist/v3/notes/derive.js +5 -0
- package/dist/v3/pace.d.ts +0 -1
- package/dist/v3/pace.d.ts.map +1 -1
- package/dist/v3/pace.js +0 -1
- package/dist/v3/pads.d.ts +15 -0
- package/dist/v3/pads.d.ts.map +1 -0
- package/dist/v3/pads.js +25 -0
- package/dist/v3/prover.d.ts +1 -1
- package/dist/v3/prover.d.ts.map +1 -1
- package/dist/v3/prover.js +1 -0
- package/dist/v3/sales/auctioneer.d.ts +32 -27
- package/dist/v3/sales/auctioneer.d.ts.map +1 -1
- package/dist/v3/sales/auctioneer.js +67 -108
- package/dist/v3/sales/bid.d.ts +20 -49
- package/dist/v3/sales/bid.d.ts.map +1 -1
- package/dist/v3/sales/bid.js +28 -83
- package/dist/v3/sales/bodies.d.ts +4 -54
- package/dist/v3/sales/bodies.d.ts.map +1 -1
- package/dist/v3/sales/bodies.js +10 -52
- package/dist/v3/sales/claim.d.ts +0 -2
- package/dist/v3/sales/claim.d.ts.map +1 -1
- package/dist/v3/sales/claim.js +6 -8
- package/dist/v3/sales/index.d.ts +0 -1
- package/dist/v3/sales/index.d.ts.map +1 -1
- package/dist/v3/sales/index.js +0 -1
- package/dist/v3/sales/listing.d.ts +8 -6
- package/dist/v3/sales/listing.d.ts.map +1 -1
- package/dist/v3/sales/listing.js +27 -9
- package/dist/v3/sales/open-kind.d.ts +1 -3
- package/dist/v3/sales/open-kind.d.ts.map +1 -1
- package/dist/v3/sales/open-kind.js +2 -3
- package/dist/v3/sales/outcome.d.ts +5 -8
- package/dist/v3/sales/outcome.d.ts.map +1 -1
- package/dist/v3/sales/outcome.js +5 -9
- package/dist/v3/sales/package-gate.d.ts +3 -4
- package/dist/v3/sales/package-gate.d.ts.map +1 -1
- package/dist/v3/sales/package-gate.js +9 -7
- package/dist/v3/sales/rows.d.ts +9 -49
- package/dist/v3/sales/rows.d.ts.map +1 -1
- package/dist/v3/sales/rows.js +17 -91
- package/dist/v3/sales/seller.d.ts +2 -6
- package/dist/v3/sales/seller.d.ts.map +1 -1
- package/dist/v3/sales/seller.js +4 -11
- package/dist/v3/stage1.d.ts +8 -21
- package/dist/v3/stage1.d.ts.map +1 -1
- package/dist/v3/stage1.js +8 -76
- package/package.json +1 -1
- package/dist/v3/loans/lock-round.d.ts +0 -22
- package/dist/v3/loans/lock-round.d.ts.map +0 -1
- package/dist/v3/loans/lock-round.js +0 -20
- package/dist/v3/sales/reclaim.d.ts +0 -46
- package/dist/v3/sales/reclaim.d.ts.map +0 -1
- package/dist/v3/sales/reclaim.js +0 -57
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
/** `sale_room.move` OPEN, SETTLED and EXPIRED. A CANCELLED room
|
|
1
|
+
import type { BidSecrets } from "./rows.ts";
|
|
2
|
+
/** `sale_room.move` OPEN, SETTLED and EXPIRED. A CANCELLED room took no finish. */
|
|
3
3
|
export declare const SALE_STATE: {
|
|
4
4
|
readonly open: 0;
|
|
5
5
|
readonly settled: 1;
|
|
@@ -7,14 +7,11 @@ export declare const SALE_STATE: {
|
|
|
7
7
|
};
|
|
8
8
|
export type Outcome = "won" | "lost" | "pending";
|
|
9
9
|
/**
|
|
10
|
-
* `won` iff
|
|
11
|
-
*
|
|
12
|
-
* about one N would tell it which bid is the caller's, so N is only ever looked up in that set.
|
|
10
|
+
* `won` iff the room settled and its vault's claim is the one this bid's owner key and `ns` rebuild (freeze §3.5
|
|
11
|
+
* `itemClaimC`). Read from the room and vault alone; no node is asked about the bid's nullifier.
|
|
13
12
|
*/
|
|
14
13
|
export declare function outcome(room: {
|
|
15
|
-
saleKey: bigint;
|
|
16
14
|
state: number;
|
|
17
|
-
|
|
18
|
-
spent: ReadonlySet<bigint>;
|
|
15
|
+
claim: bigint | null;
|
|
19
16
|
}, bid: BidSecrets): Outcome;
|
|
20
17
|
//# sourceMappingURL=outcome.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outcome.d.ts","sourceRoot":"","sources":["../../../src/v3/sales/outcome.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"outcome.d.ts","sourceRoot":"","sources":["../../../src/v3/sales/outcome.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE5C,mFAAmF;AACnF,eAAO,MAAM,UAAU;;;;CAA+C,CAAC;AAEvE,MAAM,MAAM,OAAO,GAAG,KAAK,GAAG,MAAM,GAAG,SAAS,CAAC;AAEjD;;;GAGG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,EAAE,GAAG,EAAE,UAAU,GAAG,OAAO,CAK/F"}
|
package/dist/v3/sales/outcome.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { notePk } from "../notes/keys.js";
|
|
2
|
-
import {
|
|
3
|
-
/** `sale_room.move` OPEN, SETTLED and EXPIRED. A CANCELLED room
|
|
2
|
+
import { itemClaimCommit, winnerSalt } from "./claim.js";
|
|
3
|
+
/** `sale_room.move` OPEN, SETTLED and EXPIRED. A CANCELLED room took no finish. */
|
|
4
4
|
export const SALE_STATE = { open: 0, settled: 1, expired: 2 };
|
|
5
5
|
/**
|
|
6
|
-
* `won` iff
|
|
7
|
-
*
|
|
8
|
-
* about one N would tell it which bid is the caller's, so N is only ever looked up in that set.
|
|
6
|
+
* `won` iff the room settled and its vault's claim is the one this bid's owner key and `ns` rebuild (freeze §3.5
|
|
7
|
+
* `itemClaimC`). Read from the room and vault alone; no node is asked about the bid's nullifier.
|
|
9
8
|
*/
|
|
10
9
|
export function outcome(room, bid) {
|
|
11
10
|
if (room.state === SALE_STATE.open)
|
|
@@ -14,8 +13,5 @@ export function outcome(room, bid) {
|
|
|
14
13
|
return "lost";
|
|
15
14
|
if (room.state !== SALE_STATE.settled)
|
|
16
15
|
throw new Error("no bid has an outcome in this room state");
|
|
17
|
-
|
|
18
|
-
const own = lock4(room.saleKey, ownerPk, bid.ns, bid.amount, bid.b);
|
|
19
|
-
const change = residualLock(room.saleKey, ownerPk, bid.ns, bid.amount - bid.v);
|
|
20
|
-
return room.spent.has(own.nullifier) && change.lock === room.residual ? "won" : "lost";
|
|
16
|
+
return room.claim === itemClaimCommit(notePk(bid.ownerSk), winnerSalt(bid.ns)) ? "won" : "lost";
|
|
21
17
|
}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
export type SaleKind = "open" | "bid" | "
|
|
1
|
+
export type SaleKind = "open" | "bid" | "finish" | "expire" | "cancel" | "claim";
|
|
2
2
|
/** The package of a `SaleRoom` or `ItemVault` type tag, which names the package's original id. */
|
|
3
3
|
export declare function salePackageOf(type: string): string;
|
|
4
4
|
/**
|
|
5
|
-
* `legacy` is true on a previous origin, whose
|
|
6
|
-
*
|
|
5
|
+
* `legacy` is true on a previous origin, whose Seal policy is its own package's. Every kind is refused on an origin
|
|
6
|
+
* that is neither the current one nor a previous one.
|
|
7
7
|
*/
|
|
8
8
|
export declare function saleKindGate(kind: SaleKind, type: string, origins: {
|
|
9
9
|
current: string;
|
|
10
10
|
previous: readonly string[];
|
|
11
|
-
drained?: readonly string[];
|
|
12
11
|
}): {
|
|
13
12
|
legacy: boolean;
|
|
14
13
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-gate.d.ts","sourceRoot":"","sources":["../../../src/v3/sales/package-gate.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"package-gate.d.ts","sourceRoot":"","sources":["../../../src/v3/sales/package-gate.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;AAQjF,kGAAkG;AAClG,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAIlD;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GACxD;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,CAQrB"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { normalizeSuiAddress } from "@mysten/sui/utils";
|
|
2
|
-
/**
|
|
3
|
-
|
|
2
|
+
/**
|
|
3
|
+
* DECISION-R1-MIGRATION option A: a previous sale package only ends what it already holds. Its 16-slot finish, pick,
|
|
4
|
+
* slash and room reclaim are R1 paths Z1 deletes, so this SDK ends such a room by expire or cancel only.
|
|
5
|
+
*/
|
|
6
|
+
const ENDING = new Set(["expire", "cancel", "claim"]);
|
|
4
7
|
/** The package of a `SaleRoom` or `ItemVault` type tag, which names the package's original id. */
|
|
5
8
|
export function salePackageOf(type) {
|
|
6
9
|
const m = /^(0x[0-9a-fA-F]{1,64})::(sale_room::SaleRoom|vault::ItemVault)</.exec(type);
|
|
@@ -9,17 +12,16 @@ export function salePackageOf(type) {
|
|
|
9
12
|
return normalizeSuiAddress(m[1]);
|
|
10
13
|
}
|
|
11
14
|
/**
|
|
12
|
-
* `legacy` is true on a previous origin, whose
|
|
13
|
-
*
|
|
15
|
+
* `legacy` is true on a previous origin, whose Seal policy is its own package's. Every kind is refused on an origin
|
|
16
|
+
* that is neither the current one nor a previous one.
|
|
14
17
|
*/
|
|
15
18
|
export function saleKindGate(kind, type, origins) {
|
|
16
19
|
const pkg = salePackageOf(type);
|
|
17
20
|
if (pkg === normalizeSuiAddress(origins.current))
|
|
18
21
|
return { legacy: false };
|
|
19
|
-
|
|
20
|
-
if (!legacy && !origins.drained?.some((p) => normalizeSuiAddress(p) === pkg))
|
|
22
|
+
if (!origins.previous.some((p) => normalizeSuiAddress(p) === pkg))
|
|
21
23
|
throw new Error("refused: the object is not of this deployment's sale package");
|
|
22
24
|
if (!ENDING.has(kind))
|
|
23
25
|
throw new Error(`refused: a previous sale package takes no ${kind}; nothing was sent`);
|
|
24
|
-
return { legacy };
|
|
26
|
+
return { legacy: true };
|
|
25
27
|
}
|
package/dist/v3/sales/rows.d.ts
CHANGED
|
@@ -1,56 +1,16 @@
|
|
|
1
|
-
/**
|
|
2
|
-
export declare const SLOTS = 16;
|
|
3
|
-
/** `sale_room.move` BID_BLOB_LEN. */
|
|
4
|
-
export declare const BID_PLAIN_BYTES = 144;
|
|
5
|
-
/** What a bidder keeps: it reopens the lock, the residual and the item claim. Never sent. */
|
|
1
|
+
/** What a bidder keeps: its lock's owner key, `ns` and blind, from the bid's reserved note key (freeze §6.4). */
|
|
6
2
|
export type BidSecrets = {
|
|
7
|
-
|
|
8
|
-
s: bigint;
|
|
3
|
+
ownerSk: bigint;
|
|
9
4
|
ns: bigint;
|
|
10
|
-
amount: bigint;
|
|
11
5
|
b: bigint;
|
|
12
|
-
ownerSk: bigint;
|
|
13
6
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
7
|
+
/** The bid's keys from the note key at its reserved index: the offer `ns` (`offerKeys`) and a blind over it alone. */
|
|
8
|
+
export declare function bidSecrets(own: {
|
|
9
|
+
sk: bigint;
|
|
10
|
+
blinding: bigint;
|
|
11
|
+
}): BidSecrets;
|
|
12
|
+
/** `rows::enc_hash`: keccak256(bcs(encs)) read big-endian, mod R; every ciphertext is 128 bytes. */
|
|
19
13
|
export declare function encHash(encs: Uint8Array[]): bigint;
|
|
20
|
-
/**
|
|
21
|
-
export declare function lock4(field: bigint, ownerPk: bigint, ns: bigint, amount: bigint, b: bigint): {
|
|
22
|
-
lock: bigint;
|
|
23
|
-
nullifier: bigint;
|
|
24
|
-
};
|
|
25
|
-
/** C §4.4: the winner's change, a lock whose `ns` and blinding both derive from the bid's `ns`. */
|
|
26
|
-
export declare function residualLock(field: bigint, ownerPk: bigint, ns: bigint, amount: bigint): {
|
|
27
|
-
lock: bigint;
|
|
28
|
-
nullifier: bigint;
|
|
29
|
-
nsEff: bigint;
|
|
30
|
-
b: bigint;
|
|
31
|
-
};
|
|
14
|
+
/** PRV-24 A: `posted_commit = Poseidon3(DOM_BID, price, s*)`. */
|
|
32
15
|
export declare const bidCommit: (v: bigint, s: bigint) => bigint;
|
|
33
|
-
export type BidExt = {
|
|
34
|
-
room: string;
|
|
35
|
-
seq: number;
|
|
36
|
-
relayer: string;
|
|
37
|
-
relayerFee: bigint;
|
|
38
|
-
commit: bigint;
|
|
39
|
-
sealed: Uint8Array;
|
|
40
|
-
memo: Uint8Array;
|
|
41
|
-
/** `[enc_change, enc_fee]`, the order `room_lock_spend` takes them. */
|
|
42
|
-
encs: Uint8Array[];
|
|
43
|
-
};
|
|
44
|
-
/** `sale_room::ext_hash`: keccak256(bcs(ExtLockBid)) mod R, the digest read big-endian. */
|
|
45
|
-
export declare function bidExt(x: BidExt): bigint;
|
|
46
|
-
/** `sale_room::bid_key_id`: blake2b256("ess3/bid" ‖ bcs(sale_key) ‖ bcs(seq)), the Seal id `pin_bid` requires. */
|
|
47
|
-
export declare const bidKeyId: (saleKey: bigint, seq: bigint) => Uint8Array;
|
|
48
|
-
/** `pin_bid`'s aad: bcs(n0), the note the bid spends. */
|
|
49
|
-
export declare const bidAad: (n0: bigint) => Uint8Array;
|
|
50
|
-
/** `membership::seal_bid(room, seq, viewer).bind`, the pass `seal_approve_bid` checks. */
|
|
51
|
-
export declare const sealBidBind: (room: string, seq: bigint, viewer: string) => Uint8Array;
|
|
52
|
-
/** C §7.1 plaintext, in the order `sale_room::opens` peels it: v ‖ s ‖ ns ‖ amount ‖ b ‖ ownerPk. */
|
|
53
|
-
export declare function bidPlaintext(x: BidSecrets): Uint8Array;
|
|
54
|
-
/** `sale_room::opens`: the opening when the plaintext gives both the commit and the lock. */
|
|
55
|
-
export declare function openBid(plain: Uint8Array | undefined, field: bigint, commit: bigint, lock: bigint): BidOpening | undefined;
|
|
56
16
|
//# sourceMappingURL=rows.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rows.d.ts","sourceRoot":"","sources":["../../../src/v3/sales/rows.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rows.d.ts","sourceRoot":"","sources":["../../../src/v3/sales/rows.ts"],"names":[],"mappings":"AASA,iHAAiH;AACjH,MAAM,MAAM,UAAU,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpE,sHAAsH;AACtH,wBAAgB,UAAU,CAAC,GAAG,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,UAAU,CAG5E;AAQD,oGAAoG;AACpG,wBAAgB,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,MAAM,CAIlD;AAED,iEAAiE;AACjE,eAAO,MAAM,SAAS,GAAI,GAAG,MAAM,EAAE,GAAG,MAAM,KAAG,MAAuC,CAAC"}
|
package/dist/v3/sales/rows.js
CHANGED
|
@@ -1,100 +1,26 @@
|
|
|
1
1
|
import { poseidonHash } from "@mysten/sui/zklogin";
|
|
2
|
-
import { blake2b } from "@noble/hashes/blake2.js";
|
|
3
2
|
import { keccak_256 } from "@noble/hashes/sha3.js";
|
|
4
|
-
import { DOM_BID,
|
|
3
|
+
import { DOM_BID, R } from "../domains.js";
|
|
5
4
|
import { ENC_BYTES } from "../kinds.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export const SLOTS = 16;
|
|
13
|
-
/** `sale_room.move` BID_BLOB_LEN. */
|
|
14
|
-
export const BID_PLAIN_BYTES = 144;
|
|
15
|
-
const SBID_TAG = Buffer.from("ess3/sbid/", "ascii");
|
|
16
|
-
/** `sale_room.move` FIRST_BID_PAIRS: the first bid also reserves settlement's pair and the residual's. */
|
|
17
|
-
const FIRST_BID_PAIRS = 3;
|
|
18
|
-
const keccakModR = (bytes) => BigInt(`0x${Buffer.from(keccak_256(Uint8Array.from(bytes))).toString("hex")}`) % R;
|
|
19
|
-
export function padSlots(xs) {
|
|
20
|
-
if (xs.length > SLOTS)
|
|
21
|
-
throw new Error("a room holds at most 16 bids");
|
|
22
|
-
return Array.from({ length: SLOTS }, (_, i) => xs[i] ?? 0n);
|
|
5
|
+
import { bidBlind } from "../locks.js";
|
|
6
|
+
import { bcsBytes } from "./bcs.js";
|
|
7
|
+
/** The bid's keys from the note key at its reserved index: the offer `ns` (`offerKeys`) and a blind over it alone. */
|
|
8
|
+
export function bidSecrets(own) {
|
|
9
|
+
const ns = poseidonHash([own.sk, own.blinding, 3n]);
|
|
10
|
+
return { ownerSk: own.sk, ns, b: bidBlind(ns) };
|
|
23
11
|
}
|
|
24
|
-
|
|
12
|
+
function uleb(n) {
|
|
13
|
+
const out = [];
|
|
14
|
+
for (; n >= 0x80; n >>>= 7)
|
|
15
|
+
out.push((n & 0x7f) | 0x80);
|
|
16
|
+
return [...out, n];
|
|
17
|
+
}
|
|
18
|
+
/** `rows::enc_hash`: keccak256(bcs(encs)) read big-endian, mod R; every ciphertext is 128 bytes. */
|
|
25
19
|
export function encHash(encs) {
|
|
26
20
|
if (encs.some((e) => e.length !== ENC_BYTES))
|
|
27
21
|
throw new Error("a note ciphertext is 128 bytes");
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
/** E-2, `lib/lock.circom` Lock4, with the lock's nullifier N. */
|
|
31
|
-
export function lock4(field, ownerPk, ns, amount, b) {
|
|
32
|
-
const lock = lockOf(field, ownerPk, ns, amount, b);
|
|
33
|
-
return { lock, nullifier: poseidonHash([DOM_LNULL, ns, lock]) };
|
|
34
|
-
}
|
|
35
|
-
/** C §4.4: the winner's change, a lock whose `ns` and blinding both derive from the bid's `ns`. */
|
|
36
|
-
export function residualLock(field, ownerPk, ns, amount) {
|
|
37
|
-
const nsEff = poseidonHash([DOM_RESID, ns]);
|
|
38
|
-
const b = poseidonHash([DOM_RBLIND, ns]);
|
|
39
|
-
return { nsEff, b, ...lock4(field, ownerPk, nsEff, amount, b) };
|
|
22
|
+
const bytes = Uint8Array.from([...uleb(encs.length), ...encs.flatMap((e) => bcsBytes(e))]);
|
|
23
|
+
return BigInt(`0x${Buffer.from(keccak_256(bytes)).toString("hex")}`) % R;
|
|
40
24
|
}
|
|
25
|
+
/** PRV-24 A: `posted_commit = Poseidon3(DOM_BID, price, s*)`. */
|
|
41
26
|
export const bidCommit = (v, s) => poseidonHash([DOM_BID, v, s]);
|
|
42
|
-
/** `sale_room::ext_hash`: keccak256(bcs(ExtLockBid)) mod R, the digest read big-endian. */
|
|
43
|
-
export function bidExt(x) {
|
|
44
|
-
assertMemo(x.memo);
|
|
45
|
-
return keccakModR([
|
|
46
|
-
...bcsBytes(SBID_TAG),
|
|
47
|
-
...addressBytes(x.room, "room"),
|
|
48
|
-
...le(BigInt(x.seq), 8, "seq"),
|
|
49
|
-
...addressBytes(x.relayer, "relayer"),
|
|
50
|
-
...le(x.relayerFee, 8, "relayerFee"),
|
|
51
|
-
x.seq === 0 ? FIRST_BID_PAIRS : 1,
|
|
52
|
-
...le(x.commit, 32, "commit"),
|
|
53
|
-
...bcsBytes(blake2b(Uint8Array.from([...x.sealed, ...x.memo]), { dkLen: 32 })),
|
|
54
|
-
...le(encHash(x.encs), 32, "encHash"),
|
|
55
|
-
]);
|
|
56
|
-
}
|
|
57
|
-
const blake = (bytes) => blake2b(Uint8Array.from(bytes), { dkLen: 32 });
|
|
58
|
-
/** `sale_room::bid_key_id`: blake2b256("ess3/bid" ‖ bcs(sale_key) ‖ bcs(seq)), the Seal id `pin_bid` requires. */
|
|
59
|
-
export const bidKeyId = (saleKey, seq) => blake([...Buffer.from("ess3/bid", "ascii"), ...le(saleKey, 32, "saleKey"), ...le(seq, 8, "seq")]);
|
|
60
|
-
/** `pin_bid`'s aad: bcs(n0), the note the bid spends. */
|
|
61
|
-
export const bidAad = (n0) => Uint8Array.from(le(n0, 32, "n0"));
|
|
62
|
-
/** `membership::seal_bid(room, seq, viewer).bind`, the pass `seal_approve_bid` checks. */
|
|
63
|
-
export const sealBidBind = (room, seq, viewer) => blake([
|
|
64
|
-
...Buffer.from("essey-v3/seal/bid", "ascii"),
|
|
65
|
-
...addressBytes(room, "room"),
|
|
66
|
-
...le(seq, 8, "seq"),
|
|
67
|
-
...addressBytes(viewer, "viewer"),
|
|
68
|
-
]);
|
|
69
|
-
/** C §7.1 plaintext, in the order `sale_room::opens` peels it: v ‖ s ‖ ns ‖ amount ‖ b ‖ ownerPk. */
|
|
70
|
-
export function bidPlaintext(x) {
|
|
71
|
-
return Uint8Array.from([
|
|
72
|
-
...le(x.v, 8, "v"),
|
|
73
|
-
...le(x.s, 32, "s"),
|
|
74
|
-
...le(x.ns, 32, "ns"),
|
|
75
|
-
...le(x.amount, 8, "amount"),
|
|
76
|
-
...le(x.b, 32, "b"),
|
|
77
|
-
...le(notePk(x.ownerSk), 32, "ownerPk"),
|
|
78
|
-
]);
|
|
79
|
-
}
|
|
80
|
-
/** `sale_room::opens`: the opening when the plaintext gives both the commit and the lock. */
|
|
81
|
-
export function openBid(plain, field, commit, lock) {
|
|
82
|
-
if (plain?.length !== BID_PLAIN_BYTES)
|
|
83
|
-
return undefined;
|
|
84
|
-
const at = (from, size) => {
|
|
85
|
-
const be = Buffer.from(plain.subarray(from, from + size)).reverse();
|
|
86
|
-
return BigInt(`0x${be.toString("hex")}`);
|
|
87
|
-
};
|
|
88
|
-
const o = {
|
|
89
|
-
v: at(0, 8),
|
|
90
|
-
s: at(8, 32),
|
|
91
|
-
ns: at(40, 32),
|
|
92
|
-
amount: at(72, 8),
|
|
93
|
-
b: at(80, 32),
|
|
94
|
-
ownerPk: at(112, 32),
|
|
95
|
-
};
|
|
96
|
-
if ([o.s, o.ns, o.b, o.ownerPk].some((x) => x >= R))
|
|
97
|
-
return undefined;
|
|
98
|
-
const opens = bidCommit(o.v, o.s) === commit && lock4(field, o.ownerPk, o.ns, o.amount, o.b).lock === lock;
|
|
99
|
-
return opens ? o : undefined;
|
|
100
|
-
}
|
|
@@ -16,13 +16,11 @@ export type OpenArgs = {
|
|
|
16
16
|
};
|
|
17
17
|
sellerCommit: bigint;
|
|
18
18
|
sellerItemFallback: bigint;
|
|
19
|
-
boundsCommit: bigint;
|
|
20
19
|
postedCommit: bigint;
|
|
21
20
|
listing: Uint8Array;
|
|
22
21
|
memo: Uint8Array;
|
|
23
22
|
closeMs: bigint;
|
|
24
23
|
finishByMs: bigint;
|
|
25
|
-
maxBids: number;
|
|
26
24
|
};
|
|
27
25
|
/**
|
|
28
26
|
* `sale_room::check_grid` (44_041) counts the bid window from `round_up(chain now)`, so the open must land after
|
|
@@ -40,12 +38,11 @@ export declare function saleTimes(p: {
|
|
|
40
38
|
landFromMs: bigint;
|
|
41
39
|
landByMs: bigint;
|
|
42
40
|
};
|
|
43
|
-
/** `sale_room::open_args` (`sale_room.move
|
|
41
|
+
/** `sale_room::open_args` (lane S `sale_room.move` open_args), the bytes the seller pass signs. */
|
|
44
42
|
export declare function openArgs(p: OpenArgs): Uint8Array;
|
|
45
43
|
export type SaleSecrets = {
|
|
46
44
|
sellerSk: bigint;
|
|
47
45
|
sellerSecret: bigint;
|
|
48
|
-
boundsSalt: bigint;
|
|
49
46
|
postedSalt: bigint;
|
|
50
47
|
};
|
|
51
48
|
/** The seller's room secrets from the note key it reserved, so the seed alone reopens them. */
|
|
@@ -53,11 +50,10 @@ export declare function saleSecrets(own: {
|
|
|
53
50
|
sk: bigint;
|
|
54
51
|
blinding: bigint;
|
|
55
52
|
}): SaleSecrets;
|
|
56
|
-
/** The
|
|
53
|
+
/** The three commits `sale_room::open` stores. PRV-24 A: the posted commit is the price SaleSettle charges. */
|
|
57
54
|
export declare function openCommits(s: SaleSecrets, price: bigint): {
|
|
58
55
|
sellerCommit: bigint;
|
|
59
56
|
sellerItemFallback: bigint;
|
|
60
|
-
boundsCommit: bigint;
|
|
61
57
|
postedCommit: bigint;
|
|
62
58
|
};
|
|
63
59
|
//# sourceMappingURL=seller.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seller.d.ts","sourceRoot":"","sources":["../../../src/v3/sales/seller.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"seller.d.ts","sourceRoot":"","sources":["../../../src/v3/sales/seller.ts"],"names":[],"mappings":"AAYA,yFAAyF;AACzF,eAAO,MAAM,YAAY,SAAU,CAAC;AAQpC;;;GAGG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAI9C;AAED,oGAAoG;AACpG,MAAM,MAAM,QAAQ,GAAG;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IACvC,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,UAAU,CAAC;IACpB,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAQF;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;CAClB;;;;;EASA;AAED,mGAAmG;AACnG,wBAAgB,QAAQ,CAAC,CAAC,EAAE,QAAQ,GAAG,UAAU,CAwBhD;AAED,MAAM,MAAM,WAAW,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzF,+FAA+F;AAC/F,wBAAgB,WAAW,CAAC,GAAG,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,WAAW,CAG9E;AAED,+GAA+G;AAC/G,wBAAgB,WAAW,CAAC,CAAC,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM;;;;EAOxD"}
|
package/dist/v3/sales/seller.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { poseidonHash } from "@mysten/sui/zklogin";
|
|
2
2
|
import { blake2b } from "@noble/hashes/blake2.js";
|
|
3
|
-
import {
|
|
3
|
+
import { DOM_SELLER, R } from "../domains.js";
|
|
4
4
|
import { notePk } from "../notes/keys.js";
|
|
5
5
|
import { BID_WINDOW_STEPS, FINISH_WINDOW_STEPS } from "../time-grid.js";
|
|
6
6
|
import { addressBytes, bcsBytes, le } from "./bcs.js";
|
|
7
7
|
import { fallbackSalt, itemClaimCommit } from "./claim.js";
|
|
8
8
|
import { postedCommit } from "./listing.js";
|
|
9
9
|
import { assertMemo } from "./memo.js";
|
|
10
|
-
import { SLOTS } from "./rows.js";
|
|
11
10
|
/** `sale_room.move` CLOSE_STEP_MS: Move's grid, whatever step the config gives loans. */
|
|
12
11
|
export const SALE_STEP_MS = 300_000;
|
|
13
12
|
/** `sale_room.move` MAX_LISTING_LEN. */
|
|
@@ -44,20 +43,17 @@ export function saleTimes(p) {
|
|
|
44
43
|
const closeMs = base + bid * step;
|
|
45
44
|
return { closeMs, finishByMs: closeMs + finish * step, landFromMs: base - step + 1n, landByMs: base };
|
|
46
45
|
}
|
|
47
|
-
/** `sale_room::open_args` (`sale_room.move
|
|
46
|
+
/** `sale_room::open_args` (lane S `sale_room.move` open_args), the bytes the seller pass signs. */
|
|
48
47
|
export function openArgs(p) {
|
|
49
48
|
if (p.saleKey <= 0n || p.saleKey >= R)
|
|
50
49
|
throw new Error("saleKey is not a sale key");
|
|
51
50
|
for (const [what, x] of Object.entries({
|
|
52
51
|
sellerCommit: p.sellerCommit,
|
|
53
52
|
sellerItemFallback: p.sellerItemFallback,
|
|
54
|
-
boundsCommit: p.boundsCommit,
|
|
55
53
|
postedCommit: p.postedCommit,
|
|
56
54
|
}))
|
|
57
55
|
if (x < 0n || x >= R)
|
|
58
56
|
throw new Error(`${what} is not a field element`);
|
|
59
|
-
if (!Number.isInteger(p.maxBids) || p.maxBids < 1 || p.maxBids > SLOTS)
|
|
60
|
-
throw new Error("maxBids is not 1 to 16");
|
|
61
57
|
if (p.listing.length < 1 || p.listing.length > MAX_LISTING_BYTES)
|
|
62
58
|
throw new Error("the sealed listing is not 1 to 2048 bytes");
|
|
63
59
|
assertMemo(p.memo);
|
|
@@ -66,13 +62,11 @@ export function openArgs(p) {
|
|
|
66
62
|
...addressBytes(p.pool, "pool"),
|
|
67
63
|
...le(p.sellerCommit, 32, "sellerCommit"),
|
|
68
64
|
...le(p.sellerItemFallback, 32, "sellerItemFallback"),
|
|
69
|
-
...le(p.boundsCommit, 32, "boundsCommit"),
|
|
70
65
|
...le(p.postedCommit, 32, "postedCommit"),
|
|
71
66
|
...blake2b(p.listing, { dkLen: 32 }),
|
|
72
67
|
...p.memo,
|
|
73
68
|
...le(p.closeMs, 8, "closeMs"),
|
|
74
69
|
...le(p.finishByMs, 8, "finishByMs"),
|
|
75
|
-
...le(BigInt(p.maxBids), 8, "maxBids"),
|
|
76
70
|
...addressBytes(p.item.id, "item"),
|
|
77
71
|
...bcsBytes(Uint8Array.from(ascii(p.item.typeName))),
|
|
78
72
|
]);
|
|
@@ -80,15 +74,14 @@ export function openArgs(p) {
|
|
|
80
74
|
/** The seller's room secrets from the note key it reserved, so the seed alone reopens them. */
|
|
81
75
|
export function saleSecrets(own) {
|
|
82
76
|
const tagged = (t) => poseidonHash([own.sk, own.blinding, t]);
|
|
83
|
-
return { sellerSk: own.sk, sellerSecret: tagged(7n),
|
|
77
|
+
return { sellerSk: own.sk, sellerSecret: tagged(7n), postedSalt: tagged(9n) };
|
|
84
78
|
}
|
|
85
|
-
/** The
|
|
79
|
+
/** The three commits `sale_room::open` stores. PRV-24 A: the posted commit is the price SaleSettle charges. */
|
|
86
80
|
export function openCommits(s, price) {
|
|
87
81
|
const sellerPk = notePk(s.sellerSk);
|
|
88
82
|
return {
|
|
89
83
|
sellerCommit: poseidonHash([DOM_SELLER, sellerPk, poseidonHash([s.sellerSecret])]),
|
|
90
84
|
sellerItemFallback: itemClaimCommit(sellerPk, fallbackSalt(s.sellerSecret)),
|
|
91
|
-
boundsCommit: poseidonHash([DOM_BOUNDS, price, price, s.boundsSalt]),
|
|
92
85
|
postedCommit: postedCommit({ price, salt: s.postedSalt }),
|
|
93
86
|
};
|
|
94
87
|
}
|
package/dist/v3/stage1.d.ts
CHANGED
|
@@ -34,7 +34,6 @@ export type OpenRequest = {
|
|
|
34
34
|
round: bigint;
|
|
35
35
|
/** From the current `Round`. Null when that dynamic field was not supplied. */
|
|
36
36
|
closeMs: bigint | null;
|
|
37
|
-
offers: number | null;
|
|
38
37
|
loanCoin: CoinKey;
|
|
39
38
|
collateralCoin: CoinKey;
|
|
40
39
|
};
|
|
@@ -86,20 +85,16 @@ export type LoanOpening = {
|
|
|
86
85
|
request?: ReqOpening;
|
|
87
86
|
terms?: KeeperTerms;
|
|
88
87
|
};
|
|
89
|
-
/** D-SPEC §6.2:600. Public fields of a sealed sale room. */
|
|
88
|
+
/** D-SPEC §6.2:600. Public fields of a sealed sale room; since PRV-28 B+C a room holds no bid count. */
|
|
90
89
|
export type OpenSale = {
|
|
91
90
|
id: string;
|
|
92
91
|
coin: CoinKey;
|
|
93
92
|
state: number;
|
|
94
93
|
closeMs: bigint;
|
|
95
|
-
bids: number;
|
|
96
94
|
};
|
|
97
|
-
/** D-SPEC §6.2:600.
|
|
95
|
+
/** D-SPEC §6.2:600. */
|
|
98
96
|
export type MySaleView = OpenSale & {
|
|
99
97
|
finishByMs: bigint;
|
|
100
|
-
maxBids: bigint;
|
|
101
|
-
minPrice: bigint | null;
|
|
102
|
-
maxPrice: bigint | null;
|
|
103
98
|
};
|
|
104
99
|
/** D-SPEC §6.2:599. */
|
|
105
100
|
export type SaleOpenParams = {
|
|
@@ -111,7 +106,6 @@ export type SaleOpenParams = {
|
|
|
111
106
|
/** How long bids are taken, on the bid-window set of `sales/seller.ts` saleTimes. */
|
|
112
107
|
bidWindowMs: number;
|
|
113
108
|
finishWindowMs: number;
|
|
114
|
-
maxBids: number;
|
|
115
109
|
/** Absent: the relayer pays when one with an address is set up, else `submitSaleOpen` does. */
|
|
116
110
|
sponsored?: boolean;
|
|
117
111
|
};
|
|
@@ -147,8 +141,6 @@ export declare function assertCoin(coin: unknown): asserts coin is CoinKey;
|
|
|
147
141
|
export declare function poolId(config: V3Config, coin: CoinKey): string;
|
|
148
142
|
export declare function coinByPool(config: V3Config, pool: string): CoinKey;
|
|
149
143
|
export declare function requireSale(config: V3Config): void;
|
|
150
|
-
/** C-SPEC (`v3/docs/specs/C-SPEC.md:179`): Poseidon4(DOM_BOUNDS, lo, hi, boundsSalt). */
|
|
151
|
-
export declare function boundsCommit(lo: bigint, hi: bigint, salt: bigint): bigint;
|
|
152
144
|
/** D-SPEC §6.2:582. Opens one ciphertext. A commitment that does not rebuild is tampered. */
|
|
153
145
|
export declare function openPosition(coin: CoinKey, index: number, events: PoolEvents, seed: Uint8Array): PoolPosition;
|
|
154
146
|
/** D-SPEC §6.2:582. The same open, plus the commitment the chain published. */
|
|
@@ -176,24 +168,19 @@ export declare function summarizeRoom(config: V3Config, row: {
|
|
|
176
168
|
id: string;
|
|
177
169
|
json: unknown;
|
|
178
170
|
}): OpenSale;
|
|
179
|
-
/** D-SPEC §6.2:600.
|
|
180
|
-
export declare
|
|
171
|
+
/** D-SPEC §6.2:600. */
|
|
172
|
+
export declare const viewRoomObject: (config: V3Config, row: {
|
|
181
173
|
id: string;
|
|
182
174
|
json: unknown;
|
|
183
|
-
}
|
|
184
|
-
lo: bigint;
|
|
185
|
-
hi: bigint;
|
|
186
|
-
salt: bigint;
|
|
187
|
-
} | null): MySaleView;
|
|
175
|
+
}) => MySaleView;
|
|
188
176
|
/** D-SPEC §6.2:588. Refuses before any envelope is built. */
|
|
189
177
|
export declare function assertLoanOpen(p: LoanOpenParams): void;
|
|
190
|
-
/** D-SPEC §6.2:599. Copies each argument once.
|
|
178
|
+
/** D-SPEC §6.2:599. Copies each argument once. */
|
|
191
179
|
export declare function assertSaleOpen(p: SaleOpenParams): SaleOpenParams;
|
|
192
180
|
/**
|
|
193
|
-
* The room the sponsor named is this open: same coin pool, close
|
|
194
|
-
* (`sale_room.move:181-193`).
|
|
181
|
+
* The room the sponsor named is this open: same coin pool, close and finish window (`sale_room.move:98-113`).
|
|
195
182
|
*/
|
|
196
|
-
export declare function assertRoomMatches(config: V3Config, open: Pick<SaleOpenParams, "coin" | "finishWindowMs"
|
|
183
|
+
export declare function assertRoomMatches(config: V3Config, open: Pick<SaleOpenParams, "coin" | "finishWindowMs"> & {
|
|
197
184
|
closeMs: number;
|
|
198
185
|
}, row: {
|
|
199
186
|
id: string;
|
package/dist/v3/stage1.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stage1.d.ts","sourceRoot":"","sources":["../../src/v3/stage1.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stage1.d.ts","sourceRoot":"","sources":["../../src/v3/stage1.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGlE,OAAO,EAAE,SAAS,EAAW,cAAc,EAAiB,MAAM,sBAAsB,CAAC;AAEzF,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;AAErC,OAAO,EAIL,KAAK,WAAW,EAChB,KAAK,UAAU,EAChB,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAIpD,OAAO,EAAsC,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAEtF;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