MCPcopy Create free account
hub / github.com/api3dao/airnode / getProvider

Function getProvider

packages/airnode-examples/src/evm.ts:15–21  ·  view source on GitHub ↗
(chain = SameOrCrossChain.same)

Source from the content-addressed store, hash-verified

13 * @returns The ethers provider connected to the provider URL specified in the "integration-info.json".
14 */
15export const getProvider = (chain = SameOrCrossChain.same) => {
16 const integrationInfo = readIntegrationInfo();
17 const providerUrl =
18 chain === SameOrCrossChain.cross ? integrationInfo.crossChainProviderUrl! : integrationInfo.providerUrl;
19 const provider = new ethers.providers.JsonRpcProvider(providerUrl);
20 return provider;
21};
22
23/**
24 * Reads the mnemonic and provider URL from "integration-info.json" and returns the connected wallet.

Callers 7

getUserWalletFunction · 0.85
readChainIdFunction · 0.85
waitForFulfillmentFunction · 0.85
printWalletBalancesFunction · 0.85
mainFunction · 0.85
waitForFulfillmentFunction · 0.85
makeRequestFunction · 0.85

Calls 1

readIntegrationInfoFunction · 0.90

Tested by

no test coverage detected