Skip to content

WS createNFT ignores createMintAuthority/createMeltAuthority options #1138

Description

@tuliomir

Summary

HathorWalletServiceWallet.createNFT() declares the options createMintAuthority and createMeltAuthority (defaulting to false), but they are never read: the method delegates to prepareCreateNewToken, which reads the pass-through createMint / createMelt fields instead — and those default to true.

Net effect: a wallet-service caller passing createMintAuthority: false, createMeltAuthority: false still gets an NFT created with both authorities. The declared options are dead code.

Where

  • src/wallet/wallet.tscreateNFT() declares createMintAuthority/createMeltAuthority (~lines 2877–2882) and never maps them to what prepareCreateNewToken consumes.
  • src/wallet/wallet.tsprepareCreateNewToken() reads createMint/createMelt with default true (~lines 1892–1895).

For contrast, the fullnode facade's createNFTSendTransaction (src/new/wallet.ts, ~lines 3076–3090) defaults createMint: false, createMelt: false — so the two facades also silently diverge on effective defaults.

Suggested fix

Map createMintAuthority/createMeltAuthority onto createMint/createMelt inside createNFT() (or rename the options), and align the effective default with the fullnode facade (false) — NFTs typically should not carry authorities unless requested.

Context

Found while migrating token-creation integration tests to the shared adapter-driven suite; the test adapter works around it by always forwarding explicit createMint/createMelt booleans to both facades.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions