Skip to content

docs: encode the WizardConnect sign request before sending it over th… - #477

Open
AhmadReza6610 wants to merge 1 commit into
CashScript:masterfrom
AhmadReza6610:docs/wizardconnect-relay-serialization
Open

AhmadReza6610 wants to merge 1 commit into
CashScript:masterfrom
AhmadReza6610:docs/wizardconnect-relay-serialization

Conversation

@AhmadReza6610

@AhmadReza6610 AhmadReza6610 commented Oct 25, 2026 •

Copy link
Copy Markdown

The WizardConnect "Wallet Interaction" example passes the WcTransactionObject straight to dappConnectionManager.signTransaction(). The WizardConnect relay serializes messages with JSON.stringify, and the object holds bigint and Uint8Array fields, so the example throws TypeError: Do not know how to serialize a BigInt.

I ran into this building a dapp with WizardConnect and Cashonize. This PR encodes the request with libauth's stringify, the same way the BCH WalletConnect example on the same page already does, and adds a sentence explaining why.

Checked:

  • Built a real request with CashScript 0.14 (a contract input with placeholder sig/pubkey, so it carries the contract field, plus a P2PKH input with tokens).
  • Plain JSON.stringify of the old request throws the BigInt error.
  • JSON.parse(stringify(transaction)) passes Cashonize's StrictWizSignTransactionRequestSchema, keeping contract.artifact.contractName, contract.abiFunction.name, redeemScript and the token amounts.
  • The same payload round-trips through @wizardconnect/core's parseExtendedJson.

Docs-only change.

…e 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 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 25, 2026

Copy link
Copy Markdown

@AhmadReza6610 is attempting to deploy a commit to the Kalis Software Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

Copy link
Copy Markdown

Pull request stats

Docs Total Net Share
Website +7 −1 +7 −1 +6 100%
Total +7 −1 +7 −1 +6 100%

Reviewable churn: 8 lines (net +6), version bumps and generated files excluded.

@codecov

codecov Bot commented Oct 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.25%. Comparing base (5f0eaff) to head (502d48b).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #477   +/-   ##
=======================================
  Coverage   89.25%   89.25%           
=======================================
  Files          61       61           
  Lines        5081     5081           
  Branches      950      950           
=======================================
  Hits         4535     4535           
  Misses        421      421           
  Partials      125      125           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant