generated from proofoftom/buidler-waffle-typechain-quasar
-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor etherscan provider to extract API key from custom config
- Loading branch information
Showing
7 changed files
with
78 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,15 @@ | ||
import { HardhatConfig } from 'hardhat/types' | ||
import { BaseProvider } from './BaseProvider' | ||
import { EtherscanProvider } from './EtherscanProvider' | ||
|
||
export type CreateProviderArgs = { | ||
network: string | ||
etherscanApiKey: string | ||
config: HardhatConfig | ||
} | ||
|
||
export class ProviderFactory { | ||
static createProvider({ | ||
network, | ||
etherscanApiKey, | ||
}: CreateProviderArgs): BaseProvider { | ||
static createProvider({ network, config }: CreateProviderArgs): BaseProvider { | ||
// use etherscan provider only as JsonRpcProvider is not reliable | ||
return new EtherscanProvider(etherscanApiKey, network) | ||
return new EtherscanProvider(config, network) | ||
} | ||
} |