From 63a47125fd6246099d2f582f47afbf0a4689cba8 Mon Sep 17 00:00:00 2001 From: Dhia Date: Mon, 13 Jul 2026 09:45:57 +0000 Subject: [PATCH] Fix buildApprovals to accept privateKey parameter The buildApprovals function was defined with a single `authorizations` parameter, while every call site and the README passed `buildApprovals(privateKey, authorizations)`. The extra argument was silently dropped and `privateKey` inside the body was an undeclared free variable, so the example threw at runtime before signing any request. Add the missing `privateKey` parameter to match the call sites. Co-Authored-By: Claude Opus 4.8 (1M context) --- examples/authorizations.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/authorizations.js b/examples/authorizations.js index ffb48ca..e1c5355 100644 --- a/examples/authorizations.js +++ b/examples/authorizations.js @@ -89,7 +89,7 @@ const buildApproval = (privateKey, fingerprint, authorizationRequest) => { throw new Error('Unknown authorization request type'); }; -export const buildApprovals = authorizations => { +export const buildApprovals = (privateKey, authorizations) => { return authorizations.map(authorization => buildApproval(privateKey, authorization.fingerprint, authorization.request) );