goal:
initialize all providers instead of creating and destroying on network switch while maintaining same external behavior
high level todos:
current status: broke up provider initialization and proxy management into to files
notes/low level todos:
default networks:
~- [ ] never initialize any local hosts unless it's tests. (side option try to initialize and have graceful fallback?)~
[x] async updateAndSetCustomRpc (rpcUrl, chainId, ticker = 'ETH', nickname, rpcPrefs) {
[x] async setCustomRpc (rpcTarget, chainId, ticker = 'ETH', nickname = '', rpcPrefs = {}) {
[x] async delCustomRpc (rpcTarget) {
MIGRATION NEEDS:
~- [ ] network controller needs selected network and networkconfigs
include the defaults in networkConfigs
check what default ticker is needed~
networkConfig = {
rpcUrl,
type, // default#type(chainId) || custom#type(chainId) ???
name,
chainId,
blockExplorer,
}
network class config:
config = { // should ever only be things for the provider or network class no extra bs
rpcUrl,
type,
chainId, // for ethClassic
}
updateAndSetCustomRpc -> takes a single object
async updateAndSetCustomRpc (networkConfig) {
actual:
networkConfig = {
rpcUrl,
type, // infura#eth:mainnet || custom#eth:rpc
custom: {
name,
chainId,
blockExplorer,
ticker,
}
}
wooooooooooo
1104 passing (5s)
2 failing
sooooo close and yet so far
Let's take a little time to explore H4v0c's work on abstracting multiple chain providers, see if there's a chance to leverage their work at all: http://chainstackjs.org/
Most helpful comment
Let's take a little time to explore H4v0c's work on abstracting multiple chain providers, see if there's a chance to leverage their work at all: http://chainstackjs.org/