OneKeyHQ / OneKeyHQ/hardware-js-sdk

"Response type not expected" error when withdrawing Cardano staking rewards or delegating to stakepool

Open
#476 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
35
Forks
39
Avg merge
21h 27m
Merged PRs (30d)
43

Description

Hi, looks like onekey (classic s1 at least) is failing to properly respond to Cardano transactions involving withdrawals or stake pool delegations. When I try to sign a cardano transaction containing a withdrawal, I get the prompt to sign it on the device (any mention of withdrawals there is missing though), or stake pool delegation, on my computer I get the error "Response type not expected". Happens both on NuFi and Eternl wallet. I'm able to send ADA using OneKey wallet without issues, so the connection as such should be working properly.

"@onekeyfe/hd-web-sdk@npm:^1.0.29" and the device is OneKey Classic S1, firmware 3.11.0

Here's the payloads I'm sending to the device through the @onekeyfe/hd-web-sdk connection to the cardanoSignTransaction method:

Withdrawal

{
    "signingMode": 0,
    "protocolMagic": 764824073,
    "networkId": 1,
    "fee": "171749",
    "ttl": "156471386",
    "inputs": [
        {
            "prev_hash": "e1e6de75e6e48a3bc920347b170de566100f60fdb058ed5983ae28359b401dba",
            "prev_index": 1,
            "path": [
                2147485500,
                2147485463,
                2147483648,
                0,
                0
            ]
        }
    ],
    "outputs": [
        {
            "format": 0,
            "amount": "3484443",
            "tokenBundle": [],
            "addressParameters": {
                "addressType": 0,
                "path": [
                    2147485500,
                    2147485463,
                    2147483648,
                    0,
                    0
                ],
                "stakingPath": [
                    2147485500,
                    2147485463,
                    2147483648,
                    2,
                    0
                ]
            }
        }
    ],
    "withdrawals": [
        {
            "path": [
                2147485500,
                2147485463,
                2147483648,
                2,
                0
            ],
            "amount": "18742"
        }
    ],
    "tagCborSets": false
}

Stake pool delegation:

{
    "signingMode": 0,
    "protocolMagic": 764824073,
    "networkId": 1,
    "fee": "173201",
    "ttl": "156472076",
    "inputs": [
        {
            "prev_hash": "e1e6de75e6e48a3bc920347b170de566100f60fdb058ed5983ae28359b401dba",
            "prev_index": 1,
            "path": [
                2147485500,
                2147485463,
                2147483648,
                0,
                0
            ]
        }
    ],
    "outputs": [
        {
            "format": 0,
            "amount": "3464249",
            "tokenBundle": [],
            "addressParameters": {
                "addressType": 0,
                "path": [
                    2147485500,
                    2147485463,
                    2147483648,
                    0,
                    0
                ],
                "stakingPath": [
                    2147485500,
                    2147485463,
                    2147483648,
                    2,
                    0
                ]
            }
        }
    ],
    "certificates": [
        {
            "type": 2,
            "path": [
                2147485500,
                2147485463,
                2147483648,
                2,
                0
            ],
            "pool": "00000036d515e12e18cd3c88c74f09a67984c2c279a5296aa96efe89"
        }
    ],
    "tagCborSets": false
}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the cardanoSignTransaction entry point in the SDK and trace response handling for the provided withdrawal and stake-pool delegation payloads. Reproduce both cases with OneKey Classic S1 firmware 3.11.0, then verify that each transaction returns the expected signing response and that the device prompt includes withdrawal details.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.