Skip to content

Commit 33936b3

Browse files
fix: handle BigInt serialization for ecosystem wallets (#4756)
## Problem solved Short description of the bug fixed or feature added <!-- start pr-codex --> --- ## PR-Codex overview The focus of this PR is to handle biging serialization for ecosystem wallets. ### Detailed summary - Updated `signTypedData`, `signMessage`, and `signTransaction` functions to use `stringify` for serialization - Improved handling of payload data in ecosystem wallets > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent 1133ccc commit 33936b3

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

.changeset/proud-eggs-rule.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+
Handle biging serialization for ecosystem wallets

packages/thirdweb/src/wallets/in-app/web/lib/actions/sign-message.enclave.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { ThirdwebClient } from "../../../../../client/client.js";
22
import { getThirdwebBaseUrl } from "../../../../../utils/domains.js";
33
import { getClientFetch } from "../../../../../utils/fetch.js";
4+
import { stringify } from "../../../../../utils/json.js";
45
import type { Ecosystem } from "../../types.js";
56
import { getAuthToken } from "../get-auth-token.js";
67

@@ -28,7 +29,7 @@ export async function signMessage({
2829
"x-thirdweb-client-id": client.clientId,
2930
Authorization: `Bearer embedded-wallet-token:${authToken}`,
3031
},
31-
body: JSON.stringify({
32+
body: stringify({
3233
messagePayload: {
3334
message,
3435
isRaw,

packages/thirdweb/src/wallets/in-app/web/lib/actions/sign-transaction.enclave.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type { ThirdwebClient } from "../../../../../client/client.js";
22
import { getThirdwebBaseUrl } from "../../../../../utils/domains.js";
33
import type { Hex } from "../../../../../utils/encoding/hex.js";
44
import { getClientFetch } from "../../../../../utils/fetch.js";
5+
import { stringify } from "../../../../../utils/json.js";
56
import type { Ecosystem } from "../../types.js";
67
import { getAuthToken } from "../get-auth-token.js";
78

@@ -27,7 +28,7 @@ export async function signTransaction({
2728
"x-thirdweb-client-id": client.clientId,
2829
Authorization: `Bearer embedded-wallet-token:${authToken}`,
2930
},
30-
body: JSON.stringify({
31+
body: stringify({
3132
transactionPayload: payload,
3233
}),
3334
},

packages/thirdweb/src/wallets/in-app/web/lib/actions/sign-typed-data.enclave.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type { TypedDataDefinition } from "viem";
33
import type { ThirdwebClient } from "../../../../../client/client.js";
44
import { getThirdwebBaseUrl } from "../../../../../utils/domains.js";
55
import { getClientFetch } from "../../../../../utils/fetch.js";
6+
import { stringify } from "../../../../../utils/json.js";
67
import type { Ecosystem } from "../../types.js";
78
import { getAuthToken } from "../get-auth-token.js";
89

@@ -30,7 +31,7 @@ export async function signTypedData<
3031
"x-thirdweb-client-id": client.clientId,
3132
Authorization: `Bearer embedded-wallet-token:${authToken}`,
3233
},
33-
body: JSON.stringify({
34+
body: stringify({
3435
...payload,
3536
}),
3637
},

0 commit comments

Comments
 (0)