Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leather Wallet Fails to Sign Transaction: Clarity Type: 48 (v7.0.4) and Generic Error (v6.13.0) #1788

Open
bmteo1 opened this issue Feb 23, 2025 · 3 comments

Comments

@bmteo1
Copy link

bmteo1 commented Feb 23, 2025

Description

When generating a transaction hex (txHex) using makeUnsignedContractCall from @stacks/transactions and sending it to Leather Wallet for signing, we encounter two distinct issues depending on the library version:

  • Version 7.0.4 (latest at the time): The Leather popup opens but displays "DeserializationError: Cannot recognize Clarity Type: 48", and the "Confirm" button is not clickable.
  • Version 6.13.0: The popup opens, but signing fails with a generic error { "jsonrpc": "2.0", "id": "...", "error": {} }, and no specific error message is provided.

This prevents users from confirming and signing the transaction in a presale widget.

Steps to Reproduce

  1. Install @stacks/[email protected] (or @stacks/[email protected]).
  2. Create a transaction with makeUnsignedContractCall using these options:
    {
      "contractAddress": "ST2HTPFD9QDXZZGQ2FA4TXKH30PX3YHST0H4JFE0E",
      "contractName": "cat-presale-f3",
      "functionName": "buy-tokens",
      "functionArgs": [{"type": 1, "value": "150000000"}],
      "network": "testnet",
      "senderAddress": "STMN839RM7GAG79Y9574TTZMEKHKKR6RNZC71CDR",
      "fee": "5000",
      "nonce": "85"
    }
@kyranjamie
Copy link
Contributor

@bmteo1 in the latest version of stacks.js, what you've shared causes a type error

Image

@janniks
Copy link
Collaborator

janniks commented Feb 26, 2025

For the latest breaking release these have moved to string literal types. e.g. { type: 'uint', value: "10" }
For and easier way of correctly constructing Clarity values I would recommend using the Cl. helper bundle of @stacks/transactions e.g. Cl.uint(10)

@janniks
Copy link
Collaborator

janniks commented Feb 26, 2025

Can you share more of your code for serializing? I'm getting this expected error for this when using the latest v7 stacks.js

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 New
Development

No branches or pull requests

3 participants