Skip to content

feat: add tx body parser helpers + bump to 1.1.11#16

Merged
ByteZhang1024 merged 1 commit into
asmjsfrom
feat/utils
Apr 15, 2026
Merged

feat: add tx body parser helpers + bump to 1.1.11#16
ByteZhang1024 merged 1 commit into
asmjsfrom
feat/utils

Conversation

@ByteZhang1024

Copy link
Copy Markdown

Expose three CardanoWasm-backed helpers on onekeyUtils:

  • parseRawTxInputs: returns the full ordered input set ({prev_hash, prev_index}[]) from a rawTxHex
  • parseRawTxBodyStakeInfo: returns hasCertificates / hasWithdrawals / requiredSignerHashes for stake-witness-necessity decisions
  • extractStakeKeyHashFromBaseAddress: returns the hex stake key hash for key-credential base addresses, null otherwise

Used by app-monorepo's KeyringHardware on the Cardano dApp signOnly path to (a) rebuild the full firmware-side inputs set including external contract UTXOs, and (b) drop the unneeded stake vkey witness on script-authorized DeFi mints (Minswap LP etc.) so the broadcast body fits the dApp's fee budget. Helpers were previously duplicated in app-monorepo; centralizing them here so all hosts share one implementation.

Expose three CardanoWasm-backed helpers on onekeyUtils:

- parseRawTxInputs: returns the full ordered input set
  ({prev_hash, prev_index}[]) from a rawTxHex
- parseRawTxBodyStakeInfo: returns hasCertificates / hasWithdrawals
  / requiredSignerHashes for stake-witness-necessity decisions
- extractStakeKeyHashFromBaseAddress: returns the hex stake key hash
  for key-credential base addresses, null otherwise

Used by app-monorepo's KeyringHardware on the Cardano dApp signOnly
path to (a) rebuild the full firmware-side inputs set including
external contract UTXOs, and (b) drop the unneeded stake vkey witness
on script-authorized DeFi mints (Minswap LP etc.) so the broadcast
body fits the dApp's fee budget. Helpers were previously duplicated
in app-monorepo; centralizing them here so all hosts share one
implementation.
@revan-zhang

revan-zhang commented Apr 15, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@ByteZhang1024
ByteZhang1024 merged commit 87c43eb into asmjs Apr 15, 2026
8 checks passed
@ByteZhang1024
ByteZhang1024 deleted the feat/utils branch April 15, 2026 04:53
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.

4 participants