update eth-provider to support different providers
Ideally eth-provider checks which connection is available and uses the available one. frame => local node => infura But it seems there is still a bug and it raises an error if frame is not available. But at least we can use frame now for testnet/mainnet deployments
This commit is contained in:
@@ -21,7 +21,14 @@ const providerForNetwork = (network) => (
|
||||
if (settings) {
|
||||
return new HDWalletProviderPrivkey(settings.keys, settings.rpc)
|
||||
} else {
|
||||
return provider('frame');
|
||||
let preset;
|
||||
if (network === 'mainnet') {
|
||||
preset = 'infura';
|
||||
} else {
|
||||
let [first, ...rest] = network;
|
||||
preset = `infura${first.toUpperCase()}${rest.join('')}`;
|
||||
}
|
||||
return provider('frame', 'local', preset);
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user