run402 4.137.0 → 4.138.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/lib/billing.mjs +2 -2
- package/lib/qr-png.mjs +359 -0
- package/lib/qr-png.test.mjs +59 -0
- package/package.json +1 -3
- package/sdk/dist/node/_paid-stack.d.ts +3 -1
- package/sdk/dist/node/_paid-stack.d.ts.map +1 -1
- package/sdk/dist/node/_paid-stack.js +7 -4
- package/sdk/dist/node/_paid-stack.js.map +1 -1
- package/sdk/dist/node/deploy-manifest.d.ts.map +1 -1
- package/sdk/dist/node/deploy-manifest.js +103 -29
- package/sdk/dist/node/deploy-manifest.js.map +1 -1
- package/sdk/dist/node/vendor/x402-offer-receipt/LICENSE +201 -0
- package/sdk/dist/node/vendor/x402-offer-receipt/NOTICE +15 -0
- package/sdk/dist/node/vendor/x402-offer-receipt/VENDORED.md +25 -0
- package/sdk/dist/node/vendor/x402-offer-receipt/index.d.ts +38 -0
- package/sdk/dist/node/vendor/x402-offer-receipt/index.d.ts.map +1 -0
- package/sdk/dist/node/vendor/x402-offer-receipt/index.js +140 -0
- package/sdk/dist/node/vendor/x402-offer-receipt/index.js.map +1 -0
- package/vault-surface.json +1 -1
package/lib/billing.mjs
CHANGED
|
@@ -308,8 +308,8 @@ async function topup(args) {
|
|
|
308
308
|
if (qrPath) {
|
|
309
309
|
// Uppercase bolt11 in a `LIGHTNING:` URI is what wallets and the BOLT11
|
|
310
310
|
// spec recommend for QR: alphanumeric mode, a third fewer modules.
|
|
311
|
-
const {
|
|
312
|
-
await
|
|
311
|
+
const { writeQrPng } = await import("./qr-png.mjs");
|
|
312
|
+
await writeQrPng(qrPath, `LIGHTNING:${created.bolt11.toUpperCase()}`, { width: 512, margin: 2 });
|
|
313
313
|
console.error(`QR written to ${qrPath} — post the image where the payer can scan it.`);
|
|
314
314
|
}
|
|
315
315
|
if (!parsedArgs.includes("--wait")) {
|
package/lib/qr-png.mjs
ADDED
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
// A QR code (ISO/IEC 18004, error correction level M) written as a PNG, for
|
|
2
|
+
// `billing topup --qr`. Replaces the `qrcode` package and its tree (`yargs`,
|
|
3
|
+
// `pngjs`, `dijkstrajs` and 26 more) for the one image the CLI draws. The
|
|
4
|
+
// encoder follows Project Nayuki's QR Code generator (MIT); the PNG is one
|
|
5
|
+
// grayscale IDAT through node:zlib.
|
|
6
|
+
|
|
7
|
+
import { writeFile } from "node:fs/promises";
|
|
8
|
+
import { deflateSync } from "node:zlib";
|
|
9
|
+
|
|
10
|
+
// Level M, indexed by version (index 0 unused).
|
|
11
|
+
const ECC_CODEWORDS_PER_BLOCK = [-1, 10, 16, 26, 18, 24, 16, 18, 22, 22, 26, 30, 22, 22, 24, 24, 28, 28, 26, 26, 26, 26, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28];
|
|
12
|
+
const ERROR_CORRECTION_BLOCKS = [-1, 1, 1, 1, 2, 2, 4, 4, 4, 5, 5, 5, 8, 9, 9, 10, 10, 11, 13, 14, 16, 17, 17, 18, 20, 21, 23, 25, 26, 28, 29, 31, 33, 35, 37, 38, 40, 43, 45, 47, 49];
|
|
13
|
+
const FORMAT_BITS_M = 0;
|
|
14
|
+
const ALPHANUMERIC = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";
|
|
15
|
+
|
|
16
|
+
function rawDataModules(version) {
|
|
17
|
+
let result = (16 * version + 128) * version + 64;
|
|
18
|
+
if (version >= 2) {
|
|
19
|
+
const align = Math.floor(version / 7) + 2;
|
|
20
|
+
result -= (25 * align - 10) * align - 55;
|
|
21
|
+
if (version >= 7) result -= 36;
|
|
22
|
+
}
|
|
23
|
+
return result;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const dataCodewords = (version) =>
|
|
27
|
+
Math.floor(rawDataModules(version) / 8) - ECC_CODEWORDS_PER_BLOCK[version] * ERROR_CORRECTION_BLOCKS[version];
|
|
28
|
+
|
|
29
|
+
/** One segment: alphanumeric mode when every character allows it (the uppercase BOLT11 case), else UTF-8 bytes. */
|
|
30
|
+
function segment(text) {
|
|
31
|
+
if ([...text].every((ch) => ALPHANUMERIC.includes(ch))) {
|
|
32
|
+
const bits = [];
|
|
33
|
+
for (let i = 0; i + 1 < text.length; i += 2) {
|
|
34
|
+
pushBits(bits, ALPHANUMERIC.indexOf(text[i]) * 45 + ALPHANUMERIC.indexOf(text[i + 1]), 11);
|
|
35
|
+
}
|
|
36
|
+
if (text.length % 2 === 1) pushBits(bits, ALPHANUMERIC.indexOf(text.at(-1)), 6);
|
|
37
|
+
return { mode: 0x2, countBits: [9, 11, 13], count: text.length, bits };
|
|
38
|
+
}
|
|
39
|
+
const bytes = new TextEncoder().encode(text);
|
|
40
|
+
const bits = [];
|
|
41
|
+
for (const b of bytes) pushBits(bits, b, 8);
|
|
42
|
+
return { mode: 0x4, countBits: [8, 16, 16], count: bytes.length, bits };
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function pushBits(bits, value, length) {
|
|
46
|
+
for (let i = length - 1; i >= 0; i--) bits.push((value >>> i) & 1);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function gfMultiply(x, y) {
|
|
50
|
+
let z = 0;
|
|
51
|
+
for (let i = 7; i >= 0; i--) {
|
|
52
|
+
z = (z << 1) ^ ((z >>> 7) * 0x11d);
|
|
53
|
+
z ^= ((y >>> i) & 1) * x;
|
|
54
|
+
}
|
|
55
|
+
return z;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function rsDivisor(degree) {
|
|
59
|
+
const result = new Array(degree).fill(0);
|
|
60
|
+
result[degree - 1] = 1;
|
|
61
|
+
let root = 1;
|
|
62
|
+
for (let i = 0; i < degree; i++) {
|
|
63
|
+
for (let j = 0; j < degree; j++) {
|
|
64
|
+
result[j] = gfMultiply(result[j], root);
|
|
65
|
+
if (j + 1 < degree) result[j] ^= result[j + 1];
|
|
66
|
+
}
|
|
67
|
+
root = gfMultiply(root, 0x02);
|
|
68
|
+
}
|
|
69
|
+
return result;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function rsRemainder(data, divisor) {
|
|
73
|
+
const result = divisor.map(() => 0);
|
|
74
|
+
for (const b of data) {
|
|
75
|
+
const factor = b ^ result.shift();
|
|
76
|
+
result.push(0);
|
|
77
|
+
divisor.forEach((coef, i) => { result[i] ^= gfMultiply(coef, factor); });
|
|
78
|
+
}
|
|
79
|
+
return result;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function interleaveWithEcc(data, version) {
|
|
83
|
+
const blocks = ERROR_CORRECTION_BLOCKS[version];
|
|
84
|
+
const eccLength = ECC_CODEWORDS_PER_BLOCK[version];
|
|
85
|
+
const raw = Math.floor(rawDataModules(version) / 8);
|
|
86
|
+
const shortBlocks = blocks - (raw % blocks);
|
|
87
|
+
const shortLength = Math.floor(raw / blocks);
|
|
88
|
+
const divisor = rsDivisor(eccLength);
|
|
89
|
+
const out = [];
|
|
90
|
+
for (let i = 0, k = 0; i < blocks; i++) {
|
|
91
|
+
const block = data.slice(k, k + shortLength - eccLength + (i < shortBlocks ? 0 : 1));
|
|
92
|
+
k += block.length;
|
|
93
|
+
const ecc = rsRemainder(block, divisor);
|
|
94
|
+
if (i < shortBlocks) block.push(0);
|
|
95
|
+
out.push(block.concat(ecc));
|
|
96
|
+
}
|
|
97
|
+
const result = [];
|
|
98
|
+
for (let i = 0; i < out[0].length; i++) {
|
|
99
|
+
out.forEach((block, j) => {
|
|
100
|
+
if (i !== shortLength - eccLength || j >= shortBlocks) result.push(block[i]);
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
return result;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function alignmentPositions(version, size) {
|
|
107
|
+
if (version === 1) return [];
|
|
108
|
+
const count = Math.floor(version / 7) + 2;
|
|
109
|
+
const step = Math.floor((version * 8 + count * 3 + 5) / (count * 4 - 4)) * 2;
|
|
110
|
+
const result = [6];
|
|
111
|
+
for (let pos = size - 7; result.length < count; pos -= step) result.splice(1, 0, pos);
|
|
112
|
+
return result;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const MASKS = [
|
|
116
|
+
(x, y) => (x + y) % 2 === 0,
|
|
117
|
+
(_x, y) => y % 2 === 0,
|
|
118
|
+
(x) => x % 3 === 0,
|
|
119
|
+
(x, y) => (x + y) % 3 === 0,
|
|
120
|
+
(x, y) => (Math.floor(x / 3) + Math.floor(y / 2)) % 2 === 0,
|
|
121
|
+
(x, y) => ((x * y) % 2) + ((x * y) % 3) === 0,
|
|
122
|
+
(x, y) => (((x * y) % 2) + ((x * y) % 3)) % 2 === 0,
|
|
123
|
+
(x, y) => (((x + y) % 2) + ((x * y) % 3)) % 2 === 0,
|
|
124
|
+
];
|
|
125
|
+
|
|
126
|
+
class Matrix {
|
|
127
|
+
constructor(version) {
|
|
128
|
+
this.version = version;
|
|
129
|
+
this.size = version * 4 + 17;
|
|
130
|
+
this.dark = Array.from({ length: this.size }, () => new Array(this.size).fill(false));
|
|
131
|
+
this.fixed = Array.from({ length: this.size }, () => new Array(this.size).fill(false));
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
place(x, y, dark) {
|
|
135
|
+
this.dark[y][x] = dark;
|
|
136
|
+
this.fixed[y][x] = true;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
drawFunctionPatterns() {
|
|
140
|
+
const { size } = this;
|
|
141
|
+
for (let i = 0; i < size; i++) {
|
|
142
|
+
this.place(6, i, i % 2 === 0);
|
|
143
|
+
this.place(i, 6, i % 2 === 0);
|
|
144
|
+
}
|
|
145
|
+
for (const [cx, cy] of [[3, 3], [size - 4, 3], [3, size - 4]]) {
|
|
146
|
+
for (let dy = -4; dy <= 4; dy++) {
|
|
147
|
+
for (let dx = -4; dx <= 4; dx++) {
|
|
148
|
+
const x = cx + dx;
|
|
149
|
+
const y = cy + dy;
|
|
150
|
+
const distance = Math.max(Math.abs(dx), Math.abs(dy));
|
|
151
|
+
if (x >= 0 && x < size && y >= 0 && y < size) this.place(x, y, distance !== 2 && distance !== 4);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
const align = alignmentPositions(this.version, size);
|
|
156
|
+
align.forEach((ax, i) => align.forEach((ay, j) => {
|
|
157
|
+
const corner = (i === 0 && j === 0) || (i === 0 && j === align.length - 1) || (i === align.length - 1 && j === 0);
|
|
158
|
+
if (corner) return;
|
|
159
|
+
for (let dy = -2; dy <= 2; dy++) {
|
|
160
|
+
for (let dx = -2; dx <= 2; dx++) this.place(ax + dx, ay + dy, Math.max(Math.abs(dx), Math.abs(dy)) !== 1);
|
|
161
|
+
}
|
|
162
|
+
}));
|
|
163
|
+
this.drawFormatBits(0);
|
|
164
|
+
if (this.version >= 7) {
|
|
165
|
+
let rem = this.version;
|
|
166
|
+
for (let i = 0; i < 12; i++) rem = (rem << 1) ^ ((rem >>> 11) * 0x1f25);
|
|
167
|
+
const bits = (this.version << 12) | rem;
|
|
168
|
+
for (let i = 0; i < 18; i++) {
|
|
169
|
+
const dark = ((bits >>> i) & 1) === 1;
|
|
170
|
+
const a = size - 11 + (i % 3);
|
|
171
|
+
const b = Math.floor(i / 3);
|
|
172
|
+
this.place(a, b, dark);
|
|
173
|
+
this.place(b, a, dark);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
drawFormatBits(mask) {
|
|
179
|
+
const data = (FORMAT_BITS_M << 3) | mask;
|
|
180
|
+
let rem = data;
|
|
181
|
+
for (let i = 0; i < 10; i++) rem = (rem << 1) ^ ((rem >>> 9) * 0x537);
|
|
182
|
+
const bits = ((data << 10) | rem) ^ 0x5412;
|
|
183
|
+
const bit = (i) => ((bits >>> i) & 1) === 1;
|
|
184
|
+
const { size } = this;
|
|
185
|
+
for (let i = 0; i <= 5; i++) this.place(8, i, bit(i));
|
|
186
|
+
this.place(8, 7, bit(6));
|
|
187
|
+
this.place(8, 8, bit(7));
|
|
188
|
+
this.place(7, 8, bit(8));
|
|
189
|
+
for (let i = 9; i < 15; i++) this.place(14 - i, 8, bit(i));
|
|
190
|
+
for (let i = 0; i < 8; i++) this.place(size - 1 - i, 8, bit(i));
|
|
191
|
+
for (let i = 8; i < 15; i++) this.place(8, size - 15 + i, bit(i));
|
|
192
|
+
this.place(8, size - 8, true);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
drawCodewords(codewords) {
|
|
196
|
+
const { size } = this;
|
|
197
|
+
let i = 0;
|
|
198
|
+
for (let right = size - 1; right >= 1; right -= 2) {
|
|
199
|
+
if (right === 6) right = 5;
|
|
200
|
+
for (let vert = 0; vert < size; vert++) {
|
|
201
|
+
for (let j = 0; j < 2; j++) {
|
|
202
|
+
const x = right - j;
|
|
203
|
+
const y = ((right + 1) & 2) === 0 ? size - 1 - vert : vert;
|
|
204
|
+
if (!this.fixed[y][x] && i < codewords.length * 8) {
|
|
205
|
+
this.dark[y][x] = ((codewords[i >>> 3] >>> (7 - (i & 7))) & 1) === 1;
|
|
206
|
+
i++;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
applyMask(mask) {
|
|
214
|
+
for (let y = 0; y < this.size; y++) {
|
|
215
|
+
for (let x = 0; x < this.size; x++) {
|
|
216
|
+
if (!this.fixed[y][x] && MASKS[mask](x, y)) this.dark[y][x] = !this.dark[y][x];
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/** ISO/IEC 18004 mask penalty: long runs, 2x2 blocks, finder-like patterns, dark balance. */
|
|
222
|
+
penalty() {
|
|
223
|
+
const { size, dark } = this;
|
|
224
|
+
let score = 0;
|
|
225
|
+
const lines = [];
|
|
226
|
+
for (let i = 0; i < size; i++) {
|
|
227
|
+
lines.push(dark[i]);
|
|
228
|
+
lines.push(dark.map((row) => row[i]));
|
|
229
|
+
}
|
|
230
|
+
for (const line of lines) {
|
|
231
|
+
for (let i = 0, run = 1; i < size; i++, run++) {
|
|
232
|
+
if (i === size - 1 || line[i] !== line[i + 1]) {
|
|
233
|
+
if (run >= 5) score += run - 2;
|
|
234
|
+
run = 0;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
const text = line.map((d) => (d ? "1" : "0")).join("");
|
|
238
|
+
for (const pattern of ["10111010000", "00001011101"]) {
|
|
239
|
+
for (let at = text.indexOf(pattern); at !== -1; at = text.indexOf(pattern, at + 1)) score += 40;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
let darkCount = 0;
|
|
243
|
+
for (let y = 0; y < size; y++) {
|
|
244
|
+
for (let x = 0; x < size; x++) {
|
|
245
|
+
if (dark[y][x]) darkCount++;
|
|
246
|
+
if (x < size - 1 && y < size - 1) {
|
|
247
|
+
const c = dark[y][x];
|
|
248
|
+
if (c === dark[y][x + 1] && c === dark[y + 1][x] && c === dark[y + 1][x + 1]) score += 3;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
const total = size * size;
|
|
253
|
+
score += (Math.ceil(Math.abs(darkCount * 20 - total * 10) / total) - 1) * 10;
|
|
254
|
+
return score;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* The QR modules for `text` at level M: `modules[y][x]` is true for dark.
|
|
260
|
+
* `version` and `mask` are chosen automatically unless given.
|
|
261
|
+
*/
|
|
262
|
+
export function encodeQr(text, { version: forcedVersion, mask: forcedMask } = {}) {
|
|
263
|
+
const seg = segment(text);
|
|
264
|
+
let version = forcedVersion ?? 1;
|
|
265
|
+
let bits;
|
|
266
|
+
for (;; version++) {
|
|
267
|
+
if (version > 40) throw new Error("QR payload too long");
|
|
268
|
+
const countBits = seg.countBits[version <= 9 ? 0 : version <= 26 ? 1 : 2];
|
|
269
|
+
const used = 4 + countBits + seg.bits.length;
|
|
270
|
+
if (seg.count < 2 ** countBits && used <= dataCodewords(version) * 8) {
|
|
271
|
+
bits = [];
|
|
272
|
+
pushBits(bits, seg.mode, 4);
|
|
273
|
+
pushBits(bits, seg.count, countBits);
|
|
274
|
+
bits.push(...seg.bits);
|
|
275
|
+
break;
|
|
276
|
+
}
|
|
277
|
+
if (forcedVersion !== undefined) throw new Error(`QR payload does not fit version ${forcedVersion}`);
|
|
278
|
+
}
|
|
279
|
+
const capacity = dataCodewords(version) * 8;
|
|
280
|
+
pushBits(bits, 0, Math.min(4, capacity - bits.length));
|
|
281
|
+
pushBits(bits, 0, (8 - (bits.length % 8)) % 8);
|
|
282
|
+
const data = [];
|
|
283
|
+
for (let i = 0; i < bits.length; i += 8) data.push(parseInt(bits.slice(i, i + 8).join(""), 2));
|
|
284
|
+
for (let pad = 0xec; data.length < capacity / 8; pad ^= 0xec ^ 0x11) data.push(pad);
|
|
285
|
+
|
|
286
|
+
const matrix = new Matrix(version);
|
|
287
|
+
matrix.drawFunctionPatterns();
|
|
288
|
+
matrix.drawCodewords(interleaveWithEcc(data, version));
|
|
289
|
+
let mask = forcedMask;
|
|
290
|
+
if (mask === undefined) {
|
|
291
|
+
let best = Infinity;
|
|
292
|
+
for (let m = 0; m < 8; m++) {
|
|
293
|
+
matrix.applyMask(m);
|
|
294
|
+
matrix.drawFormatBits(m);
|
|
295
|
+
const score = matrix.penalty();
|
|
296
|
+
if (score < best) {
|
|
297
|
+
best = score;
|
|
298
|
+
mask = m;
|
|
299
|
+
}
|
|
300
|
+
matrix.applyMask(m);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
matrix.applyMask(mask);
|
|
304
|
+
matrix.drawFormatBits(mask);
|
|
305
|
+
return { version, mask, size: matrix.size, modules: matrix.dark };
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
const CRC_TABLE = Array.from({ length: 256 }, (_, n) => {
|
|
309
|
+
let c = n;
|
|
310
|
+
for (let k = 0; k < 8; k++) c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1;
|
|
311
|
+
return c >>> 0;
|
|
312
|
+
});
|
|
313
|
+
|
|
314
|
+
function crc32(bytes) {
|
|
315
|
+
let c = 0xffffffff;
|
|
316
|
+
for (const b of bytes) c = CRC_TABLE[(c ^ b) & 0xff] ^ (c >>> 8);
|
|
317
|
+
return (c ^ 0xffffffff) >>> 0;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
function chunk(type, data) {
|
|
321
|
+
const out = Buffer.alloc(12 + data.length);
|
|
322
|
+
out.writeUInt32BE(data.length, 0);
|
|
323
|
+
out.write(type, 4, "ascii");
|
|
324
|
+
data.copy(out, 8);
|
|
325
|
+
out.writeUInt32BE(crc32(out.subarray(4, 8 + data.length)), 8 + data.length);
|
|
326
|
+
return out;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/** A grayscale PNG of `text` as a QR code, `width` pixels square with a `margin` of light modules. */
|
|
330
|
+
export function qrPng(text, { width = 512, margin = 2 } = {}) {
|
|
331
|
+
const { size, modules } = encodeQr(text);
|
|
332
|
+
const span = size + margin * 2;
|
|
333
|
+
const scale = Math.max(1, width / span);
|
|
334
|
+
const pixels = Math.floor(span * scale);
|
|
335
|
+
const rows = Buffer.alloc((pixels + 1) * pixels, 0xff);
|
|
336
|
+
for (let py = 0; py < pixels; py++) {
|
|
337
|
+
rows[py * (pixels + 1)] = 0; // filter: none
|
|
338
|
+
const my = Math.floor(py / scale) - margin;
|
|
339
|
+
for (let px = 0; px < pixels; px++) {
|
|
340
|
+
const mx = Math.floor(px / scale) - margin;
|
|
341
|
+
if (my >= 0 && my < size && mx >= 0 && mx < size && modules[my][mx]) rows[py * (pixels + 1) + 1 + px] = 0;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
const header = Buffer.alloc(13);
|
|
345
|
+
header.writeUInt32BE(pixels, 0);
|
|
346
|
+
header.writeUInt32BE(pixels, 4);
|
|
347
|
+
header[8] = 8; // bit depth
|
|
348
|
+
header[9] = 0; // grayscale
|
|
349
|
+
return Buffer.concat([
|
|
350
|
+
Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]),
|
|
351
|
+
chunk("IHDR", header),
|
|
352
|
+
chunk("IDAT", deflateSync(rows)),
|
|
353
|
+
chunk("IEND", Buffer.alloc(0)),
|
|
354
|
+
]);
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
export async function writeQrPng(path, text, options) {
|
|
358
|
+
await writeFile(path, qrPng(text, options));
|
|
359
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// The pinned digests were produced by this encoder and matched module for
|
|
2
|
+
// module against the `qrcode` package (at the same version and mask) when
|
|
3
|
+
// it replaced that package, over every version 1-40, all eight masks, and
|
|
4
|
+
// both alphanumeric and byte mode.
|
|
5
|
+
import { describe, it } from "node:test";
|
|
6
|
+
import assert from "node:assert/strict";
|
|
7
|
+
import { createHash } from "node:crypto";
|
|
8
|
+
import { inflateSync } from "node:zlib";
|
|
9
|
+
|
|
10
|
+
import { encodeQr, qrPng } from "./qr-png.mjs";
|
|
11
|
+
|
|
12
|
+
const INVOICE = "LIGHTNING:LNBC20U1PJ9X7ZSPP5" + "QZ7C8RT2XJ".repeat(28);
|
|
13
|
+
|
|
14
|
+
function digest(modules) {
|
|
15
|
+
return createHash("sha256").update(modules.map((row) => row.map((d) => (d ? 1 : 0)).join("")).join("")).digest("hex");
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
describe("encodeQr", () => {
|
|
19
|
+
for (const [text, version, mask, sha] of [
|
|
20
|
+
["HELLO WORLD", 1, 0, "9f15327b648fdbb6e3878c9a72183cc1f76f880c1b3e4f53fd7859bb5b4f2421"],
|
|
21
|
+
["lightning:lnbc1 – ünïcode", 3, 3, "8dc8f3d73627d16d3d998fc17724f950d7e5e80ac8a74eea041a495d6eadcf20"],
|
|
22
|
+
[INVOICE, 10, 2, "e52883f489d0a22b6ee8f05919747653f58d9cc3224139886223905fa970708a"],
|
|
23
|
+
]) {
|
|
24
|
+
it(`encodes ${JSON.stringify(text.slice(0, 20))} as version ${version}, mask ${mask}`, () => {
|
|
25
|
+
const qr = encodeQr(text);
|
|
26
|
+
assert.equal(qr.version, version);
|
|
27
|
+
assert.equal(qr.mask, mask);
|
|
28
|
+
assert.equal(qr.size, version * 4 + 17);
|
|
29
|
+
assert.equal(digest(qr.modules), sha);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
it("refuses a payload larger than version 40 holds", () => {
|
|
34
|
+
assert.throws(() => encodeQr("A".repeat(4000)), /QR payload too long/);
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
describe("qrPng", () => {
|
|
39
|
+
it("writes a grayscale PNG whose pixels are the modules", () => {
|
|
40
|
+
const png = qrPng(INVOICE, { width: 512, margin: 2 });
|
|
41
|
+
assert.deepEqual([...png.subarray(0, 8)], [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]);
|
|
42
|
+
assert.equal(png.toString("ascii", 12, 16), "IHDR");
|
|
43
|
+
const width = png.readUInt32BE(16);
|
|
44
|
+
assert.equal(width, 512);
|
|
45
|
+
assert.equal(png.readUInt32BE(20), 512);
|
|
46
|
+
const idatLength = png.readUInt32BE(33);
|
|
47
|
+
assert.equal(png.toString("ascii", 37, 41), "IDAT");
|
|
48
|
+
const rows = inflateSync(png.subarray(41, 41 + idatLength));
|
|
49
|
+
assert.equal(rows.length, (width + 1) * width);
|
|
50
|
+
const { size, modules } = encodeQr(INVOICE);
|
|
51
|
+
const scale = width / (size + 4);
|
|
52
|
+
for (const [mx, my] of [[0, 0], [3, 3], [7, 7], [size - 1, size - 1], [10, 20]]) {
|
|
53
|
+
const px = Math.floor((mx + 2.5) * scale);
|
|
54
|
+
const py = Math.floor((my + 2.5) * scale);
|
|
55
|
+
assert.equal(rows[py * (width + 1) + 1 + px] === 0, modules[my][mx], `module ${mx},${my}`);
|
|
56
|
+
}
|
|
57
|
+
assert.equal(rows[1], 0xff, "the margin is light");
|
|
58
|
+
});
|
|
59
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "run402",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.138.0",
|
|
4
4
|
"description": "CLI for Run402 — full-stack backend infrastructure for AI agents: Postgres, auth, storage, serverless functions and atomic deploys. Paid with x402/MPP. Includes $0.03 image generation.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -33,12 +33,10 @@
|
|
|
33
33
|
"@run402/nwc": "^0.1.0",
|
|
34
34
|
"@scure/base": "1.2.6",
|
|
35
35
|
"@x402/evm": "2.29.0",
|
|
36
|
-
"@x402/extensions": "2.29.0",
|
|
37
36
|
"@x402/fetch": "2.29.0",
|
|
38
37
|
"ipaddr.js": "1.9.1",
|
|
39
38
|
"json-canonicalize": "2.0.0",
|
|
40
39
|
"mppx": "^0.13.1",
|
|
41
|
-
"qrcode": "1.5.4",
|
|
42
40
|
"tsx": "^4.21.0",
|
|
43
41
|
"undici": "^7.29.0",
|
|
44
42
|
"viem": "^2.57.1"
|
|
@@ -11,7 +11,9 @@
|
|
|
11
11
|
* also widens what consumers must install to enable paid fetch. Keep this
|
|
12
12
|
* list minimal. When a symbol is small enough to inline (e.g. the
|
|
13
13
|
* `viem/chains` constants are ~5-line objects), prefer inlining over
|
|
14
|
-
* adding a new dependency edge.
|
|
14
|
+
* adding a new dependency edge. The x402 offer-receipt verification is
|
|
15
|
+
* inlined that way (`vendor/x402-offer-receipt`): `@x402/extensions` is not
|
|
16
|
+
* a dependency.
|
|
15
17
|
*/
|
|
16
18
|
type FetchFn = typeof globalThis.fetch;
|
|
17
19
|
export declare class PaidStackUnavailable extends Error {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_paid-stack.d.ts","sourceRoot":"","sources":["../../src/node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,WAAW,EAAE,KAAK,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC;IAC7D,mBAAmB,EAAE,KAAK,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC;IACrE,IAAI,EAAE,cAAc,MAAM,CAAC,CAAC;IAC5B,SAAS,EAAE,cAAc,eAAe,EAAE,SAAS,CAAC;CACrD;AAED;;;GAGG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC,QAAQ,CAAC,CAoBtD"}
|
|
@@ -11,8 +11,11 @@
|
|
|
11
11
|
* also widens what consumers must install to enable paid fetch. Keep this
|
|
12
12
|
* list minimal. When a symbol is small enough to inline (e.g. the
|
|
13
13
|
* `viem/chains` constants are ~5-line objects), prefer inlining over
|
|
14
|
-
* adding a new dependency edge.
|
|
14
|
+
* adding a new dependency edge. The x402 offer-receipt verification is
|
|
15
|
+
* inlined that way (`vendor/x402-offer-receipt`): `@x402/extensions` is not
|
|
16
|
+
* a dependency.
|
|
15
17
|
*/
|
|
18
|
+
import * as offerReceipt from "./vendor/x402-offer-receipt/index.js";
|
|
16
19
|
export class PaidStackUnavailable extends Error {
|
|
17
20
|
missingPackages;
|
|
18
21
|
constructor(missing) {
|
|
@@ -62,8 +65,8 @@ export async function loadX402Stack() {
|
|
|
62
65
|
const x402Fetch = await c.load("@x402/fetch", () => import("@x402/fetch"));
|
|
63
66
|
const x402EvmClient = await c.load("@x402/evm", () => import("@x402/evm/exact/client"));
|
|
64
67
|
const x402Evm = await c.load("@x402/evm", () => import("@x402/evm"));
|
|
65
|
-
const offerReceipt = await c.load("@x402/extensions", () => import("@x402/extensions/offer-receipt"));
|
|
66
68
|
c.throwIfFailed();
|
|
69
|
+
const verifiers = offerReceipt.offerReceiptVerifiers(viemMod.recoverTypedDataAddress);
|
|
67
70
|
return {
|
|
68
71
|
privateKeyToAccount: accounts.privateKeyToAccount,
|
|
69
72
|
createPublicClient: viemMod.createPublicClient,
|
|
@@ -80,8 +83,8 @@ export async function loadX402Stack() {
|
|
|
80
83
|
findAcceptsObjectFromSignedOffer: offerReceipt.findAcceptsObjectFromSignedOffer,
|
|
81
84
|
isEIP712SignedOffer: offerReceipt.isEIP712SignedOffer,
|
|
82
85
|
isEIP712SignedReceipt: offerReceipt.isEIP712SignedReceipt,
|
|
83
|
-
verifyOfferSignatureEIP712:
|
|
84
|
-
verifyReceiptSignatureEIP712:
|
|
86
|
+
verifyOfferSignatureEIP712: verifiers.verifyOfferSignatureEIP712,
|
|
87
|
+
verifyReceiptSignatureEIP712: verifiers.verifyReceiptSignatureEIP712,
|
|
85
88
|
extractReceiptFromResponse: offerReceipt.extractReceiptFromResponse,
|
|
86
89
|
},
|
|
87
90
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_paid-stack.js","sourceRoot":"","sources":["../../src/node/_paid-stack.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"_paid-stack.js","sourceRoot":"","sources":["../../src/node/_paid-stack.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,YAAY,MAAM,sCAAsC,CAAC;AAIrE,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IACpC,eAAe,CAAoB;IAC5C,YAAY,OAA0B;QACpC,KAAK,CACH,oFAAoF,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;YACxG,kCAAkC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CACxD,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;QACnC,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC;IACjC,CAAC;CACF;AAED,SAAS,gBAAgB,CAAC,GAAY;IACpC,IAAI,CAAC,CAAC,GAAG,YAAY,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAC1C,MAAM,IAAI,GAAI,GAA0B,CAAC,IAAI,CAAC;IAC9C,IAA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,qBAAqB,CAAC;IAC3C,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,IAAI,CAAC,qBAAqB,EAAE,GAAG,EAAE,CACnD,MAAM,CAAC,yBAAyB,CAAC,YAAY,CAI3C,CACH,CAAC;IACF,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IACxD,MAAM,QAAQ,GAAG,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC;IACrE,CAAC,CAAC,aAAa,EAAE,CAAC;IAClB,OAAO;QACL,SAAS,EAAE,GAAI,CAAC,SAAS;QACzB,WAAW,EAAE,GAAI,CAAC,WAAW;QAC7B,mBAAmB,EAAE,GAAI,CAAC,mBAAmB;QAC7C,IAAI,EAAE,IAAK;QACX,SAAS,EAAE,QAAS,CAAC,SAAS;KAC/B,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy-manifest.d.ts","sourceRoot":"","sources":["../../src/node/deploy-manifest.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"deploy-manifest.d.ts","sourceRoot":"","sources":["../../src/node/deploy-manifest.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAIV,mBAAmB,EACpB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAE5D,OAAO,KAAK,EAGV,qBAAqB,EACrB,UAAU,EACV,aAAa,EACb,YAAY,EAGZ,YAAY,EACZ,QAAQ,EACR,WAAW,EAEX,WAAW,EACX,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,+BAA+B,CAAC;AAkCvC,MAAM,MAAM,sBAAsB,GAC9B,eAAe,GACf,iBAA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