From 0b5a39f0d4ed67a465dc4bf1d02c4d83124aa42f Mon Sep 17 00:00:00 2001 From: Peter Kieltyka Date: Sat, 14 Dec 2024 14:27:18 -0500 Subject: [PATCH] account: pass projectAccessKey and jwtAuth for relayer instantiation --- packages/account/src/account.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/account/src/account.ts b/packages/account/src/account.ts index 0531758f2..1ddf263ab 100644 --- a/packages/account/src/account.ts +++ b/packages/account/src/account.ts @@ -215,9 +215,9 @@ export class Account { if (isRelayer(found.relayer)) return found.relayer return new RpcRelayer({ ...found.relayer, - // If there's an access key, we don't pass the JWT, because browser-side usage of this code mandates an access key - // and passing a JWT causes a CORS error. - ...(this.projectAccessKey ? { projectAccessKey: this.projectAccessKey } : { jwtAuth: this.jwt }) + // we pass both projectAccessKey and jwtAuth because the projectAccessKey is + // used either for unauthenticated access, or gas sponsorship even if the jwtAuth is provided, + ...({ projectAccessKey: this.projectAccessKey, jwtAuth: this.jwt }) }) }