We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bc8f349 commit fc4db2cCopy full SHA for fc4db2c
packages/subgraph/src/subgraph.ts
@@ -31,10 +31,15 @@ export default class Subgraph {
31
* Initializes the subgraph object with one of the supported networks.
32
* @param network Supported Semaphore network.
33
*/
34
- constructor(network: Network = "arbitrum") {
35
- checkParameter(network, "network", "string")
+ constructor(networkOrSubgraphURL: Network | string = "arbitrum") {
+ checkParameter(networkOrSubgraphURL, "networkOrSubgraphURL", "string")
36
37
- this._url = getURL(network)
+ if (networkOrSubgraphURL.startsWith("http")) {
38
+ this._url = networkOrSubgraphURL
39
+ return
40
+ }
41
+
42
+ this._url = getURL(networkOrSubgraphURL as Network)
43
}
44
45
/**
0 commit comments