Skip to content

Conversation

@fengtality
Copy link
Contributor

@fengtality fengtality commented Dec 27, 2025

Summary

Adds optional defaultNetworks array to Solana and Ethereum chain configs to allow specifying which networks to query for balance operations. This optimizes performance by avoiding queries to all 9+ networks when only 1-2 are needed.

Closes #581

Changes

  • Add defaultNetworks to chain schemas (solana-chain-schema.json, ethereum-chain-schema.json)
  • Set additionalProperties: true for backwards compatibility
  • Add defaultNetworks?: string[] to SolanaChainConfig and EthereumChainConfig interfaces
  • Update config getter functions to include defaultNetworks
  • Add commented examples in template files (solana.yml, ethereum.yml)

Configuration Example

defaultNetwork: mainnet
defaultNetworks:
  - mainnet
  - base

Backwards Compatibility

  • defaultNetworks is optional - if not specified, behavior is unchanged
  • additionalProperties: true ensures existing configs work without modification
  • defaultNetwork remains the primary config for single-network operations

Test plan

  • Verify typecheck passes
  • Verify /config?namespace=ethereum returns defaultNetworks field
  • Verify existing configs without defaultNetworks still work

🤖 Generated with Claude Code

Adds optional defaultNetworks array to Solana and Ethereum chain configs
to allow specifying which networks to query for balance operations. This
optimizes performance by avoiding queries to all 9+ networks when only
1-2 are needed.

Changes:
- Add defaultNetworks to chain schemas with additionalProperties: true
  for backwards compatibility
- Add defaultNetworks to SolanaChainConfig and EthereumChainConfig interfaces
- Update config getter functions to include defaultNetworks
- Add commented examples in template files

Closes #581

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@rapcmia rapcmia changed the title Add defaultNetworks parameter to chain configs feat / Add defaultNetworks parameter to chain configs Jan 5, 2026
@fengtality fengtality added this to the v2.13 milestone Jan 5, 2026
@rapcmia rapcmia self-requested a review January 19, 2026 11:23
@rapcmia rapcmia moved this to Backlog in Pull Request Board Jan 19, 2026
@rapcmia rapcmia moved this from Backlog to Under Review in Pull Request Board Jan 27, 2026
@rapcmia
Copy link
Contributor

rapcmia commented Jan 28, 2026

Commit ec37a77

  • Setup this PR with source build
  • Check changes and compare with dev branch
  • Added ethereum and solana wallets successfully

Test with hummingbot client

  • Run gateway config ethereum update defaultNetworks
    image
  • Run gateway config ethereum update defaultNetworks arbitrum,avalanche
    image
    • User need to set a value for defaultNetworks in the chain config for it to be show and added

Test with gateway routes/endpoints

  • /config/update ✅
    curl -sS http://localhost:15888/config/update -H 'Content-Type: application/json' -u "XXX:XXX" -d '{"namespace":"ethereum","path":"defaultNetworks","value":["arbitrum","avalanche"]}' | jq
    {
      "message": "Configuration updated successfully: 'ethereum.defaultNetworks' set to [\"arbitrum\",\"avalanche\"]"
    }
    logs: 2026-01-28 05:29:55 | info | 	Successfully updated configuration: ethereum.defaultNetworks
    
    #### /config/?namespace=ethereum
    curl -sS "http://localhost:15888/config/?namespace=ethereum" -u "XXX:XXX" | jq
    {
      "defaultNetwork": "mainnet",
      "defaultWallet": "0x08940dc9B5a19FAb9319b77C61DDA7B8067E6843",
      "rpcProvider": "url",
      "defaultNetworks": [
        "arbitrum",
        "avalanche"
      ]
    }
    logs: 2026-01-28 05:29:55 | info | 	Updating config path: ethereum.defaultNetworks with value: ["arbitrum","avalanche"]
    
  • Test invalid networks
  • Add ralphhandsome, does not let me add it ✅
    curl -sS http://localhost:15888/config/update -H 'Content-Type: application/json' -u "XXX:XXX" -d '{"namespace":"ethereum","path":"defaultNetworks","value":["ralphhandsome"]}' | jq
    {
      "statusCode": 400,
      "error": "HttpError",
      "message": "Cannot set ethereum.defaultNetworks to ralphhandsome: JSON schema violation."
    }
    logs: 2026-01-28 05:44:58 | error | 	Failed to update configuration: Cannot set ethereum.defaultNetworks to ralphhandsome: JSON schema violation.
    
  • Add ralphhandsome and ralph_pure_awesomeness, succesfully added ❌
    #### # /config/update
    curl -sS http://localhost:15888/config/update -H 'Content-Type: application/json' -u "XXX:XXX" -d '{"namespace":"ethereum","path":"defaultNetworks","value":["ralphhandsome","ralph_pure_awesomeness"]}' | jq
    {
      "message": "Configuration updated successfully: 'ethereum.defaultNetworks' set to [\"ralphhandsome\",\"ralph_pure_awesomeness\"]"
    }
    logs: 2026-01-28 05:46:32 | info | 	Updating config path: ethereum.defaultNetworks with value: ["ralphhandsome","ralph_pure_awesomeness"]
    
    #### /config/?namespace=ethereum
    curl -sS "http://localhost:15888/config/?namespace=ethereum" -u "XXX:XXX" | jq
    {
      "defaultNetwork": "arbitrum",
      "defaultWallet": "0x08940dc9B5a19FAb9319b77C61DDA7B8067E6843",
      "rpcProvider": "url",
      "defaultNetworks": [
        "ralphhandsome",
        "ralph_pure_awesomeness"
      ]
    }
    
  • Test with balance while defaultNetworks enabled is present

@rapcmia rapcmia moved this from Under Review to Backlog in Pull Request Board Jan 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

3 participants