@t2000/cli 10.1.0 → 10.1.2
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/{chunk-HGOJTYD2.js → chunk-KYPSLUUW.js} +12 -1
- package/dist/{chunk-HGOJTYD2.js.map → chunk-KYPSLUUW.js.map} +1 -1
- package/dist/{dist-55NHJBLJ.js → dist-I27FW5PV.js} +13 -2
- package/dist/{dist-55NHJBLJ.js.map → dist-I27FW5PV.js.map} +1 -1
- package/dist/{dist-SCHDNWY6.js → dist-LX227YY4.js} +2 -2
- package/dist/index.js +3 -3
- package/package.json +3 -3
- /package/dist/{dist-SCHDNWY6.js.map → dist-LX227YY4.js.map} +0 -0
|
@@ -9996,6 +9996,7 @@ async function payWithMpp(args) {
|
|
|
9996
9996
|
{ payTo: requirements.payTo, priceUsdc: price, escrow }
|
|
9997
9997
|
);
|
|
9998
9998
|
}
|
|
9999
|
+
assertNotSelfPayment(signer.getAddress(), requirements.payTo);
|
|
9999
10000
|
const result = await payViaX402({ signer, client, options, reqInit, requirements });
|
|
10000
10001
|
await reportDirectPayment(result, options.url);
|
|
10001
10002
|
return result;
|
|
@@ -10009,6 +10010,7 @@ async function payWithMpp(args) {
|
|
|
10009
10010
|
{ dialect: "mpp-header", signerKind: "zklogin" }
|
|
10010
10011
|
);
|
|
10011
10012
|
}
|
|
10013
|
+
assertNotSelfPayment(signer.getAddress(), headerChallenge.recipient);
|
|
10012
10014
|
const result = await payViaMppHeader({ signer, client, options });
|
|
10013
10015
|
await reportDirectPayment(result, options.url);
|
|
10014
10016
|
return result;
|
|
@@ -10155,6 +10157,15 @@ async function payViaMppHeader(args) {
|
|
|
10155
10157
|
receipt: paymentDigest ? { reference: paymentDigest, timestamp: (/* @__PURE__ */ new Date()).toISOString() } : void 0
|
|
10156
10158
|
};
|
|
10157
10159
|
}
|
|
10160
|
+
function assertNotSelfPayment(payer, payTo) {
|
|
10161
|
+
if (normalizeSuiAddress(payer) === normalizeSuiAddress(payTo)) {
|
|
10162
|
+
throw new T2000Error(
|
|
10163
|
+
"FACILITATOR_REJECTION",
|
|
10164
|
+
"This endpoint pays YOUR OWN wallet \u2014 a self-payment nets a zero balance change, so the seller will not serve it. Nothing was paid. Test your endpoint from a different wallet (e.g. the t2 CLI wallet).",
|
|
10165
|
+
{ payer, payTo }
|
|
10166
|
+
);
|
|
10167
|
+
}
|
|
10168
|
+
}
|
|
10158
10169
|
function assertWithinMaxPrice(price, maxPrice) {
|
|
10159
10170
|
if (maxPrice !== void 0 && price > maxPrice) {
|
|
10160
10171
|
throw new T2000Error(
|
|
@@ -12863,4 +12874,4 @@ export {
|
|
|
12863
12874
|
@scure/bip39/index.js:
|
|
12864
12875
|
(*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) *)
|
|
12865
12876
|
*/
|
|
12866
|
-
//# sourceMappingURL=chunk-
|
|
12877
|
+
//# sourceMappingURL=chunk-KYPSLUUW.js.map
|