Skip to content

Commit

Permalink
refactor: remove optional subGraphURL
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulRBerg committed Aug 14, 2023
1 parent 748e265 commit f1b3312
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
3 changes: 1 addition & 2 deletions src/strategies/sablier-v1-deposit/examples.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
"name": "sablier-v1-deposit",
"params": {
"sender": "0xC9F2D9adfa6C24ce0D5a999F2BA3c6b06E36F75E",
"token": "0x7f8F6E42C169B294A384F5667c303fd8Eedb3CF3",
"subGraphURL": "https://api.thegraph.com/subgraphs/name/sablierhq/sablier-goerli"
"token": "0x7f8F6E42C169B294A384F5667c303fd8Eedb3CF3"
}
},
"network": "5",
Expand Down
11 changes: 5 additions & 6 deletions src/strategies/sablier-v1-deposit/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ const SUBGRAPH_URL = {
'42': 'https://api.thegraph.com/subgraphs/name/sablier-labs/sablier-kovan', // kovan
'56': 'https://api.thegraph.com/subgraphs/name/sablier-labs/sablier-bsc', // bsc
'137': 'https://api.thegraph.com/subgraphs/name/sablier-labs/sablier-matic', // polygon
'42161': 'https://api.thegraph.com/subgraphs/name/sablier-labs/sablier-arbitrum', // arbitrum
'43114': 'https://api.thegraph.com/subgraphs/name/sablier-labs/sablier-avalanche' // avalanche
'42161':
'https://api.thegraph.com/subgraphs/name/sablier-labs/sablier-arbitrum', // arbitrum
'43114':
'https://api.thegraph.com/subgraphs/name/sablier-labs/sablier-avalanche' // avalanche
};

export const author = 'sablier-labs';
Expand Down Expand Up @@ -48,10 +50,7 @@ export async function strategy(
// @ts-ignore
params.streams.__args.block = { number: snapshot };
}
const result = await subgraphRequest(
options.subGraphURL ? options.subGraphURL : SUBGRAPH_URL[network],
params
);
const result = await subgraphRequest(SUBGRAPH_URL[network], params);
const score = Object.fromEntries(
addresses.map((address) => [getAddress(address), 0])
);
Expand Down
5 changes: 0 additions & 5 deletions src/strategies/sablier-v1-deposit/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@
"pattern": "^0x[a-fA-F0-9]{40}$",
"minLength": 42,
"maxLength": 42
},
"subGraphURL": {
"type": "string",
"title": "Optional subgraph url",
"examples": ["e.g. 0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984"]
}
},
"required": ["sender", "token"],
Expand Down

0 comments on commit f1b3312

Please sign in to comment.