Skip to content

[BUG]: Stellar Testnet not applied after network switch in Chrome extension #11610

@ceydae

Description

@ceydae

Describe the bug

When using the OneKey Chrome extension and switching the network from Stellar Mainnet to Stellar Testnet, the wallet does not display the TESTNET XLM balance.

Additionally, calling:

window.$onekey.stellar.getNetwork()

still returns the Mainnet network instead of Testnet after switching.

Another related issue occurs when signing a Stellar Testnet transaction:

const result = await window.$onekey!.stellar!.signTransaction(xdr, {
  address: options.address,
  networkPassphrase: 'Test SDF Network ; September 2015', // Stellar TESTNET
});

When the OneKey modal opens, it still displays Stellar Mainnet transaction data and shows an error saying the wallet does not have enough XLM to fund the transaction, even though the transaction is intended for Stellar Testnet.

To Reproduce

  1. Open the OneKey Chrome extension.
  2. Switch the network from Stellar Mainnet to Stellar Testnet.
  3. Observe that the TESTNET XLM balance is not displayed.
  4. Call:
window.$onekey.stellar.getNetwork()
  1. Observe that it still returns Mainnet.
  2. Attempt to sign a Stellar Testnet transaction using:
const result = await window.$onekey!.stellar!.signTransaction(xdr, {
  address: options.address,
  networkPassphrase: 'Test SDF Network ; September 2015',
});
  1. Observe that the signing modal still behaves as if the transaction is on Mainnet and reports insufficient XLM balance.

Expected behavior

  • Switching to Stellar Testnet should display the correct TESTNET XLM balance.
  • window.$onekey.stellar.getNetwork() should return the currently selected network (Testnet).
  • The signing modal should recognize the transaction as a Stellar Testnet transaction and use the Testnet account/balance context instead of Mainnet.

Desktop (please complete the following information)

  • OS: Ubuntu 24.04
  • Browser: Chrome
  • Version: 139.0.7258

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions