Skip to content

Commit

Permalink
feat: allow custom api key
Browse files Browse the repository at this point in the history
  • Loading branch information
Nebulis committed Jul 4, 2020
1 parent de40581 commit 523956c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/common/smartContract/contractInstance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface ContractInstance {
}

export const getProvider = (options: { network: string }): ethers.providers.Provider =>
new ethers.providers.InfuraProvider(options.network, INFURA_API_KEY);
new ethers.providers.InfuraProvider(options.network, process?.env?.INFURA_API_KEY || INFURA_API_KEY);

export const contractInstance = (options: ContractInstance) => {
const contract = new ethers.Contract(options.contractAddress, options.abi, getProvider(options));
Expand Down

0 comments on commit 523956c

Please sign in to comment.