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..1d982d22023 100644 --- a/packages/thirdweb/src/wallets/engine/index.ts +++ b/packages/thirdweb/src/wallets/engine/index.ts @@ -1,6 +1,7 @@ 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"; /** @@ -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,