From 84fbdaa1e95073b8f313a48fc510dbb1cee9b006 Mon Sep 17 00:00:00 2001 From: gregfromstl Date: Wed, 26 Mar 2025 10:27:54 -0700 Subject: [PATCH 1/2] fix: account for bigint values in engine typed data --- .changeset/social-shoes-start.md | 5 +++++ packages/thirdweb/src/wallets/engine/index.ts | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 .changeset/social-shoes-start.md diff --git a/.changeset/social-shoes-start.md b/.changeset/social-shoes-start.md new file mode 100644 index 00000000000..c717542b9ca --- /dev/null +++ b/.changeset/social-shoes-start.md @@ -0,0 +1,5 @@ +--- +"thirdweb": patch +--- + +Account for bigint values in engine wallet typed data diff --git a/packages/thirdweb/src/wallets/engine/index.ts b/packages/thirdweb/src/wallets/engine/index.ts index 7b29d9c1d89..3f6635e3c6a 100644 --- a/packages/thirdweb/src/wallets/engine/index.ts +++ b/packages/thirdweb/src/wallets/engine/index.ts @@ -1,3 +1,4 @@ +import { stringify } from "../../utils/json.js"; import type { Chain } from "../../chains/types.js"; import type { Hex } from "../../utils/encoding/hex.js"; import { toHex } from "../../utils/encoding/hex.js"; @@ -108,7 +109,7 @@ export function engineAccount(options: EngineAccountOptions): Account { const engineRes = await fetch(ENGINE_URL, { method: "POST", headers, - body: JSON.stringify(engineData), + body: stringify(engineData), }); if (!engineRes.ok) { const body = await engineRes.text(); @@ -178,7 +179,7 @@ export function engineAccount(options: EngineAccountOptions): Account { const engineRes = await fetch(ENGINE_URL, { method: "POST", headers, - body: JSON.stringify({ + body: stringify({ message: engineMessage, isBytes, chainId: chain?.id, @@ -201,7 +202,7 @@ export function engineAccount(options: EngineAccountOptions): Account { const engineRes = await fetch(ENGINE_URL, { method: "POST", headers, - body: JSON.stringify({ + body: stringify({ domain: _typedData.domain, types: _typedData.types, value: _typedData.message, From 34946625b6e410960e8b05655beac420d2af35bb Mon Sep 17 00:00:00 2001 From: gregfromstl Date: Wed, 26 Mar 2025 10:28:36 -0700 Subject: [PATCH 2/2] lint --- packages/thirdweb/src/wallets/engine/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/thirdweb/src/wallets/engine/index.ts b/packages/thirdweb/src/wallets/engine/index.ts index 3f6635e3c6a..1d982d22023 100644 --- a/packages/thirdweb/src/wallets/engine/index.ts +++ b/packages/thirdweb/src/wallets/engine/index.ts @@ -1,7 +1,7 @@ -import { stringify } from "../../utils/json.js"; import type { Chain } from "../../chains/types.js"; import type { Hex } from "../../utils/encoding/hex.js"; import { toHex } from "../../utils/encoding/hex.js"; +import { stringify } from "../../utils/json.js"; import type { Account, SendTransactionOption } from "../interfaces/wallet.js"; /**