Skip to content

Commit

Permalink
✨ Adding the RPC param to handle custom rpc
Browse files Browse the repository at this point in the history
  • Loading branch information
TBouder committed Sep 6, 2021
1 parent c607ceb commit eb03725
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pages/api/vaults.js
Expand Up @@ -44,9 +44,13 @@ async function newEthCallProvider(provider) {
return ethcallProvider;
}

export default fn(async ({network = 1}) => {
export default fn(async ({network = 1, rpc}) => {
network = Number(network);
const ethcallProvider = await newEthCallProvider(getProvider(network));
let provider = getProvider(network);
if (rpc !== undefined) {
provider = new ethers.providers.JsonRpcProvider(rpc);
}
const ethcallProvider = await newEthCallProvider(provider);
const _vaults = [];
const _calls = [];

Expand Down

0 comments on commit eb03725

Please sign in to comment.