Skip to content

Commit

Permalink
Adding goerli addresses (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
weitianjie2000 authored Mar 1, 2022
1 parent 9d59256 commit a4ed177
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/Notional.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ try {

/* Endpoints */
const kovanAddresses = require('./config/kovan.json');
const goerliAddresses = require('./config/goerli.json');
const mainnetAddresses = require('./config/mainnet.json');
const graphEndpoints = require('./config/graph.json');

Expand Down Expand Up @@ -76,6 +77,11 @@ export default class Notional extends TransactionBuilder {
graphEndpoint = graphEndpoints['mainnet:http'];
pollInterval = Number(graphEndpoints['mainnet:poll']);
break;
case 5:
addresses = goerliAddresses;
graphEndpoint = graphEndpoints['goerli:http'];
pollInterval = Number(graphEndpoints['goerli:poll']);
break;
case 42:
addresses = kovanAddresses;
graphEndpoint = graphEndpoints['kovan:http'];
Expand Down
2 changes: 2 additions & 0 deletions src/config/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ export function secondsPerBlock(chainId: number) {
switch (chainId) {
case 1:
return 13;
case 5:
return 15;
case 42:
return 4;
default:
Expand Down
10 changes: 10 additions & 0 deletions src/config/goerli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"chainId": 5,
"deployer": "0x2a956Fe94ff89D8992107c8eD4805c30ff1106ef",
"governor": "0x10d1Ca9BcD1Fb2b7d5ecB9A53a348292ee38E524",
"guardian": "0x2a956Fe94ff89D8992107c8eD4805c30ff1106ef",
"networkName": "goerli",
"note": "0xC5e91B01F9B23952821410Be7Aa3c45B6429C670",
"notional": "0xD8229B55bD73c61D840d339491219ec6Fa667B0a",
"startBlock": 6362131
}
4 changes: 3 additions & 1 deletion src/config/graph.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"local:poll": 5000,
"kovan:http": "https://api.thegraph.com/subgraphs/name/notional-finance/kovan-v2",
"kovan:poll": 5000,
"goerli:http": "https://api.thegraph.com/subgraphs/name/notional-finance/goerli-v2",
"goerli:poll": 5000,
"mainnet:http": "https://api.thegraph.com/subgraphs/name/notional-finance/mainnet-v2",
"mainnet:poll": 7000
}
}
3 changes: 3 additions & 0 deletions src/system/datasource/Cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ export default class Cache extends DataSource {
case 1:
this.cacheURL = 'https://api.notional.finance/v1/system';
break;
case 5:
this.cacheURL = 'https://goerli.api.notional.finance/v1/system';
break;
case 42:
this.cacheURL = 'https://kovan.api.notional.finance/v1/system';
break;
Expand Down

0 comments on commit a4ed177

Please sign in to comment.