From 502d48b39b85672b423bde54c4d1e4b45a872ac2 Mon Sep 17 00:00:00 2001 From: AhmadReza6610 <104721567+AhmadReza6610@users.noreply.github.com> Date: Sun, 25 Oct 2026 12:13:00 +0330 Subject: [PATCH] docs: encode the WizardConnect sign request before sending it over the relay The WizardConnect example passed the WcTransactionObject straight to signTransaction(), but the relay serializes messages with JSON.stringify, so it throws 'Do not know how to serialize a BigInt'. Encode it with libauth's stringify, like the BCH WalletConnect example does. Co-Authored-By: Claude Opus 5.5 --- website/docs/guides/walletconnect.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/website/docs/guides/walletconnect.md b/website/docs/guides/walletconnect.md index 404e09b5c..1e12bce2f 100644 --- a/website/docs/guides/walletconnect.md +++ b/website/docs/guides/walletconnect.md @@ -268,7 +268,10 @@ WizardConnect covers transaction signing only. For arbitrary message signing, us Send the request to your WizardConnect dapp client. Its `signTransaction` method takes the `transaction` and `inputPaths` and returns the signed transaction. +WizardConnect sends requests over its relay as plain JSON, which cannot hold the `bigint` and `Uint8Array` fields of the `WcTransactionObject`. Passing the object as-is throws `TypeError: Do not know how to serialize a BigInt`. Encode the transaction object with libauth's `stringify` first, as with BCH WalletConnect. + ```ts +import { stringify } from "@bitauth/libauth"; import { type WcTransactionObject } from "cashscript"; interface SignTransactionRequest { @@ -280,7 +283,10 @@ async function signWizardTransaction( request: SignTransactionRequest, ): Promise { try { - const result = await dappConnectionManager.signTransaction(request); + const result = await dappConnectionManager.signTransaction({ + transaction: JSON.parse(stringify(request.transaction)), + inputPaths: request.inputPaths, + }); return result.signedTransaction; } catch (error) { return undefined;