@paydlux/agent 0.1.16 → 0.1.17

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/phone-app/app.js +3 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paydlux/agent",
3
- "version": "0.1.16",
3
+ "version": "0.1.17",
4
4
  "description": "Payments for AI agents that a human approves. Spending mandates enforced on the Stellar ledger: 2-of-2 vault, pre-authorised transaction envelopes, HTTP 402, USDC.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/phone-app/app.js CHANGED
@@ -508,8 +508,9 @@ async function signAndSubmit() {
508
508
  // file computed, so the native side is asked to sign exactly what was on
509
509
  // screen and is never handed a transaction to interpret.
510
510
  const pre = X.signaturePreimage(hash);
511
- const sig = new Uint8Array(await signPreimage(X.hex(pre)));
512
511
  if (!approverPubBytes) throw new Error("this device lost the approver's public key — re-import it");
512
+ if (!globalThis.PaydluxVerify) throw new Error("this approver page is missing verify.js — nothing was signed");
513
+ const sig = new Uint8Array(await signPreimage(X.hex(pre)));
513
514
  // Prove the signature came from the key this screen named, before a byte
514
515
  // of it leaves the device. A bridge that signs with some other key is then
515
516
  // useless: its output never reaches the ledger.
@@ -583,6 +584,7 @@ async function readPasted() {
583
584
  throw new Error("that is not the hash the seller quoted \u2014 nothing was signed");
584
585
  }
585
586
  const sig = new Uint8Array(await signPreimage(X.hex(X.signaturePreimage(hash))));
587
+ if (!globalThis.PaydluxVerify) throw new Error("this approver page is missing verify.js \u2014 nothing was signed");
586
588
  if (!await globalThis.PaydluxVerify.verifySignature(sig, hash, approverPubBytes)) {
587
589
  throw new Error("the signature does not match this key — nothing was produced");
588
590
  }