@rozoai/checkout 0.1.14 → 0.1.16
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/README.md +132 -0
- package/docs/QUICKSTART.es.md +1 -1
- package/docs/QUICKSTART.ja.md +1 -1
- package/docs/QUICKSTART.md +1 -1
- package/docs/QUICKSTART.zh.md +1 -1
- package/llms.txt +8 -0
- package/package.json +1 -1
- package/scripts/dist/cli.js +800 -62
- package/scripts/dist/create-order.js +20 -0
- package/scripts/dist/quote.js +9 -0
- package/scripts/dist/receipt.js +1195 -0
- package/scripts/dist/send-evm.js +300 -13
- package/scripts/dist/send-sol.js +122 -27
- package/scripts/dist/status.js +381 -8
|
@@ -66,7 +66,16 @@ function redact(text) {
|
|
|
66
66
|
);
|
|
67
67
|
return s;
|
|
68
68
|
}
|
|
69
|
+
var PublicHash = class {
|
|
70
|
+
constructor(value) {
|
|
71
|
+
this.value = value;
|
|
72
|
+
}
|
|
73
|
+
toJSON() {
|
|
74
|
+
return this.value;
|
|
75
|
+
}
|
|
76
|
+
};
|
|
69
77
|
function redactDeep(value) {
|
|
78
|
+
if (value instanceof PublicHash) return value.value;
|
|
70
79
|
if (typeof value === "string") return redact(value);
|
|
71
80
|
if (Array.isArray(value)) return value.map(redactDeep);
|
|
72
81
|
if (value && typeof value === "object") {
|
|
@@ -1256,6 +1265,17 @@ async function main(argv) {
|
|
|
1256
1265
|
expiresAt: created.expiresAt ?? null,
|
|
1257
1266
|
expiresIn: Number.isFinite(remainingMs) ? formatRemaining(remainingMs) : null
|
|
1258
1267
|
},
|
|
1268
|
+
// Machine-readable form of the guidance below. The live order keeps
|
|
1269
|
+
// its own coin; a different coin is only possible once it has
|
|
1270
|
+
// expired unfunded (then pay on the same link creates a new order).
|
|
1271
|
+
nextAction: {
|
|
1272
|
+
type: "choose_method",
|
|
1273
|
+
canRetryQuery: true,
|
|
1274
|
+
canCreateOrder: false,
|
|
1275
|
+
canSend: false,
|
|
1276
|
+
payExistingWith: { chainId: existing.chainId ?? null, tokenSymbol: existing.tokenSymbol ?? null },
|
|
1277
|
+
switchPossibleAfter: created.expiresAt ?? null
|
|
1278
|
+
},
|
|
1259
1279
|
guidance: `Either pay the existing order with ${existing.tokenSymbol ?? "its own coin"} (re-run with --chain ${existing.chainId} --token ${existing.tokenSymbol}), or wait ${Number.isFinite(remainingMs) ? formatRemaining(remainingMs) : "for it to expire"} for it to expire and then create a new one. Unpaid orders cost nothing.`
|
|
1260
1280
|
},
|
|
1261
1281
|
EXIT_ERROR
|
package/scripts/dist/quote.js
CHANGED
|
@@ -40,7 +40,16 @@ function redact(text) {
|
|
|
40
40
|
);
|
|
41
41
|
return s;
|
|
42
42
|
}
|
|
43
|
+
var PublicHash = class {
|
|
44
|
+
constructor(value) {
|
|
45
|
+
this.value = value;
|
|
46
|
+
}
|
|
47
|
+
toJSON() {
|
|
48
|
+
return this.value;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
43
51
|
function redactDeep(value) {
|
|
52
|
+
if (value instanceof PublicHash) return value.value;
|
|
44
53
|
if (typeof value === "string") return redact(value);
|
|
45
54
|
if (Array.isArray(value)) return value.map(redactDeep);
|
|
46
55
|
if (value && typeof value === "object") {
|