Skip to content

Commit e5026a1

Browse files
authored
[SDK] Fix: Account for bigint values in engine typed data (#6562)
1 parent 9c1c5f2 commit e5026a1

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

.changeset/social-shoes-start.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
Account for bigint values in engine wallet typed data

packages/thirdweb/src/wallets/engine/index.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { Chain } from "../../chains/types.js";
22
import type { Hex } from "../../utils/encoding/hex.js";
33
import { toHex } from "../../utils/encoding/hex.js";
4+
import { stringify } from "../../utils/json.js";
45
import type { Account, SendTransactionOption } from "../interfaces/wallet.js";
56

67
/**
@@ -108,7 +109,7 @@ export function engineAccount(options: EngineAccountOptions): Account {
108109
const engineRes = await fetch(ENGINE_URL, {
109110
method: "POST",
110111
headers,
111-
body: JSON.stringify(engineData),
112+
body: stringify(engineData),
112113
});
113114
if (!engineRes.ok) {
114115
const body = await engineRes.text();
@@ -178,7 +179,7 @@ export function engineAccount(options: EngineAccountOptions): Account {
178179
const engineRes = await fetch(ENGINE_URL, {
179180
method: "POST",
180181
headers,
181-
body: JSON.stringify({
182+
body: stringify({
182183
message: engineMessage,
183184
isBytes,
184185
chainId: chain?.id,
@@ -201,7 +202,7 @@ export function engineAccount(options: EngineAccountOptions): Account {
201202
const engineRes = await fetch(ENGINE_URL, {
202203
method: "POST",
203204
headers,
204-
body: JSON.stringify({
205+
body: stringify({
205206
domain: _typedData.domain,
206207
types: _typedData.types,
207208
value: _typedData.message,

0 commit comments

Comments
 (0)