Files
bls-wallet/extension/source/background/ProviderConfig.ts
Andrew Morris 1303ffea9b Add network switching (#273)
* Update config system in prep for network switching

* Move builtinNetworks into config

* Move currencyConversionConfig into config

* Select network in ui

* mixtureHasChanged

* Fix issue where ethers Web3Provider assumes network doesn't change, handle addresses changing per network

* Implement per-network information for wallets

* lookupAddress -> pkHashToAddress

* Fix duplication of getting bls network config

* Restore preferred nonce sourcing

* Fix global access of blsNetworksConfig

* Fix global config access

* Fix commented hasChanged

* Fix build failures

* Fix linting issues

* Update extension/config.release.json

Co-authored-by: Jacob Caban-Tomski <jacque006@users.noreply.github.com>

* Update with PR feedback

Switch $preferences to non-$ name.
Add hidden field to networks to hide from end users.
Refactor wallet network data generation. Needs one more pass.

* PR fixes

Fix trailing comma in config json.
Properly inject env vars into config file.

* Move MultiNetowrkConfig to bls-wallet-clients

Add MultiNetworkConfig to clients. Deprecate NetworkConfig.
Update deps in clients.
Add chai-as-promised, ts-node to clients.
Remove need for transpiliation before client tests.
Finish getAndUpdateWalletsNetworkData changes in extension.

* Remove .only from client tests

* Use MultiNetworkConfig from clients lib.

* Fix file misspelling

* Update bls-wallet-clients experimental with main

* Remove empty local.json from CI build

* Update setup script with new extension config

Add troubleshooting section for Deno version

* Update extension & aggregator configs.

Update extension configs to hide all non-deployed networks.
Update aggregator local config to use pks 0 & 1 from main hardhat mnemonic.
Add dangerous command to print private keys from main hardhat mnemonic.

* Default extension network to arbitrum goerli

* Revert changes in aggregator local env

Co-authored-by: Jacob Caban-Tomski <jacque006@users.noreply.github.com>
2022-09-13 20:57:07 -06:00

55 lines
1.4 KiB
TypeScript

import * as io from 'io-ts';
import optional from '../types/optional';
export const ProviderConfig = io.type({
/**
* Block explorer url for the chain
* @example https://ropsten.etherscan.io
*/
blockExplorerUrl: io.string,
/**
* Logo url for the base token
*/
logo: io.string,
/**
* @example 'Binance Token', 'Ether', 'Matic Network Token'
*/
chainCurrencyName: io.string,
/**
* @example BNB, ETH
*/
chainCurrency: io.string,
/**
* RPC target Url for the chain
* @example https://ropsten.infura.io/v3/YOUR_API_KEY
*/
rpcTarget: io.string,
/**
* Chain Id parameter(hex with 0x prefix) for the network. Mandatory for all
* networks. (assign one with a map to network identifier for platforms)
* @example 0x1 for mainnet, 'loading' if not connected to anything yet or
* connection fails
* @defaultValue 'loading'
*/
chainId: io.string,
/**
* Display name for the network
*/
displayName: io.string,
/**
* The base url of an aggregator api enabling BLS signature aggregation with
* bundles from other users.
*/
aggregatorUrl: io.string,
/**
* Unique key for network (used for infura)
*/
networkKey: io.string,
/**
* Whether this provider should be displayed in extension (default: true)
*/
hidden: optional(io.boolean),
});
export type ProviderConfig = io.TypeOf<typeof ProviderConfig>;