CubWallet Docs
中文

Mainnet and testnet

CubWallet currently ships two networks. The current network is chosen by the user in the wallet. A dApp can only read it; it cannot switch.

Networknetworkchain idAddress prefixCore assetDefault nodes
BitShares mainnetmainnet4018d7844c78f6a6c41c6a552b898022310fc5dec06da467ee7905a8dad512c8BTSBTS (1.3.0)wss://api.bitshares.dev<br>wss://api.bts.mobi/ws<br>wss://dex.iobanker.com/ws<br>wss://node.xbts.io/ws<br>wss://api.dex.trading/
BitShares testnettestnet39f5e2ede1f8bc1a3a54a7914414e3779e33193f1f5693510e73cb7a87617447TESTTEST (1.3.0)wss://testnet.dex.trading/<br>wss://testnet.xbts.io/ws

Public-key and address prefixes follow the network: mainnet keys start with BTS, testnet keys with TEST. Account ids look the same (1.2.x) but the two networks do not share accounts. Call bts_chainId first, then use account and asset ids that belong to that network.

The core asset is 1.3.0 on both: BTS on mainnet, TEST on testnet, both with precision 5.

After a network switch

When the user switches networks, the page receives chainChanged with the new { chainId, network }. You should then:

  1. update the network indicator on the page;
  2. call bts_accounts again (permissions are stored per network, so the list usually changes);
  3. drop asset caches, open orders and other state from the previous network.

If this origin has no permission on the new network, bts_accounts returns [] and you need to call bts_requestAccounts again.

Nodes

The wallet uses the node the user selected in Settings (there is a built-in default list). The test dApp also connects to a public read-only node so it can resolve account names and asset symbols, and it checks that node's get_chain_id. Those queries are only for filling forms. Signing uses the wallet's node, and the approval window is authoritative.

Do not assume the node you opened from the page is the same one the wallet uses. Prefer account ids and asset ids when you build operations. If you resolve names yourself, check the chain id first.