Skip to content

Conversation

@naveenkumar29052006
Copy link

@naveenkumar29052006 naveenkumar29052006 commented Dec 8, 2025

Summary

This PR adds support for importing wallets using 24-word mnemonic phrases (in addition to the existing 12-word support) and fixes missing Content-Type headers in API requests that were causing 400 Bad Request errors.

Changes

1. 24-Word Mnemonic Support (ImportWallet.tsx)

  • Added a radio button selector to choose between 12-word and 24-word mnemonic phrases
  • Added phraseLength field to form state to track the selected phrase length
  • Updated mnemonic validation to properly validate variable-length phrases
  • Improved dummy mnemonic generation to work with both 12 and 24-word phrases
  • Added wallettype: 'sw-fb' parameter to the wallet recovery API call

2. API Header Fixes (JmWalletApi.ts)

  • Added missing Content-Type: application/json headers to all POST requests:
    • /v1/token
    • /v1/wallet/create
    • /v1/wallet/recover
    • /v1/wallet/{walletFileName}/unlock
    • /v1/wallet/{walletFileName}/maker/start
    • /v1/wallet/{walletFileName}/taker/direct-send
    • /v1/wallet/{walletFileName}/taker/coinjoin
    • /v1/wallet/{walletFileName}/freeze
    • /v1/wallet/{walletFileName}/taker/schedule
    • /v1/wallet/{walletFileName}/configset
    • /v1/wallet/{walletFileName}/configget

Motivation

  • 24-word support: BIP39 standard supports both 12 and 24-word mnemonic phrases. Users with 24-word phrases were unable to import their wallets.
  • API headers: The JoinMarket API expects Content-Type: application/json headers for POST requests with JSON bodies. Missing headers were causing 400 Bad Request errors during wallet operations.

Testing

  • Manually tested importing wallet with 12-word mnemonic phrase
  • Manually tested importing wallet with 24-word mnemonic phrase
  • Verified API requests now include proper Content-Type headers
  • Code formatted with Prettier (pre-commit hook)

naveenkumar29052006 and others added 2 commits December 8, 2025 15:15
- Add radio button selector to choose between 12 and 24-word mnemonic phrases
- Update mnemonic validation to support variable phrase lengths
- Fix missing Content-Type headers in API requests
- Improve dummy mnemonic generation for different phrase lengths
- Add wallettype parameter to wallet recovery API call
@naveenkumar29052006
Copy link
Author

@theborakompanioni

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