hummingbot / hummingbot/hummingbot-api

Gateway - Solana wallet creation fails when nodeURL has leading whitespace

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

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
142
Forks
194
Avg merge
3d 20h
Merged PRs (30d)
7

Description

Describe the bug

While adding a Solana wallet through the Gateway wallet flow, the request failed instead of creating the wallet. Gateway returned Endpoint URL must start with http: or https: from /wallet/add.

Image
#### HAPI logs
2026-09-11 00:17:42 | info |    Adding new wallet for chain: solana
2026-09-11 00:17:42 | error |   Unhandled error: {
  "error": "Endpoint URL must start with `http:` or `https:`.",
  "url": "/wallet/add",
  "params": {}
}

The configured solana-mainnet-beta nodeURL contained a leading space before https://. Gateway accepted this configuration but passed the untrimmed value to the Solana client, which rejected it while the connection was being initialized. Removing the leading space allows the endpoint to use the expected URL format. Gateway should trim surrounding whitespace or reject the value when the configuration is saved, before it can break wallet operations.

Image
Current shape:
  nodeURL: ' https://...'

Required shape:
  nodeURL: 'https://...'

This was found during QA testing after whitespace was accidentally added to the saved nodeURL. Solana is the confirmed reproduction. Ethereum was not tested, but the same mistake may affect Ethereum and other networks that accept a user-provided node URL, so those network configurations should be checked as well.

Fixed after i remove the whitespace

Image
Steps to reproduce bug
  1. Configure the Solana mainnet-beta nodeURL with a leading space before https://
  2. Save the network configuration
  3. Attempt to add a new Solana wallet
  4. Check the Gateway response or log for Endpoint URL must start with http: or https:

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 Gateway /wallet/add flow and the network configuration handling for the Solana nodeURL; reproduce the failure with a leading space before https://. Check how the saved value reaches client initialization and verify that a configured URL with surrounding whitespace no longer breaks wallet creation, or is rejected when saved; check whether the same path serves other networks.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.