@sablier/indexers 3.1.0-beta.1 → 3.1.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -5
- package/dist/cjs/indexers/envio-deployments.js +34 -39
- package/dist/cjs/indexers/envio-deployments.js.map +1 -1
- package/dist/cjs/indexers/envio.js +11 -10
- package/dist/cjs/indexers/envio.js.map +1 -1
- package/dist/cjs/indexers/getters.js +3 -5
- package/dist/cjs/indexers/getters.js.map +1 -1
- package/dist/cjs/indexers/graph.js +15 -13
- package/dist/cjs/indexers/graph.js.map +1 -1
- package/dist/cjs/types.js.map +1 -1
- package/dist/esm/indexers/envio-deployments.js +33 -39
- package/dist/esm/indexers/envio-deployments.js.map +1 -1
- package/dist/esm/indexers/envio.js +12 -11
- package/dist/esm/indexers/envio.js.map +1 -1
- package/dist/esm/indexers/getters.js +3 -5
- package/dist/esm/indexers/getters.js.map +1 -1
- package/dist/esm/indexers/graph.js +14 -13
- package/dist/esm/indexers/graph.js.map +1 -1
- package/dist/esm/types.js.map +1 -1
- package/dist/types/indexers/data.d.ts +2 -2
- package/dist/types/indexers/envio-deployments.d.ts +2 -1
- package/dist/types/indexers/envio-deployments.d.ts.map +1 -1
- package/dist/types/indexers/envio.d.ts +1 -1
- package/dist/types/indexers/envio.d.ts.map +1 -1
- package/dist/types/indexers/getters.d.ts +4 -4
- package/dist/types/indexers/getters.d.ts.map +1 -1
- package/dist/types/indexers/graph.d.ts +9 -1
- package/dist/types/indexers/graph.d.ts.map +1 -1
- package/dist/types/types.d.ts +7 -5
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -17,8 +17,16 @@ There are two indexing providers: [The Graph](https://thegraph.com) and [Envio](
|
|
|
17
17
|
|
|
18
18
|
## Documentation 📚
|
|
19
19
|
|
|
20
|
-
In-depth documentation is available at [docs.sablier.com](https://docs.sablier.com/api/overview).
|
|
21
|
-
|
|
20
|
+
In-depth documentation is available at [docs.sablier.com](https://docs.sablier.com/api/overview).
|
|
21
|
+
|
|
22
|
+
The package now exposes two public indexer keys:
|
|
23
|
+
|
|
24
|
+
- `airdrops` for campaign distribution data
|
|
25
|
+
- `streams` for the merged Flow + Lockup stream surface
|
|
26
|
+
|
|
27
|
+
`analytics` remains a separate target rather than a public indexer key.
|
|
28
|
+
|
|
29
|
+
Protocol-specific docs remain available here:
|
|
22
30
|
|
|
23
31
|
- [Sablier Airdrops](https://docs.sablier.com/api/airdrops/indexers) - Airdrop distribution data
|
|
24
32
|
- [Sablier Flow](https://docs.sablier.com/api/flow/indexers) - Payment streams data
|
|
@@ -26,11 +34,10 @@ indexer for each protocol:
|
|
|
26
34
|
|
|
27
35
|
## Quickstart 🚀
|
|
28
36
|
|
|
29
|
-
Query the Envio GraphQL endpoints directly to access Sablier protocol data:
|
|
37
|
+
Query the public Envio GraphQL endpoints directly to access Sablier protocol data:
|
|
30
38
|
|
|
31
39
|
- **Airdrops**: `https://indexer.hyperindex.xyz/508d217/v1/graphql`
|
|
32
|
-
- **
|
|
33
|
-
- **Lockup**: `https://indexer.hyperindex.xyz/53b7e25/v1/graphql`
|
|
40
|
+
- **Streams**: `https://indexer.hyperindex.xyz/53b7e25/v1/graphql`
|
|
34
41
|
|
|
35
42
|
For detailed documentation, queries, and examples, visit our [API docs](https://docs.sablier.com/api/overview).
|
|
36
43
|
|
|
@@ -1,53 +1,48 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.envioDeployments = void 0;
|
|
4
|
-
|
|
5
|
-
function
|
|
4
|
+
exports.getEnvioDeployment = getEnvioDeployment;
|
|
5
|
+
function getIndexerURL(id) {
|
|
6
6
|
return `https://indexer.hyperindex.xyz/${id}/v1/graphql`;
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
8
|
+
function getConverterURL(id) {
|
|
9
|
+
return `${getIndexerURL(id)}/converter`;
|
|
10
|
+
}
|
|
11
|
+
function createDeployment(args) {
|
|
12
|
+
return {
|
|
13
|
+
createdOn: args.createdOn,
|
|
14
|
+
explorerURL: args.explorerURL,
|
|
15
|
+
indexer: args.indexer,
|
|
16
|
+
get converterURL() {
|
|
17
|
+
return getConverterURL(this.endpoint.id);
|
|
18
18
|
},
|
|
19
|
-
},
|
|
20
|
-
flow: {
|
|
21
|
-
createdOn: 1_731_318_958,
|
|
22
|
-
explorerURL: "https://envio.dev/app/sablier-labs/flow-envio",
|
|
23
|
-
protocol: evm_1.Protocol.Flow,
|
|
24
19
|
endpoint: {
|
|
25
|
-
id:
|
|
20
|
+
id: args.id,
|
|
26
21
|
get url() {
|
|
27
|
-
return
|
|
22
|
+
return getIndexerURL(this.id);
|
|
28
23
|
},
|
|
29
24
|
},
|
|
30
|
-
}
|
|
31
|
-
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
const publicDeployments = {
|
|
28
|
+
airdrops: createDeployment({
|
|
29
|
+
createdOn: 1_712_673_343,
|
|
30
|
+
explorerURL: "https://envio.dev/app/sablier-labs/merkle-envio",
|
|
31
|
+
id: "508d217",
|
|
32
|
+
indexer: "airdrops",
|
|
33
|
+
}),
|
|
34
|
+
streams: createDeployment({
|
|
32
35
|
createdOn: 1_712_673_343,
|
|
33
36
|
explorerURL: "https://envio.dev/app/sablier-labs/lockup-envio",
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
get url() {
|
|
38
|
-
return getURL(this.id);
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
streams: {
|
|
43
|
-
explorerURL: "https://envio.dev/app/sablier-labs/streams-envio",
|
|
44
|
-
protocol: "streams",
|
|
45
|
-
endpoint: {
|
|
46
|
-
id: "e835646",
|
|
47
|
-
get url() {
|
|
48
|
-
return getURL(this.id);
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
},
|
|
37
|
+
id: "d9317de",
|
|
38
|
+
indexer: "streams",
|
|
39
|
+
}),
|
|
52
40
|
};
|
|
41
|
+
exports.envioDeployments = {
|
|
42
|
+
airdrops: publicDeployments.airdrops,
|
|
43
|
+
streams: publicDeployments.streams,
|
|
44
|
+
};
|
|
45
|
+
function getEnvioDeployment(indexer) {
|
|
46
|
+
return exports.envioDeployments[indexer];
|
|
47
|
+
}
|
|
53
48
|
//# sourceMappingURL=envio-deployments.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envio-deployments.js","sourceRoot":"","sources":["../../../src/indexers/envio-deployments.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"envio-deployments.js","sourceRoot":"","sources":["../../../src/indexers/envio-deployments.ts"],"names":[],"mappings":";;;AAsDA,gDAEC;AAtDD,SAAS,aAAa,CAAC,EAAU;IAC/B,OAAO,kCAAkC,EAAE,aAAa,CAAC;AAC3D,CAAC;AAED,SAAS,eAAe,CAAC,EAAU;IACjC,OAAO,GAAG,aAAa,CAAC,EAAE,CAAC,YAAY,CAAC;AAC1C,CAAC;AAED,SAAS,gBAAgB,CAAC,IAKzB;IACC,OAAO;QACL,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,IAAI,YAAY;YACd,OAAO,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QAC3C,CAAC;QACD,QAAQ,EAAE;YACR,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,IAAI,GAAG;gBACL,OAAO,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAChC,CAAC;SACF;KACF,CAAC;AACJ,CAAC;AAED,MAAM,iBAAiB,GAAG;IACxB,QAAQ,EAAE,gBAAgB,CAAC;QACzB,SAAS,EAAE,aAAa;QACxB,WAAW,EAAE,iDAAiD;QAC9D,EAAE,EAAE,SAAS;QACb,OAAO,EAAE,UAAU;KACpB,CAAC;IAGF,OAAO,EAAE,gBAAgB,CAAC;QACxB,SAAS,EAAE,aAAa;QACxB,WAAW,EAAE,iDAAiD;QAC9D,EAAE,EAAE,SAAS;QACb,OAAO,EAAE,SAAS;KACnB,CAAC;CACoE,CAAC;AAE5D,QAAA,gBAAgB,GAAwD;IACnF,QAAQ,EAAE,iBAAiB,CAAC,QAAQ;IACpC,OAAO,EAAE,iBAAiB,CAAC,OAAO;CACnC,CAAC;AAEF,SAAgB,kBAAkB,CAAC,OAA2B;IAC5D,OAAO,wBAAgB,CAAC,OAAO,CAAC,CAAC;AACnC,CAAC","sourcesContent":["import type { Indexer } from \"../types.js\";\n\nfunction getIndexerURL(id: string) {\n return `https://indexer.hyperindex.xyz/${id}/v1/graphql`;\n}\n\nfunction getConverterURL(id: string) {\n return `${getIndexerURL(id)}/converter`;\n}\n\nfunction createDeployment(args: {\n createdOn?: number;\n explorerURL: string;\n id: string;\n indexer: Indexer.IndexerKey;\n}): Indexer.EnvioDeployment {\n return {\n createdOn: args.createdOn,\n explorerURL: args.explorerURL,\n indexer: args.indexer,\n get converterURL() {\n return getConverterURL(this.endpoint.id);\n },\n endpoint: {\n id: args.id,\n get url() {\n return getIndexerURL(this.id);\n },\n },\n };\n}\n\nconst publicDeployments = {\n airdrops: createDeployment({\n createdOn: 1_712_673_343, // April 8, 2024\n explorerURL: \"https://envio.dev/app/sablier-labs/merkle-envio\",\n id: \"508d217\",\n indexer: \"airdrops\",\n }),\n // Streams ships through the legacy \"Lockup\" Envio deployment. We kept it to\n // avoid a full redeployment and to preserve the existing billing plan.\n streams: createDeployment({\n createdOn: 1_712_673_343, // April 8, 2024\n explorerURL: \"https://envio.dev/app/sablier-labs/lockup-envio\",\n id: \"d9317de\",\n indexer: \"streams\",\n }),\n} as const satisfies Record<Indexer.IndexerKey, Indexer.EnvioDeployment>;\n\nexport const envioDeployments: Record<Indexer.IndexerKey, Indexer.EnvioDeployment> = {\n airdrops: publicDeployments.airdrops,\n streams: publicDeployments.streams,\n};\n\nexport function getEnvioDeployment(indexer: Indexer.IndexerKey): Indexer.EnvioDeployment {\n return envioDeployments[indexer];\n}\n"]}
|
|
@@ -36,30 +36,31 @@ const SUPPORTED_CHAINS = [
|
|
|
36
36
|
get(evm_1.chains.baseSepolia.id),
|
|
37
37
|
get(evm_1.chains.sepolia.id),
|
|
38
38
|
];
|
|
39
|
-
function
|
|
39
|
+
function getEnvioDeploymentTarget(indexer) {
|
|
40
|
+
return indexer === "streams" ? evm_1.Protocol.Lockup : indexer;
|
|
41
|
+
}
|
|
42
|
+
function getIndexers(indexer) {
|
|
43
|
+
const deploymentTarget = getEnvioDeploymentTarget(indexer);
|
|
40
44
|
return SUPPORTED_CHAINS.map((chain) => {
|
|
41
|
-
const deployment = envio_deployments_js_1.
|
|
45
|
+
const deployment = (0, envio_deployments_js_1.getEnvioDeployment)(indexer);
|
|
42
46
|
return {
|
|
43
47
|
chainId: chain.id,
|
|
44
48
|
explorerURL: deployment.explorerURL,
|
|
49
|
+
indexer,
|
|
45
50
|
kind: "official",
|
|
46
|
-
name: `sablier-${
|
|
51
|
+
name: `sablier-${deploymentTarget}`,
|
|
52
|
+
testingURL: `https://cloud.hasura.io/public/graphiql?endpoint=${encodeURIComponent(deployment.endpoint.url)}`,
|
|
53
|
+
vendor: enums_js_1.Vendor.Envio,
|
|
47
54
|
endpoint: {
|
|
48
55
|
id: deployment.endpoint.id,
|
|
49
56
|
url: deployment.endpoint.url,
|
|
50
57
|
},
|
|
51
|
-
protocol,
|
|
52
|
-
testingURL: `https://cloud.hasura.io/public/graphiql?endpoint=${encodeURIComponent(deployment.endpoint.url)}`,
|
|
53
|
-
vendor: enums_js_1.Vendor.Envio,
|
|
54
58
|
};
|
|
55
59
|
});
|
|
56
60
|
}
|
|
57
|
-
const STREAMS_CHAIN_IDS = new Set([evm_1.chains.sepolia.id]);
|
|
58
61
|
exports.envio = {
|
|
59
62
|
airdrops: getIndexers(evm_1.Protocol.Airdrops),
|
|
60
|
-
|
|
61
|
-
lockup: getIndexers(evm_1.Protocol.Lockup),
|
|
62
|
-
streams: getIndexers("streams").filter((i) => STREAMS_CHAIN_IDS.has(i.chainId)),
|
|
63
|
+
streams: getIndexers("streams"),
|
|
63
64
|
};
|
|
64
65
|
exports.envioChains = SUPPORTED_CHAINS;
|
|
65
66
|
//# sourceMappingURL=envio.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envio.js","sourceRoot":"","sources":["../../../src/indexers/envio.ts"],"names":[],"mappings":";;;AAKA,qCAA+C;AAC/C,0CAAqC;AAErC,
|
|
1
|
+
{"version":3,"file":"envio.js","sourceRoot":"","sources":["../../../src/indexers/envio.ts"],"names":[],"mappings":";;;AAKA,qCAA+C;AAC/C,0CAAqC;AAErC,iEAA4D;AAoB5D,SAAS,GAAG,CAAC,EAAU,EAAE,MAAyB;IAChD,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;AACxB,CAAC;AAED,MAAM,gBAAgB,GAAG;IAIvB,GAAG,CAAC,YAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;IACvB,GAAG,CAAC,YAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;IACvB,GAAG,CAAC,YAAM,CAAC,SAAS,CAAC,EAAE,CAAC;IACxB,GAAG,CAAC,YAAM,CAAC,IAAI,CAAC,EAAE,CAAC;IACnB,GAAG,CAAC,YAAM,CAAC,KAAK,CAAC,EAAE,CAAC;IACpB,GAAG,CAAC,YAAM,CAAC,SAAS,CAAC,EAAE,CAAC;IACxB,GAAG,CAAC,YAAM,CAAC,GAAG,CAAC,EAAE,CAAC;IAClB,GAAG,CAAC,YAAM,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC;IAC9C,GAAG,CAAC,YAAM,CAAC,MAAM,CAAC,E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gB,GAAG,wBAAwB,CAAC,OAAO,CAAC,CAAC;IAC3D,OAAO,gBAAgB,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QACpC,MAAM,UAAU,GAAG,IAAA,yCAAkB,EAAC,OAAO,CAAC,CAAC;QAC/C,OAAO;YACL,OAAO,EAAE,KAAK,CAAC,EAAE;YACjB,WAAW,EAAE,UAAU,CAAC,WAAW;YACnC,OAAO;YACP,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,WAAW,gBAAgB,EAAE;YACnC,UAAU,EAAE,oDAAoD,kBAAkB,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YAC7G,MAAM,EAAE,iBAAM,CAAC,KAAK;YACpB,QAAQ,EAAE;gBACR,EAAE,EAAE,UAAU,CAAC,QAAQ,CAAC,EAAE;gBAC1B,GAAG,EAAE,UAAU,CAAC,QAAQ,CAAC,GAAG;aAC7B;SACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAEY,QAAA,KAAK,GAA0C;IAC1D,QAAQ,EAAE,WAAW,CAAC,cAAQ,CAAC,QAAQ,CAAC;IACxC,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC;CACvB,CAAC;AAEE,QAAA,WAAW,GAAG,gBAAgB,CAAC","sourcesContent":["/**\n * @file Use this file to define new indexers for Envio.\n *\n * @see https://docs.envio.dev/docs/HyperSync/hypersync-supported-networks\n */\nimport { chains, Protocol } from \"sablier/evm\";\nimport { Vendor } from \"../enums.js\";\nimport type { Indexer } from \"../types.js\";\nimport { getEnvioDeployment } from \"./envio-deployments.js\";\n\ntype EnvioChainConfig = {\n /**\n * @see https://github.com/sablier-labs/indexers/discussions/147\n * @see https://github.com/enviodev/hyperindex/issues/599\n */\n hypersync?: string;\n /**\n * Chains indexed only through RPC. No HyperSync support.\n * @see https://docs.envio.dev/docs/HyperIndex/rpc-sync\n */\n rpcOnly?: boolean;\n};\n\ntype EnvioChain = {\n config?: EnvioChainConfig;\n id: number;\n};\n\nfunction get(id: number, config?: EnvioChainConfig): EnvioChain {\n return { config, id };\n}\n\nconst SUPPORTED_CHAINS = [\n /* -------------------------------------------------------------------------- */\n /* MAINNETS */\n /* -------------------------------------------------------------------------- */\n get(chains.abstract.id),\n get(chains.arbitrum.id),\n get(chains.avalanche.id),\n get(chains.base.id),\n get(chains.blast.id),\n get(chains.berachain.id),\n get(chains.bsc.id),\n get(chains.chiliz.id, { hypersync: \"chiliz\" }),\n get(chains.gnosis.id),\n get(chains.hyperevm.id),\n get(chains.linea.id),\n get(chains.mainnet.id),\n get(chains.mode.id),\n get(chains.monad.id),\n get(chains.morph.id),\n get(chains.optimism.id),\n get(chains.polygon.id),\n get(chains.sonic.id),\n get(chains.scroll.id),\n get(chains.sei.id, { hypersync: \"sei\" }),\n get(chains.sophon.id),\n get(chains.superseed.id),\n get(chains.unichain.id),\n get(chains.xdc.id),\n get(chains.zksync.id),\n /* -------------------------------------------------------------------------- */\n /* TESTNETS */\n /* -------------------------------------------------------------------------- */\n get(chains.baseSepolia.id),\n get(chains.sepolia.id),\n] as const;\n\nfunction getEnvioDeploymentTarget(indexer: Indexer.IndexerKey): Indexer.Protocol {\n return indexer === \"streams\" ? Protocol.Lockup : indexer;\n}\n\nfunction getIndexers(indexer: Indexer.IndexerKey): Indexer[] {\n const deploymentTarget = getEnvioDeploymentTarget(indexer);\n return SUPPORTED_CHAINS.map((chain) => {\n const deployment = getEnvioDeployment(indexer);\n return {\n chainId: chain.id,\n explorerURL: deployment.explorerURL,\n indexer,\n kind: \"official\",\n name: `sablier-${deploymentTarget}`,\n testingURL: `https://cloud.hasura.io/public/graphiql?endpoint=${encodeURIComponent(deployment.endpoint.url)}`,\n vendor: Vendor.Envio,\n endpoint: {\n id: deployment.endpoint.id,\n url: deployment.endpoint.url,\n },\n };\n });\n}\n\nexport const envio: Record<Indexer.IndexerKey, Indexer[]> = {\n airdrops: getIndexers(Protocol.Airdrops),\n streams: getIndexers(\"streams\"),\n} as const;\n\nexport const envioChains = SUPPORTED_CHAINS;\n"]}
|
|
@@ -5,11 +5,9 @@ exports.getIndexerGraph = getIndexerGraph;
|
|
|
5
5
|
exports.getIndexerEnvio = getIndexerEnvio;
|
|
6
6
|
const data_js_1 = require("./data.js");
|
|
7
7
|
function getIndexer(opts) {
|
|
8
|
-
const { chainId,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
return data_js_1.indexers.graph[protocol].find((c) => c.chainId === chainId);
|
|
8
|
+
const { chainId, indexer, vendor } = opts;
|
|
9
|
+
const registry = vendor === "envio" ? data_js_1.indexers.envio[indexer] : data_js_1.indexers.graph[indexer];
|
|
10
|
+
return registry?.find((c) => c.chainId === chainId);
|
|
13
11
|
}
|
|
14
12
|
function getIndexerGraph(opts) {
|
|
15
13
|
return getIndexer({ ...opts, vendor: "graph" });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getters.js","sourceRoot":"","sources":["../../../src/indexers/getters.ts"],"names":[],"mappings":";;AAeA,
|
|
1
|
+
{"version":3,"file":"getters.js","sourceRoot":"","sources":["../../../src/indexers/getters.ts"],"names":[],"mappings":";;AAeA,gCAIC;AAWD,0CAEC;AAYD,0CAEC;AA7CD,uCAAqC;AAcrC,SAAgB,UAAU,CAAC,IAAgD;IACzE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAC1C,MAAM,QAAQ,GAAG,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,kBAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,kBAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACxF,OAAO,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,CAAC;AACtD,CAAC;AAWD,SAAgB,eAAe,CAAC,IAAqC;IACnE,OAAO,UAAU,CAAC,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;AAClD,CAAC;AAYD,SAAgB,eAAe,CAAC,IAAqC;IACnE,OAAO,UAAU,CAAC,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;AAClD,CAAC","sourcesContent":["import type { Indexer } from \"../types.js\";\nimport { indexers } from \"./data.js\";\n\ntype I = Indexer;\ntype K = Indexer.IndexerKey;\ntype V = Indexer.Vendor;\n\n/**\n * Retrieves an indexer configuration by chain ID, indexer, and vendor.\n *\n * @param opts.chainId - The chain ID to look up\n * @param opts.indexer - The indexer key (airdrops or streams)\n * @param opts.vendor - The indexing vendor (envio or graph)\n * @returns The indexer configuration, or `undefined` if not found\n */\nexport function getIndexer(opts: { chainId: number; indexer: K; vendor: V }): I | undefined {\n const { chainId, indexer, vendor } = opts;\n const registry = vendor === \"envio\" ? indexers.envio[indexer] : indexers.graph[indexer];\n return registry?.find((c) => c.chainId === chainId);\n}\n/**\n * Retrieves a Graph indexer for the specified chain and indexer.\n *\n * Each Graph subgraph is deployed independently per chain, so each has a unique\n * endpoint URL specific to that chain.\n *\n * @param opts.chainId - The chain ID to look up\n * @param opts.indexer - The indexer key (airdrops or streams)\n * @returns The Graph indexer configuration, or `undefined` if not found\n */\nexport function getIndexerGraph(opts: { chainId: number; indexer: K }): I | undefined {\n return getIndexer({ ...opts, vendor: \"graph\" });\n}\n/**\n * Retrieves an Envio indexer for the specified chain and indexer.\n *\n * Returns the same endpoint URL for any chain on which Envio is supported, since the\n * deployments are multi-chain with a single shared endpoint per indexer.\n * Returns `undefined` for chains where Envio is unsupported.\n *\n * @param opts.chainId - The chain ID to look up\n * @param opts.indexer - The indexer key (airdrops or streams)\n * @returns The Envio indexer configuration, or `undefined` if the chain is unsupported\n */\nexport function getIndexerEnvio(opts: { chainId: number; indexer: K }): I | undefined {\n return getIndexer({ ...opts, vendor: \"envio\" });\n}\n"]}
|
|
@@ -4,6 +4,7 @@ exports.graphChains = exports.graph = void 0;
|
|
|
4
4
|
exports.getGraphChainSlug = getGraphChainSlug;
|
|
5
5
|
exports.getSablierChainSlug = getSablierChainSlug;
|
|
6
6
|
exports.getSubgraphYamlChainSlug = getSubgraphYamlChainSlug;
|
|
7
|
+
exports.getProtocolGraphIndexer = getProtocolGraphIndexer;
|
|
7
8
|
const sablier_1 = require("sablier");
|
|
8
9
|
const evm_1 = require("sablier/evm");
|
|
9
10
|
const constants_js_1 = require("../constants.js");
|
|
@@ -44,13 +45,13 @@ function resolveCustom(protocol, chainId, templateURL) {
|
|
|
44
45
|
return {
|
|
45
46
|
chainId,
|
|
46
47
|
explorerURL: `${endpointUrl}/graphql`,
|
|
48
|
+
indexer: protocol,
|
|
47
49
|
kind: "custom",
|
|
48
50
|
name: subgraphName,
|
|
51
|
+
vendor: enums_js_1.Vendor.Graph,
|
|
49
52
|
endpoint: {
|
|
50
53
|
url: endpointUrl,
|
|
51
54
|
},
|
|
52
|
-
protocol,
|
|
53
|
-
vendor: enums_js_1.Vendor.Graph,
|
|
54
55
|
};
|
|
55
56
|
}
|
|
56
57
|
function resolveOfficial(protocol, chainId, subgraphId) {
|
|
@@ -58,15 +59,15 @@ function resolveOfficial(protocol, chainId, subgraphId) {
|
|
|
58
59
|
return {
|
|
59
60
|
chainId,
|
|
60
61
|
explorerURL: `https://thegraph.com/explorer/subgraphs/${subgraphId}`,
|
|
62
|
+
indexer: protocol,
|
|
61
63
|
kind: "official",
|
|
62
64
|
name: subgraphName,
|
|
65
|
+
testingURL: `https://api.studio.thegraph.com/query/${constants_js_1.SUBGRAPH_STUDIO_USER_ID}/${subgraphName}/version/latest`,
|
|
66
|
+
vendor: enums_js_1.Vendor.Graph,
|
|
63
67
|
endpoint: {
|
|
64
68
|
id: subgraphId,
|
|
65
69
|
url: `https://gateway.thegraph.com/api/subgraphs/id/${subgraphId}`,
|
|
66
70
|
},
|
|
67
|
-
protocol,
|
|
68
|
-
testingURL: `https://api.studio.thegraph.com/query/${constants_js_1.SUBGRAPH_STUDIO_USER_ID}/${subgraphName}/version/latest`,
|
|
69
|
-
vendor: enums_js_1.Vendor.Graph,
|
|
70
71
|
};
|
|
71
72
|
}
|
|
72
73
|
function custom(chainId, baseURL) {
|
|
@@ -189,14 +190,15 @@ function toSortedArray(indexerMaps, protocol) {
|
|
|
189
190
|
return chainNameA.localeCompare(chainNameB);
|
|
190
191
|
});
|
|
191
192
|
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
193
|
+
function toPublicIndexers(indexers, indexer) {
|
|
194
|
+
return indexers.map((entry) => ({ ...entry, indexer }));
|
|
195
|
+
}
|
|
196
|
+
function getProtocolGraphIndexer(opts) {
|
|
197
|
+
return toSortedArray(ALL, opts.protocol).find((indexer) => indexer.chainId === opts.chainId);
|
|
198
|
+
}
|
|
195
199
|
exports.graph = {
|
|
196
|
-
airdrops: toSortedArray(ALL, evm_1.Protocol.Airdrops),
|
|
197
|
-
|
|
198
|
-
lockup: toSortedArray(ALL, evm_1.Protocol.Lockup),
|
|
199
|
-
streams: STREAMS,
|
|
200
|
+
airdrops: toPublicIndexers(toSortedArray(ALL, evm_1.Protocol.Airdrops), evm_1.Protocol.Airdrops),
|
|
201
|
+
streams: toPublicIndexers(toSortedArray(ALL, evm_1.Protocol.Lockup), "streams"),
|
|
200
202
|
};
|
|
201
|
-
exports.graphChains = exports.graph.
|
|
203
|
+
exports.graphChains = exports.graph.streams.map((c) => c.chainId);
|
|
202
204
|
//# sourceMappingURL=graph.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph.js","sourceRoot":"","sources":["../../../src/indexers/graph.ts"],"names":[],"mappings":";;;AAiDA,8CAEC;AAED,kDAEC;AAED,4DAEC;AAvDD,qCAAkC;AAClC,qCAA+C;AAC/C,kDAA0D;AAC1D,0CAAqC;AAarC,MAAM,0BAA0B,GAAkC;IAChE,CAAC,YAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,cAAc;IACpC,C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AAa,CAAC,UAAU,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;AACP,CAAC;AAGD,MAAM,OAAO,GAAc;IACzB,eAAe,CAAC,SAAS,EAAE,YAAM,CAAC,OAAO,CAAC,EAAE,EAAE,6CAA6C,CAAC;CAC7F,CAAC;AAEW,QAAA,KAAK,GAA4C;IAC5D,QAAQ,EAAE,aAAa,CAAC,GAAG,EAAE,cAAQ,CAAC,QAAQ,CAAC;IAC/C,IAAI,EAAE,aAAa,CAAC,GAAG,EAAE,cAAQ,CAAC,IAAI,CAAC;IACvC,MAAM,EAAE,aAAa,CAAC,GAAG,EAAE,cAAQ,CAAC,MAAM,CAAC;IAC3C,OAAO,EAAE,OAAO;CACjB,CAAC;AAGW,QAAA,WAAW,GAAG,aAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC","sourcesContent":["/**\n * @file Use this file to define new indexers for The Graph.\n *\n */\nimport { sablier } from \"sablier\";\nimport { chains, Protocol } from \"sablier/evm\";\nimport { SUBGRAPH_STUDIO_USER_ID } from \"../constants.js\";\nimport { Vendor } from \"../enums.js\";\nimport type { Indexer } from \"../types.js\";\n\n/* -------------------------------------------------------------------------- */\n/* CONSTANTS */\n/* -------------------------------------------------------------------------- */\n\n/**\n * Custom chain slugs used by The Graph.\n *\n * ⚠️ NOTE: not all chain names used by The Graph are the same as the chain's slug defined in the Sablier SDK.\n * @see https://thegraph.com/docs/en/supported-networks\n */\nconst CHAIN_SLUG_GRAPH_OVERRIDES: { [chainId: number]: string } = {\n [chains.arbitrum.id]: \"arbitrum-one\",\n [chains.denergy.id]: \"denergychain\",\n [chains.polygon.id]: \"matic\",\n [chains.zksync.id]: \"zksync-era\",\n};\n\n/**\n * Custom chain slugs used by Sablier subgraphs.\n */\nconst CHAIN_SLUG_SABLIER_OVERRIDES: { [chainId: number]: string } = {\n [chains.denergy.id]: \"denergychain\",\n [chains.mainnet.id]: \"ethereum\",\n};\n\n/**\n * Some chains have made the really bad design choice of using custom network identifiers\n * in their subgraph.yaml files.\n */\nconst CHAIN_SLUG_SUBGRAPH_YAML: { [chainId: number]: string } = {\n [chains.lightlink.id]: \"mainnet\",\n};\n\nconst NAME_TEMPLATING_VAR = \"{SUBGRAPH_NAME}\";\n\n/* -------------------------------------------------------------------------- */\n/* HELPERS */\n/* -------------------------------------------------------------------------- */\n\nexport function getGraphChainSlug(chainId: number): string {\n return CHAIN_SLUG_GRAPH_OVERRIDES[chainId] ?? sablier.chains.getOrThrow(chainId).slug;\n}\n\nexport function getSablierChainSlug(chainId: number): string {\n return CHAIN_SLUG_SABLIER_OVERRIDES[chainId] ?? sablier.chains.getOrThrow(chainId).slug;\n}\n\nexport function getSubgraphYamlChainSlug(chainId: number): string {\n return CHAIN_SLUG_SUBGRAPH_YAML[chainId] ?? getGraphChainSlug(chainId);\n}\n\nfunction getSubgraphName(chainId: number, protocol: Indexer.DataProtocol): string {\n const graphChainName = getSablierChainSlug(chainId);\n return `sablier-${protocol}-${graphChainName}`;\n}\n\n/**\n * Sort indexers alphabetically by chain name.\n */\nfunction resolveCustom(\n protocol: Indexer.DataProtocol,\n chainId: number,\n templateURL: string\n): Indexer {\n if (!templateURL.includes(NAME_TEMPLATING_VAR)) {\n throw new Error(\n `Template URL for custom Graph indexer does not include ${NAME_TEMPLATING_VAR}`\n );\n }\n const subgraphName = getSubgraphName(chainId, protocol);\n\n const endpointUrl = templateURL.replace(NAME_TEMPLATING_VAR, subgraphName);\n return {\n chainId,\n explorerURL: `${endpointUrl}/graphql`,\n kind: \"custom\",\n name: subgraphName,\n endpoint: {\n url: endpointUrl,\n },\n protocol,\n vendor: Vendor.Graph,\n };\n}\n\nfunction resolveOfficial(\n protocol: Indexer.DataProtocol,\n chainId: number,\n subgraphId: string\n): Indexer {\n const subgraphName = getSubgraphName(chainId, protocol);\n return {\n chainId,\n explorerURL: `https://thegraph.com/explorer/subgraphs/${subgraphId}`,\n kind: \"official\",\n name: subgraphName,\n endpoint: {\n id: subgraphId,\n url: `https://gateway.thegraph.com/api/subgraphs/id/${subgraphId}`,\n },\n protocol,\n testingURL: `https://api.studio.thegraph.com/query/${SUBGRAPH_STUDIO_USER_ID}/${subgraphName}/version/latest`,\n vendor: Vendor.Graph,\n };\n}\n\n/* -------------------------------------------------------------------------- */\n/* DEFINITIONS */\n/* -------------------------------------------------------------------------- */\n\ntype SubgraphId = string;\ntype LegacyProtocol = Indexer.Protocol;\ntype SubgraphIdMap = Record<LegacyProtocol, SubgraphId>;\ntype IndexerGraphMap = Record<LegacyProtocol, Indexer>;\n\nfunction custom(chainId: number, baseURL: string): IndexerGraphMap {\n return {\n airdrops: resolveCustom(Protocol.Airdrops, chainId, baseURL),\n flow: resolveCustom(Protocol.Flow, chainId, baseURL),\n lockup: resolveCustom(Protocol.Lockup, chainId, baseURL),\n };\n}\n\nfunction official(chainId: number, idMap: SubgraphIdMap): IndexerGraphMap {\n return {\n airdrops: resolveOfficial(Protocol.Airdrops, chainId, idMap.airdrops),\n flow: resolveOfficial(Protocol.Flow, chainId, idMap.flow),\n lockup: resolveOfficial(Protocol.Lockup, chainId, idMap.lockup),\n };\n}\n\nconst CUSTOMS: IndexerGraphMap[] = [\n custom(\n chains.lightlink.id,\n \"https://graph.phoenix.lightlink.io/query/subgraphs/name/lightlink/{SUBGRAPH_NAME}\"\n ),\n custom(\n chains.denergy.id,\n \"https://thegraph.denergychain.com/subgraphs/name/denergychain/{SUBGRAPH_NAME}\"\n ),\n];\n\nconst OFFICIALS: IndexerGraphMap[] = [\n /* -------------------------------------------------------------------------- */\n /* MAINNETS */\n /* -------------------------------------------------------------------------- */\n official(chains.mainnet.id, {\n airdrops: \"DFD73EcSue44R7mpHvXeyvcgaT8tR1iKakZFjBsiFpjs\",\n flow: \"ECxBJhKceBGaVvK6vqmK3VQAncKwPeAQutEb8TeiUiod\",\n lockup: \"AvDAMYYHGaEwn9F9585uqq6MM5CfvRtYcb7KjK7LKPCt\",\n }),\n official(chains.abstract.id, {\n airdrops: \"DRrf6mYEhRt9QieKvTjDHnSWcBm3GW96hpedMKVxLABx\",\n flow: \"Gq3e1gihMoSynURwGXQnPoKGVZzdsyomdrMH934vQHuG\",\n lockup: \"2QjTdDFY233faXksUruMERMiDoQDdtGG5hBLC27aT1Pw\",\n }),\n official(chains.arbitrum.id, {\n airdrops: \"HkHDg6NVVVeobhpcU4pTPMktyC25zd6xAQBGpYrWDgRr\",\n flow: \"C3kBBUVtW2rxqGpAgSgEuSaT49izkH6Q8UibRt7XFTyW\",\n lockup: \"yvDXXHSyv6rGPSzfpbBcbQmMFrECac3Q2zADkYsMxam\",\n }),\n official(chains.avalanche.id, {\n airdrops: \"CpbN5Ps25UzqfdoqYdrjoSK4Him6nwDvdLK6a2sGS1PA\",\n flow: \"6PAizjTALVqLLB7Ycq6XnpTeck8Z8QUpDFnVznMnisUh\",\n lockup: \"FTDmonvFEm1VGkzECcnDY2CPHcW5dSmHRurSjEEfTkCX\",\n }),\n official(chains.base.id, {\n airdrops: \"4SxPXkQNifgBYqje2C4yP5gz69erZwtD7GuLWgXHSLGe\",\n flow: \"4XSxXh8ZgkzaA35nrbQG9Ry3FYz3ZFD8QBdWwVg5pF9W\",\n lockup: \"778GfecD9tsyB4xNnz4wfuAyfHU6rqGr79VCPZKu3t2F\",\n }),\n official(chains.berachain.id, {\n airdrops: \"CnYsdmzuY3Mebwywvqv1WrXw9UZuPMTrxoGgR2UdThJE\",\n flow: \"J87eaBLfTe7kKWgUGqe5TxntNCzA4pyWmqJowMddehuh\",\n lockup: \"C2r13APcUemQtVdPFm7p7T3aJkU2rH2EvdZzrQ53zi14\",\n }),\n official(chains.bsc.id, {\n airdrops: \"FXQT42kQPvpMJgsF5Bs6CqpxVvPP1LBqEhWThCCLMeGL\",\n flow: \"2vU8KF4yWh3vvFjtg7MrRXMnYF3hPX2T3cvVBdaiXhNb\",\n lockup: \"A8Vc9hi7j45u7P8Uw5dg4uqYJgPo4x1rB4oZtTVaiccK\",\n }),\n official(chains.chiliz.id, {\n airdrops: \"6LK1aqrhzZCp6c88MEBDAR1VDLpZQiXpBKkceJ5Lu4LU\",\n flow: \"7QX7tJsANNFpxFLLjqzmXRzfY1wPGp3Lty5xGbhgADa6\",\n lockup: \"4KsXUFvsKFHH7Q8k3BPgEv2NhCJJGwG78gCPAUpncYb\",\n }),\n official(chains.gnosis.id, {\n airdrops: \"kQEY5PYbjx4SMKyMUwqJHRLDzKH1aUqGsf1cnibU7Kn\",\n flow: \"4KiJ53cTNKdFWPBPmDNQ55tYj8hn1WQg8R4UcTY2STLL\",\n lockup: \"DtKniy1RvB19q1r2g1WLN4reMNKDacEnuAjh284rW2iK\",\n }),\n official(chains.linea.id, {\n airdrops: \"6koYFSd8FQizdQWLTdRpL1yTmAbpMgN1vZN5W6ajZiTN\",\n flow: \"DV9XgcCCPKzUn6pgetg4yPetpW2fNoRKBUQC43aNeLG6\",\n lockup: \"GvpecytqVzLzuwuQB3enozXoaZRFoVx8Kr7qrfMiE9bs\",\n }),\n official(chains.optimism.id, {\n airdrops: \"CHJtCNDzPqngpa1YJoaVrjuufZL6k6VkEkG9ZFUMQzF7\",\n flow: \"AygPgsehNGSB4K7DYYtvBPhTpEiU4dCu3nt95bh9FhRf\",\n lockup: \"NZHzd2JNFKhHP5EWUiDxa5TaxGCFbSD4g6YnYr8JGi6\",\n }),\n official(chains.polygon.id, {\n airdrops: \"FRbBKiDyM5YpFAqHLXRfQWwQdMGzFL82hqoPXPpXzAHE\",\n flow: \"ykp38sLarwz3cpmjSSPqo7UuTjYtkZ1KiL4PM2qwmT8\",\n lockup: \"8fgeQMEQ8sskVeWE5nvtsVL2VpezDrAkx2d1VeiHiheu\",\n }),\n official(chains.scroll.id, {\n airdrops: \"Ev4xS8VxuoUcpgqz5A2BkTgQxQeskm4Fg41XzVJ2DX9\",\n flow: \"HFpTrPzJyrHKWZ9ebb4VFRQSxRwpepyfz5wd138daFkF\",\n lockup: \"GycpYx8c9eRqxvEAfqnpNd1ZfXeuLzjRhnG7vvYaqEE1\",\n }),\n official(chains.sonic.id, {\n airdrops: \"5g8orwpm5Rf83G8eqDzDjodt3sG2D64cbiLC98Utmv4Q\",\n flow: \"HkQKZKuM6dZ7Vc4FGC1gZTVVTniYJWRhTRmDDMNzN8zk\",\n lockup: \"GnaSPX9XLkPn219CqbGFU1NgveuQk2Hh3c8WxjtesaEh\",\n }),\n official(chains.unichain.id, {\n airdrops: \"4rQMJ85hKNhcaDyirGipGvcqS4auGU3QCFRBnpiexyNy\",\n flow: \"Cb5uDYfy4ukN9fjhQ3PQZgDzyo6G66ztn1e847rS7Xa8\",\n lockup: \"3MUG4H3gZcp9fpGLiJMTMeUFcQQ6QdT317P4wYKyns9M\",\n }),\n official(chains.zksync.id, {\n airdrops: \"64iDUwNVWKukw67nqTXif5taEfLug4Qf1c2suAv5hrqN\",\n flow: \"9DRgWhDAMovpkej3eT8izum6jxEKHE62ciArffsTAScx\",\n lockup: \"7SuEYGYwZ835LjVGB85ZE8z5zmqdKgmRh8kAEeJefWQN\",\n }),\n /* -------------------------------------------------------------------------- */\n /* TESTNETS */\n /* -------------------------------------------------------------------------- */\n official(chains.baseSepolia.id, {\n airdrops: \"4R2hm27YJ7CVEJ97BbBJz2r4KTKYc8sTqqzrD8UzEfJt\",\n flow: \"AsnKT1waQMvuQxZAqfFuYwtRtAfN8uekDu75jPttfyLh\",\n lockup: \"DdiYENuyh5ztSybRJnBnCZuUgESkFasjGFHZUbURpKHz\",\n }),\n official(chains.sepolia.id, {\n airdrops: \"8PLGDyXEsPgRTAnozL7MAjmTUFY4TBzs8i4F9Pq3wwSh\",\n flow: \"EU9AWmJjrjMRkjxcdHfuWPZvPTNAL3hiXfNGN5MwUpvm\",\n lockup: \"5yDtFSxyRuqyjvGJyyuQhMEW3Uah7Ddy2KFSKVhy9VMa\",\n }),\n];\n\nconst ALL: IndexerGraphMap[] = [...CUSTOMS, ...OFFICIALS];\n\nfunction toSortedArray(indexerMaps: IndexerGraphMap[], protocol: LegacyProtocol): Indexer[] {\n return indexerMaps\n .map((indexerMap) => indexerMap[protocol])\n .sort((a, b) => {\n const chainNameA = sablier.chains.getOrThrow(a.chainId).name;\n const chainNameB = sablier.chains.getOrThrow(b.chainId).name;\n return chainNameA.localeCompare(chainNameB);\n });\n}\n\n/** Beta: streams subgraph deployed only on Sepolia. */\nconst STREAMS: Indexer[] = [\n resolveOfficial(\"streams\", chains.sepolia.id, \"gXjQjEXaeBpBsMLbVo9govzQMyBLUtJHciKbJdxQCjV\"),\n];\n\nexport const graph: Record<Indexer.DataProtocol, Indexer[]> = {\n airdrops: toSortedArray(ALL, Protocol.Airdrops),\n flow: toSortedArray(ALL, Protocol.Flow),\n lockup: toSortedArray(ALL, Protocol.Lockup),\n streams: STREAMS,\n};\n\n// It doesn't matter what protocol we are using since each chain supports all protocols.\nexport const graphChains = graph.lockup.map((c) => c.chainId);\n"]}
|
|
1
|
+
{"version":3,"file":"graph.js","sourceRoot":"","sources":["../../../src/indexers/graph.ts"],"names":[],"mappings":";;;AAiDA,8CAEC;AAED,kDAEC;AAED,4DAEC;AAyND,0DAKC;AArRD,qCAAkC;AAClC,qCAA+C;AAC/C,kDAA0D;AAC1D,0CAAqC;AAarC,MAAM,0BAA0B,GAAkC;IAChE,CAAC,YAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,cAAc;IACpC,CAAC,YAAM,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,cAAc;IACnC,CAAC,YAAM,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,OAAO;IAC5B,CAAC,YAAM,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,YAAY;CACjC,CAAC;AAKF,MAAM,4BAA4B,GAAkC;IAClE,CAAC,YAAM,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,cAAc;IACnC,CAAC,YAAM,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,UAAU;CAChC,CAAC;AAMF,MAAM,wBAAwB,GAAk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C,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,KAAK,IAAI,CAAC,OAAO,CAAC,CAAC;AAC/F,CAAC;AAEY,QAAA,KAAK,GAA0C;IAC1D,QAAQ,EAAE,gBAAgB,CAAC,aAAa,CAAC,GAAG,EAAE,cAAQ,CAAC,QAAQ,CAAC,EAAE,cAAQ,CAAC,QAAQ,CAAC;IACpF,OAAO,EAAE,gBAAgB,CAAC,aAAa,CAAC,GAAG,EAAE,cAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC;CAC1E,CAAC;AAGW,QAAA,WAAW,GAAG,aAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC","sourcesContent":["/**\n * @file Use this file to define new indexers for The Graph.\n *\n */\nimport { sablier } from \"sablier\";\nimport { chains, Protocol } from \"sablier/evm\";\nimport { SUBGRAPH_STUDIO_USER_ID } from \"../constants.js\";\nimport { Vendor } from \"../enums.js\";\nimport type { Indexer } from \"../types.js\";\n\n/* -------------------------------------------------------------------------- */\n/* CONSTANTS */\n/* -------------------------------------------------------------------------- */\n\n/**\n * Custom chain slugs used by The Graph.\n *\n * ⚠️ NOTE: not all chain names used by The Graph are the same as the chain's slug defined in the Sablier SDK.\n * @see https://thegraph.com/docs/en/supported-networks\n */\nconst CHAIN_SLUG_GRAPH_OVERRIDES: { [chainId: number]: string } = {\n [chains.arbitrum.id]: \"arbitrum-one\",\n [chains.denergy.id]: \"denergychain\",\n [chains.polygon.id]: \"matic\",\n [chains.zksync.id]: \"zksync-era\",\n};\n\n/**\n * Custom chain slugs used by Sablier subgraphs.\n */\nconst CHAIN_SLUG_SABLIER_OVERRIDES: { [chainId: number]: string } = {\n [chains.denergy.id]: \"denergychain\",\n [chains.mainnet.id]: \"ethereum\",\n};\n\n/**\n * Some chains have made the really bad design choice of using custom network identifiers\n * in their subgraph.yaml files.\n */\nconst CHAIN_SLUG_SUBGRAPH_YAML: { [chainId: number]: string } = {\n [chains.lightlink.id]: \"mainnet\",\n};\n\nconst NAME_TEMPLATING_VAR = \"{SUBGRAPH_NAME}\";\n\n/* -------------------------------------------------------------------------- */\n/* HELPERS */\n/* -------------------------------------------------------------------------- */\n\nexport function getGraphChainSlug(chainId: number): string {\n return CHAIN_SLUG_GRAPH_OVERRIDES[chainId] ?? sablier.chains.getOrThrow(chainId).slug;\n}\n\nexport function getSablierChainSlug(chainId: number): string {\n return CHAIN_SLUG_SABLIER_OVERRIDES[chainId] ?? sablier.chains.getOrThrow(chainId).slug;\n}\n\nexport function getSubgraphYamlChainSlug(chainId: number): string {\n return CHAIN_SLUG_SUBGRAPH_YAML[chainId] ?? getGraphChainSlug(chainId);\n}\n\ntype ProtocolGraphIndexer = Omit<Indexer, \"indexer\"> & {\n indexer: Indexer.Protocol;\n};\n\nfunction getSubgraphName(chainId: number, protocol: Indexer.Protocol): string {\n const graphChainName = getSablierChainSlug(chainId);\n return `sablier-${protocol}-${graphChainName}`;\n}\n\n/**\n * Sort indexers alphabetically by chain name.\n */\nfunction resolveCustom(\n protocol: Indexer.Protocol,\n chainId: number,\n templateURL: string\n): ProtocolGraphIndexer {\n if (!templateURL.includes(NAME_TEMPLATING_VAR)) {\n throw new Error(\n `Template URL for custom Graph indexer does not include ${NAME_TEMPLATING_VAR}`\n );\n }\n const subgraphName = getSubgraphName(chainId, protocol);\n\n const endpointUrl = templateURL.replace(NAME_TEMPLATING_VAR, subgraphName);\n return {\n chainId,\n explorerURL: `${endpointUrl}/graphql`,\n indexer: protocol,\n kind: \"custom\",\n name: subgraphName,\n vendor: Vendor.Graph,\n endpoint: {\n url: endpointUrl,\n },\n };\n}\n\nfunction resolveOfficial(\n protocol: Indexer.Protocol,\n chainId: number,\n subgraphId: string\n): ProtocolGraphIndexer {\n const subgraphName = getSubgraphName(chainId, protocol);\n return {\n chainId,\n explorerURL: `https://thegraph.com/explorer/subgraphs/${subgraphId}`,\n indexer: protocol,\n kind: \"official\",\n name: subgraphName,\n testingURL: `https://api.studio.thegraph.com/query/${SUBGRAPH_STUDIO_USER_ID}/${subgraphName}/version/latest`,\n vendor: Vendor.Graph,\n endpoint: {\n id: subgraphId,\n url: `https://gateway.thegraph.com/api/subgraphs/id/${subgraphId}`,\n },\n };\n}\n\n/* -------------------------------------------------------------------------- */\n/* DEFINITIONS */\n/* -------------------------------------------------------------------------- */\n\ntype SubgraphId = string;\ntype SubgraphIdMap = Record<Indexer.Protocol, SubgraphId>;\ntype ProtocolIndexerGraphMap = Record<Indexer.Protocol, ProtocolGraphIndexer>;\n\nfunction custom(chainId: number, baseURL: string): ProtocolIndexerGraphMap {\n return {\n airdrops: resolveCustom(Protocol.Airdrops, chainId, baseURL),\n flow: resolveCustom(Protocol.Flow, chainId, baseURL),\n lockup: resolveCustom(Protocol.Lockup, chainId, baseURL),\n };\n}\n\nfunction official(chainId: number, idMap: SubgraphIdMap): ProtocolIndexerGraphMap {\n return {\n airdrops: resolveOfficial(Protocol.Airdrops, chainId, idMap.airdrops),\n flow: resolveOfficial(Protocol.Flow, chainId, idMap.flow),\n lockup: resolveOfficial(Protocol.Lockup, chainId, idMap.lockup),\n };\n}\n\nconst CUSTOMS: ProtocolIndexerGraphMap[] = [\n custom(\n chains.lightlink.id,\n \"https://graph.phoenix.lightlink.io/query/subgraphs/name/lightlink/{SUBGRAPH_NAME}\"\n ),\n custom(\n chains.denergy.id,\n \"https://thegraph.denergychain.com/subgraphs/name/denergychain/{SUBGRAPH_NAME}\"\n ),\n];\n\nconst OFFICIALS: ProtocolIndexerGraphMap[] = [\n /* -------------------------------------------------------------------------- */\n /* MAINNETS */\n /* -------------------------------------------------------------------------- */\n official(chains.mainnet.id, {\n airdrops: \"DFD73EcSue44R7mpHvXeyvcgaT8tR1iKakZFjBsiFpjs\",\n flow: \"ECxBJhKceBGaVvK6vqmK3VQAncKwPeAQutEb8TeiUiod\",\n lockup: \"AvDAMYYHGaEwn9F9585uqq6MM5CfvRtYcb7KjK7LKPCt\",\n }),\n official(chains.abstract.id, {\n airdrops: \"DRrf6mYEhRt9QieKvTjDHnSWcBm3GW96hpedMKVxLABx\",\n flow: \"Gq3e1gihMoSynURwGXQnPoKGVZzdsyomdrMH934vQHuG\",\n lockup: \"2QjTdDFY233faXksUruMERMiDoQDdtGG5hBLC27aT1Pw\",\n }),\n official(chains.arbitrum.id, {\n airdrops: \"HkHDg6NVVVeobhpcU4pTPMktyC25zd6xAQBGpYrWDgRr\",\n flow: \"C3kBBUVtW2rxqGpAgSgEuSaT49izkH6Q8UibRt7XFTyW\",\n lockup: \"yvDXXHSyv6rGPSzfpbBcbQmMFrECac3Q2zADkYsMxam\",\n }),\n official(chains.avalanche.id, {\n airdrops: \"CpbN5Ps25UzqfdoqYdrjoSK4Him6nwDvdLK6a2sGS1PA\",\n flow: \"6PAizjTALVqLLB7Ycq6XnpTeck8Z8QUpDFnVznMnisUh\",\n lockup: \"FTDmonvFEm1VGkzECcnDY2CPHcW5dSmHRurSjEEfTkCX\",\n }),\n official(chains.base.id, {\n airdrops: \"4SxPXkQNifgBYqje2C4yP5gz69erZwtD7GuLWgXHSLGe\",\n flow: \"4XSxXh8ZgkzaA35nrbQG9Ry3FYz3ZFD8QBdWwVg5pF9W\",\n lockup: \"778GfecD9tsyB4xNnz4wfuAyfHU6rqGr79VCPZKu3t2F\",\n }),\n official(chains.berachain.id, {\n airdrops: \"CnYsdmzuY3Mebwywvqv1WrXw9UZuPMTrxoGgR2UdThJE\",\n flow: \"J87eaBLfTe7kKWgUGqe5TxntNCzA4pyWmqJowMddehuh\",\n lockup: \"C2r13APcUemQtVdPFm7p7T3aJkU2rH2EvdZzrQ53zi14\",\n }),\n official(chains.bsc.id, {\n airdrops: \"FXQT42kQPvpMJgsF5Bs6CqpxVvPP1LBqEhWThCCLMeGL\",\n flow: \"2vU8KF4yWh3vvFjtg7MrRXMnYF3hPX2T3cvVBdaiXhNb\",\n lockup: \"A8Vc9hi7j45u7P8Uw5dg4uqYJgPo4x1rB4oZtTVaiccK\",\n }),\n official(chains.chiliz.id, {\n airdrops: \"6LK1aqrhzZCp6c88MEBDAR1VDLpZQiXpBKkceJ5Lu4LU\",\n flow: \"7QX7tJsANNFpxFLLjqzmXRzfY1wPGp3Lty5xGbhgADa6\",\n lockup: \"4KsXUFvsKFHH7Q8k3BPgEv2NhCJJGwG78gCPAUpncYb\",\n }),\n official(chains.gnosis.id, {\n airdrops: \"kQEY5PYbjx4SMKyMUwqJHRLDzKH1aUqGsf1cnibU7Kn\",\n flow: \"4KiJ53cTNKdFWPBPmDNQ55tYj8hn1WQg8R4UcTY2STLL\",\n lockup: \"DtKniy1RvB19q1r2g1WLN4reMNKDacEnuAjh284rW2iK\",\n }),\n official(chains.linea.id, {\n airdrops: \"6koYFSd8FQizdQWLTdRpL1yTmAbpMgN1vZN5W6ajZiTN\",\n flow: \"DV9XgcCCPKzUn6pgetg4yPetpW2fNoRKBUQC43aNeLG6\",\n lockup: \"GvpecytqVzLzuwuQB3enozXoaZRFoVx8Kr7qrfMiE9bs\",\n }),\n official(chains.optimism.id, {\n airdrops: \"CHJtCNDzPqngpa1YJoaVrjuufZL6k6VkEkG9ZFUMQzF7\",\n flow: \"AygPgsehNGSB4K7DYYtvBPhTpEiU4dCu3nt95bh9FhRf\",\n lockup: \"NZHzd2JNFKhHP5EWUiDxa5TaxGCFbSD4g6YnYr8JGi6\",\n }),\n official(chains.polygon.id, {\n airdrops: \"FRbBKiDyM5YpFAqHLXRfQWwQdMGzFL82hqoPXPpXzAHE\",\n flow: \"ykp38sLarwz3cpmjSSPqo7UuTjYtkZ1KiL4PM2qwmT8\",\n lockup: \"8fgeQMEQ8sskVeWE5nvtsVL2VpezDrAkx2d1VeiHiheu\",\n }),\n official(chains.scroll.id, {\n airdrops: \"Ev4xS8VxuoUcpgqz5A2BkTgQxQeskm4Fg41XzVJ2DX9\",\n flow: \"HFpTrPzJyrHKWZ9ebb4VFRQSxRwpepyfz5wd138daFkF\",\n lockup: \"GycpYx8c9eRqxvEAfqnpNd1ZfXeuLzjRhnG7vvYaqEE1\",\n }),\n official(chains.sonic.id, {\n airdrops: \"5g8orwpm5Rf83G8eqDzDjodt3sG2D64cbiLC98Utmv4Q\",\n flow: \"HkQKZKuM6dZ7Vc4FGC1gZTVVTniYJWRhTRmDDMNzN8zk\",\n lockup: \"GnaSPX9XLkPn219CqbGFU1NgveuQk2Hh3c8WxjtesaEh\",\n }),\n official(chains.unichain.id, {\n airdrops: \"4rQMJ85hKNhcaDyirGipGvcqS4auGU3QCFRBnpiexyNy\",\n flow: \"Cb5uDYfy4ukN9fjhQ3PQZgDzyo6G66ztn1e847rS7Xa8\",\n lockup: \"3MUG4H3gZcp9fpGLiJMTMeUFcQQ6QdT317P4wYKyns9M\",\n }),\n official(chains.zksync.id, {\n airdrops: \"64iDUwNVWKukw67nqTXif5taEfLug4Qf1c2suAv5hrqN\",\n flow: \"9DRgWhDAMovpkej3eT8izum6jxEKHE62ciArffsTAScx\",\n lockup: \"7SuEYGYwZ835LjVGB85ZE8z5zmqdKgmRh8kAEeJefWQN\",\n }),\n /* -------------------------------------------------------------------------- */\n /* TESTNETS */\n /* -------------------------------------------------------------------------- */\n official(chains.baseSepolia.id, {\n airdrops: \"4R2hm27YJ7CVEJ97BbBJz2r4KTKYc8sTqqzrD8UzEfJt\",\n flow: \"AsnKT1waQMvuQxZAqfFuYwtRtAfN8uekDu75jPttfyLh\",\n lockup: \"DdiYENuyh5ztSybRJnBnCZuUgESkFasjGFHZUbURpKHz\",\n }),\n official(chains.sepolia.id, {\n airdrops: \"8PLGDyXEsPgRTAnozL7MAjmTUFY4TBzs8i4F9Pq3wwSh\",\n flow: \"EU9AWmJjrjMRkjxcdHfuWPZvPTNAL3hiXfNGN5MwUpvm\",\n lockup: \"5yDtFSxyRuqyjvGJyyuQhMEW3Uah7Ddy2KFSKVhy9VMa\",\n }),\n];\n\nconst ALL: ProtocolIndexerGraphMap[] = [...CUSTOMS, ...OFFICIALS];\n\nfunction toSortedArray(\n indexerMaps: ProtocolIndexerGraphMap[],\n protocol: Indexer.Protocol\n): ProtocolGraphIndexer[] {\n return indexerMaps\n .map((indexerMap) => indexerMap[protocol])\n .sort((a, b) => {\n const chainNameA = sablier.chains.getOrThrow(a.chainId).name;\n const chainNameB = sablier.chains.getOrThrow(b.chainId).name;\n return chainNameA.localeCompare(chainNameB);\n });\n}\n\nfunction toPublicIndexers(\n indexers: ProtocolGraphIndexer[],\n indexer: Indexer.IndexerKey\n): Indexer[] {\n return indexers.map((entry) => ({ ...entry, indexer }));\n}\n\nexport function getProtocolGraphIndexer(opts: {\n chainId: number;\n protocol: Indexer.Protocol;\n}): ProtocolGraphIndexer | undefined {\n return toSortedArray(ALL, opts.protocol).find((indexer) => indexer.chainId === opts.chainId);\n}\n\nexport const graph: Record<Indexer.IndexerKey, Indexer[]> = {\n airdrops: toPublicIndexers(toSortedArray(ALL, Protocol.Airdrops), Protocol.Airdrops),\n streams: toPublicIndexers(toSortedArray(ALL, Protocol.Lockup), \"streams\"),\n};\n\n// It doesn't matter what protocol we are using since each chain supports all protocols.\nexport const graphChains = graph.streams.map((c) => c.chainId);\n"]}
|
package/dist/cjs/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Sablier } from \"sablier\";\nimport type * as enums from \"./enums.js\";\n\nexport type Indexer = {\n chainId: number;\n explorerURL?: string;\n endpoint: {\n id?: string;\n url: string;\n };\n kind: \"custom\" | \"official\";\n
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Sablier } from \"sablier\";\nimport type * as enums from \"./enums.js\";\n\nexport type Indexer = {\n chainId: number;\n explorerURL?: string;\n endpoint: {\n id?: string;\n url: string;\n };\n kind: \"custom\" | \"official\";\n indexer: Indexer.IndexerKey;\n name: string;\n /** GraphQL endpoint that doesn't require an API key. Opening it in the browser may lead to a GraphiQL playground.*/\n testingURL?: string;\n vendor: Indexer.Vendor;\n};\n\nexport namespace Indexer {\n export type EnvioConfig = {\n chainId: number;\n hypersyncURL?: string;\n };\n\n export type EnvioDeployment = {\n /** Envio's Subgraph Converter endpoint URL, which provides a subgraph-compatible GraphQL API. */\n converterURL: string;\n /** Unix timestamp in seconds for when the indexer ID was created. */\n createdOn?: number;\n endpoint: {\n /** The indexer ID value, e.g. `53b7e25`. */\n id: string;\n /** The URL of the indexer. */\n url: string;\n };\n /** The URL on the Envio Hosted Service. */\n explorerURL: string;\n /** The indexer associated with this deployment. */\n indexer: Indexer.IndexerKey;\n /**\n * Unix timestamp in seconds for when the indexer ID was used last time in the Sablier Interface.\n * An undefined value means that the indexer ID is no longer used.\n */\n usedUntil?: number;\n };\n\n export type GraphConfig = {\n chainId: number;\n };\n\n /** Indexer build targets for codegen, schema generation, and CLI commands. */\n export type Target = \"airdrops\" | \"streams\" | \"analytics\";\n\n /** Public indexer keys exposed by the registry helpers and package surface. */\n export type IndexerKey = \"airdrops\" | \"streams\";\n\n /** Graph-specific build targets. */\n export type GraphTarget = Exclude<Target, \"analytics\">;\n\n /**\n * Bob and Legacy are excluded because they are not part of the Envio/Graph indexers.\n */\n export type Protocol = Exclude<Sablier.Protocol, \"bob\" | \"legacy\">;\n\n export type Vendor = `${enums.Vendor}` | enums.Vendor;\n}\n\n/**\n * Types needed for all indexers: Envio and The Graph.\n */\nexport namespace Model {\n export type ComponentMap<T> = {\n [contractName: string]: {\n [version: string]: T;\n };\n };\n\n /**\n * A variation of the Sablier.Contract with the `alias` and `block` fields required.\n * @see Sablier.Contract\n */\n export type Contract = Sablier.Contract & {\n alias: string;\n block: number;\n version: Sablier.Version;\n };\n\n export type ContractSource<V extends Version> = {\n /** The name of the contract, e.g., SablierFlow. */\n name: string;\n /** Whether the contract is a template, i.e., deployed by a factory. */\n isTemplate: boolean;\n /** The Sablier versions the contract is part of. */\n versions: V[];\n };\n\n /**\n * Event emitted by a Sablier contract that is tracked and processed by our indexers.\n * This type defines the metadata needed to identify and handle specific contract events\n * across different versions and protocols.\n */\n export type Event = {\n /** Name of contract whose ABI contains the event, e.g., SablierLockup. */\n contractName: string;\n /** Event name, e.g., Approval. */\n eventName: string;\n /** Indexers that should process the event, e.g., analytics, streams. */\n indexers: Indexer.Target[];\n /** Protocol of contract, e.g., flow. */\n protocol: Indexer.Protocol;\n /** Version of contract, e.g., v1.0. */\n version: Version;\n };\n\n export type EventMap = ComponentMap<Event[]>;\n\n export type ProtocolMap<T> = {\n [protocol in Indexer.Protocol]: T;\n };\n\n export type Version = Sablier.Version.Airdrops | Sablier.Version.Flow | Sablier.Version.Lockup;\n}\n"]}
|
|
@@ -1,50 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
function getURL(id) {
|
|
1
|
+
function getIndexerURL(id) {
|
|
3
2
|
return `https://indexer.hyperindex.xyz/${id}/v1/graphql`;
|
|
4
3
|
}
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
4
|
+
function getConverterURL(id) {
|
|
5
|
+
return `${getIndexerURL(id)}/converter`;
|
|
6
|
+
}
|
|
7
|
+
function createDeployment(args) {
|
|
8
|
+
return {
|
|
9
|
+
createdOn: args.createdOn,
|
|
10
|
+
explorerURL: args.explorerURL,
|
|
11
|
+
indexer: args.indexer,
|
|
12
|
+
get converterURL() {
|
|
13
|
+
return getConverterURL(this.endpoint.id);
|
|
15
14
|
},
|
|
16
|
-
},
|
|
17
|
-
flow: {
|
|
18
|
-
createdOn: 1_731_318_958,
|
|
19
|
-
explorerURL: "https://envio.dev/app/sablier-labs/flow-envio",
|
|
20
|
-
protocol: Protocol.Flow,
|
|
21
15
|
endpoint: {
|
|
22
|
-
id:
|
|
16
|
+
id: args.id,
|
|
23
17
|
get url() {
|
|
24
|
-
return
|
|
18
|
+
return getIndexerURL(this.id);
|
|
25
19
|
},
|
|
26
20
|
},
|
|
27
|
-
}
|
|
28
|
-
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
const publicDeployments = {
|
|
24
|
+
airdrops: createDeployment({
|
|
25
|
+
createdOn: 1_712_673_343,
|
|
26
|
+
explorerURL: "https://envio.dev/app/sablier-labs/merkle-envio",
|
|
27
|
+
id: "508d217",
|
|
28
|
+
indexer: "airdrops",
|
|
29
|
+
}),
|
|
30
|
+
streams: createDeployment({
|
|
29
31
|
createdOn: 1_712_673_343,
|
|
30
32
|
explorerURL: "https://envio.dev/app/sablier-labs/lockup-envio",
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
get url() {
|
|
35
|
-
return getURL(this.id);
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
streams: {
|
|
40
|
-
explorerURL: "https://envio.dev/app/sablier-labs/streams-envio",
|
|
41
|
-
protocol: "streams",
|
|
42
|
-
endpoint: {
|
|
43
|
-
id: "e835646",
|
|
44
|
-
get url() {
|
|
45
|
-
return getURL(this.id);
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
},
|
|
33
|
+
id: "d9317de",
|
|
34
|
+
indexer: "streams",
|
|
35
|
+
}),
|
|
49
36
|
};
|
|
37
|
+
export const envioDeployments = {
|
|
38
|
+
airdrops: publicDeployments.airdrops,
|
|
39
|
+
streams: publicDeployments.streams,
|
|
40
|
+
};
|
|
41
|
+
export function getEnvioDeployment(indexer) {
|
|
42
|
+
return envioDeployments[indexer];
|
|
43
|
+
}
|
|
50
44
|
//# sourceMappingURL=envio-deployments.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envio-deployments.js","sourceRoot":"","sources":["../../../src/indexers/envio-deployments.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"envio-deployments.js","sourceRoot":"","sources":["../../../src/indexers/envio-deployments.ts"],"names":[],"mappings":"AAEA,SAAS,aAAa,CAAC,EAAU;IAC/B,OAAO,kCAAkC,EAAE,aAAa,CAAC;AAC3D,CAAC;AAED,SAAS,eAAe,CAAC,EAAU;IACjC,OAAO,GAAG,aAAa,CAAC,EAAE,CAAC,YAAY,CAAC;AAC1C,CAAC;AAED,SAAS,gBAAgB,CAAC,IAKzB;IACC,OAAO;QACL,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,IAAI,YAAY;YACd,OAAO,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QAC3C,CAAC;QACD,QAAQ,EAAE;YACR,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,IAAI,GAAG;gBACL,OAAO,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAChC,CAAC;SACF;KACF,CAAC;AACJ,CAAC;AAED,MAAM,iBAAiB,GAAG;IACxB,QAAQ,EAAE,gBAAgB,CAAC;QACzB,SAAS,EAAE,aAAa;QACxB,WAAW,EAAE,iDAAiD;QAC9D,EAAE,EAAE,SAAS;QACb,OAAO,EAAE,UAAU;KACpB,CAAC;IAGF,OAAO,EAAE,gBAAgB,CAAC;QACxB,SAAS,EAAE,aAAa;QACxB,WAAW,EAAE,iDAAiD;QAC9D,EAAE,EAAE,SAAS;QACb,OAAO,EAAE,SAAS;KACnB,CAAC;CACoE,CAAC;AAEzE,MAAM,CAAC,MAAM,gBAAgB,GAAwD;IACnF,QAAQ,EAAE,iBAAiB,CAAC,QAAQ;IACpC,OAAO,EAAE,iBAAiB,CAAC,OAAO;CACnC,CAAC;AAEF,MAAM,UAAU,kBAAkB,CAAC,OAA2B;IAC5D,OAAO,gBAAgB,CAAC,OAAO,CAAC,CAAC;AACnC,CAAC","sourcesContent":["import type { Indexer } from \"../types.js\";\n\nfunction getIndexerURL(id: string) {\n return `https://indexer.hyperindex.xyz/${id}/v1/graphql`;\n}\n\nfunction getConverterURL(id: string) {\n return `${getIndexerURL(id)}/converter`;\n}\n\nfunction createDeployment(args: {\n createdOn?: number;\n explorerURL: string;\n id: string;\n indexer: Indexer.IndexerKey;\n}): Indexer.EnvioDeployment {\n return {\n createdOn: args.createdOn,\n explorerURL: args.explorerURL,\n indexer: args.indexer,\n get converterURL() {\n return getConverterURL(this.endpoint.id);\n },\n endpoint: {\n id: args.id,\n get url() {\n return getIndexerURL(this.id);\n },\n },\n };\n}\n\nconst publicDeployments = {\n airdrops: createDeployment({\n createdOn: 1_712_673_343, // April 8, 2024\n explorerURL: \"https://envio.dev/app/sablier-labs/merkle-envio\",\n id: \"508d217\",\n indexer: \"airdrops\",\n }),\n // Streams ships through the legacy \"Lockup\" Envio deployment. We kept it to\n // avoid a full redeployment and to preserve the existing billing plan.\n streams: createDeployment({\n createdOn: 1_712_673_343, // April 8, 2024\n explorerURL: \"https://envio.dev/app/sablier-labs/lockup-envio\",\n id: \"d9317de\",\n indexer: \"streams\",\n }),\n} as const satisfies Record<Indexer.IndexerKey, Indexer.EnvioDeployment>;\n\nexport const envioDeployments: Record<Indexer.IndexerKey, Indexer.EnvioDeployment> = {\n airdrops: publicDeployments.airdrops,\n streams: publicDeployments.streams,\n};\n\nexport function getEnvioDeployment(indexer: Indexer.IndexerKey): Indexer.EnvioDeployment {\n return envioDeployments[indexer];\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { chains, Protocol } from "sablier/evm";
|
|
2
2
|
import { Vendor } from "../enums.js";
|
|
3
|
-
import {
|
|
3
|
+
import { getEnvioDeployment } from "./envio-deployments.js";
|
|
4
4
|
function get(id, config) {
|
|
5
5
|
return { config, id };
|
|
6
6
|
}
|
|
@@ -33,30 +33,31 @@ const SUPPORTED_CHAINS = [
|
|
|
33
33
|
get(chains.baseSepolia.id),
|
|
34
34
|
get(chains.sepolia.id),
|
|
35
35
|
];
|
|
36
|
-
function
|
|
36
|
+
function getEnvioDeploymentTarget(indexer) {
|
|
37
|
+
return indexer === "streams" ? Protocol.Lockup : indexer;
|
|
38
|
+
}
|
|
39
|
+
function getIndexers(indexer) {
|
|
40
|
+
const deploymentTarget = getEnvioDeploymentTarget(indexer);
|
|
37
41
|
return SUPPORTED_CHAINS.map((chain) => {
|
|
38
|
-
const deployment =
|
|
42
|
+
const deployment = getEnvioDeployment(indexer);
|
|
39
43
|
return {
|
|
40
44
|
chainId: chain.id,
|
|
41
45
|
explorerURL: deployment.explorerURL,
|
|
46
|
+
indexer,
|
|
42
47
|
kind: "official",
|
|
43
|
-
name: `sablier-${
|
|
48
|
+
name: `sablier-${deploymentTarget}`,
|
|
49
|
+
testingURL: `https://cloud.hasura.io/public/graphiql?endpoint=${encodeURIComponent(deployment.endpoint.url)}`,
|
|
50
|
+
vendor: Vendor.Envio,
|
|
44
51
|
endpoint: {
|
|
45
52
|
id: deployment.endpoint.id,
|
|
46
53
|
url: deployment.endpoint.url,
|
|
47
54
|
},
|
|
48
|
-
protocol,
|
|
49
|
-
testingURL: `https://cloud.hasura.io/public/graphiql?endpoint=${encodeURIComponent(deployment.endpoint.url)}`,
|
|
50
|
-
vendor: Vendor.Envio,
|
|
51
55
|
};
|
|
52
56
|
});
|
|
53
57
|
}
|
|
54
|
-
const STREAMS_CHAIN_IDS = new Set([chains.sepolia.id]);
|
|
55
58
|
export const envio = {
|
|
56
59
|
airdrops: getIndexers(Protocol.Airdrops),
|
|
57
|
-
|
|
58
|
-
lockup: getIndexers(Protocol.Lockup),
|
|
59
|
-
streams: getIndexers("streams").filter((i) => STREAMS_CHAIN_IDS.has(i.chainId)),
|
|
60
|
+
streams: getIndexers("streams"),
|
|
60
61
|
};
|
|
61
62
|
export const envioChains = SUPPORTED_CHAINS;
|
|
62
63
|
//# sourceMappingURL=envio.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envio.js","sourceRoot":"","sources":["../../../src/indexers/envio.ts"],"names":[],"mappings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E;YACjB,WAAW,EAAE,UAAU,CAAC,WAAW;YACnC,OAAO;YACP,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,WAAW,gBAAgB,EAAE;YACnC,UAAU,EAAE,oDAAoD,kBAAkB,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YAC7G,MAAM,EAAE,MAAM,CAAC,KAAK;YACpB,QAAQ,EAAE;gBACR,EAAE,EAAE,UAAU,CAAC,QAAQ,CAAC,EAAE;gBAC1B,GAAG,EAAE,UAAU,CAAC,QAAQ,CAAC,GAAG;aAC7B;SACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,MAAM,KAAK,GAA0C;IAC1D,QAAQ,EAAE,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC;IACxC,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC;CACvB,CAAC;AAEX,MAAM,CAAC,MAAM,WAAW,GAAG,gBAAgB,CAAC","sourcesContent":["/**\n * @file Use this file to define new indexers for Envio.\n *\n * @see https://docs.envio.dev/docs/HyperSync/hypersync-supported-networks\n */\nimport { chains, Protocol } from \"sablier/evm\";\nimport { Vendor } from \"../enums.js\";\nimport type { Indexer } from \"../types.js\";\nimport { getEnvioDeployment } from \"./envio-deployments.js\";\n\ntype EnvioChainConfig = {\n /**\n * @see https://github.com/sablier-labs/indexers/discussions/147\n * @see https://github.com/enviodev/hyperindex/issues/599\n */\n hypersync?: string;\n /**\n * Chains indexed only through RPC. No HyperSync support.\n * @see https://docs.envio.dev/docs/HyperIndex/rpc-sync\n */\n rpcOnly?: boolean;\n};\n\ntype EnvioChain = {\n config?: EnvioChainConfig;\n id: number;\n};\n\nfunction get(id: number, config?: EnvioChainConfig): EnvioChain {\n return { config, id };\n}\n\nconst SUPPORTED_CHAINS = [\n /* -------------------------------------------------------------------------- */\n /* MAINNETS */\n /* -------------------------------------------------------------------------- */\n get(chains.abstract.id),\n get(chains.arbitrum.id),\n get(chains.avalanche.id),\n get(chains.base.id),\n get(chains.blast.id),\n get(chains.berachain.id),\n get(chains.bsc.id),\n get(chains.chiliz.id, { hypersync: \"chiliz\" }),\n get(chains.gnosis.id),\n get(chains.hyperevm.id),\n get(chains.linea.id),\n get(chains.mainnet.id),\n get(chains.mode.id),\n get(chains.monad.id),\n get(chains.morph.id),\n get(chains.optimism.id),\n get(chains.polygon.id),\n get(chains.sonic.id),\n get(chains.scroll.id),\n get(chains.sei.id, { hypersync: \"sei\" }),\n get(chains.sophon.id),\n get(chains.superseed.id),\n get(chains.unichain.id),\n get(chains.xdc.id),\n get(chains.zksync.id),\n /* -------------------------------------------------------------------------- */\n /* TESTNETS */\n /* -------------------------------------------------------------------------- */\n get(chains.baseSepolia.id),\n get(chains.sepolia.id),\n] as const;\n\nfunction getEnvioDeploymentTarget(indexer: Indexer.IndexerKey): Indexer.Protocol {\n return indexer === \"streams\" ? Protocol.Lockup : indexer;\n}\n\nfunction getIndexers(indexer: Indexer.IndexerKey): Indexer[] {\n const deploymentTarget = getEnvioDeploymentTarget(indexer);\n return SUPPORTED_CHAINS.map((chain) => {\n const deployment = getEnvioDeployment(indexer);\n return {\n chainId: chain.id,\n explorerURL: deployment.explorerURL,\n indexer,\n kind: \"official\",\n name: `sablier-${deploymentTarget}`,\n testingURL: `https://cloud.hasura.io/public/graphiql?endpoint=${encodeURIComponent(deployment.endpoint.url)}`,\n vendor: Vendor.Envio,\n endpoint: {\n id: deployment.endpoint.id,\n url: deployment.endpoint.url,\n },\n };\n });\n}\n\nexport const envio: Record<Indexer.IndexerKey, Indexer[]> = {\n airdrops: getIndexers(Protocol.Airdrops),\n streams: getIndexers(\"streams\"),\n} as const;\n\nexport const envioChains = SUPPORTED_CHAINS;\n"]}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { indexers } from "./data.js";
|
|
2
2
|
export function getIndexer(opts) {
|
|
3
|
-
const { chainId,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
return indexers.graph[protocol].find((c) => c.chainId === chainId);
|
|
3
|
+
const { chainId, indexer, vendor } = opts;
|
|
4
|
+
const registry = vendor === "envio" ? indexers.envio[indexer] : indexers.graph[indexer];
|
|
5
|
+
return registry?.find((c) => c.chainId === chainId);
|
|
8
6
|
}
|
|
9
7
|
export function getIndexerGraph(opts) {
|
|
10
8
|
return getIndexer({ ...opts, vendor: "graph" });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getters.js","sourceRoot":"","sources":["../../../src/indexers/getters.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAcrC,MAAM,UAAU,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"getters.js","sourceRoot":"","sources":["../../../src/indexers/getters.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAcrC,MAAM,UAAU,UAAU,CAAC,IAAgD;IACzE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAC1C,MAAM,QAAQ,GAAG,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACxF,OAAO,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,CAAC;AACtD,CAAC;AAWD,MAAM,UAAU,eAAe,CAAC,IAAqC;IACnE,OAAO,UAAU,CAAC,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;AAClD,CAAC;AAYD,MAAM,UAAU,eAAe,CAAC,IAAqC;IACnE,OAAO,UAAU,CAAC,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;AAClD,CAAC","sourcesContent":["import type { Indexer } from \"../types.js\";\nimport { indexers } from \"./data.js\";\n\ntype I = Indexer;\ntype K = Indexer.IndexerKey;\ntype V = Indexer.Vendor;\n\n/**\n * Retrieves an indexer configuration by chain ID, indexer, and vendor.\n *\n * @param opts.chainId - The chain ID to look up\n * @param opts.indexer - The indexer key (airdrops or streams)\n * @param opts.vendor - The indexing vendor (envio or graph)\n * @returns The indexer configuration, or `undefined` if not found\n */\nexport function getIndexer(opts: { chainId: number; indexer: K; vendor: V }): I | undefined {\n const { chainId, indexer, vendor } = opts;\n const registry = vendor === \"envio\" ? indexers.envio[indexer] : indexers.graph[indexer];\n return registry?.find((c) => c.chainId === chainId);\n}\n/**\n * Retrieves a Graph indexer for the specified chain and indexer.\n *\n * Each Graph subgraph is deployed independently per chain, so each has a unique\n * endpoint URL specific to that chain.\n *\n * @param opts.chainId - The chain ID to look up\n * @param opts.indexer - The indexer key (airdrops or streams)\n * @returns The Graph indexer configuration, or `undefined` if not found\n */\nexport function getIndexerGraph(opts: { chainId: number; indexer: K }): I | undefined {\n return getIndexer({ ...opts, vendor: \"graph\" });\n}\n/**\n * Retrieves an Envio indexer for the specified chain and indexer.\n *\n * Returns the same endpoint URL for any chain on which Envio is supported, since the\n * deployments are multi-chain with a single shared endpoint per indexer.\n * Returns `undefined` for chains where Envio is unsupported.\n *\n * @param opts.chainId - The chain ID to look up\n * @param opts.indexer - The indexer key (airdrops or streams)\n * @returns The Envio indexer configuration, or `undefined` if the chain is unsupported\n */\nexport function getIndexerEnvio(opts: { chainId: number; indexer: K }): I | undefined {\n return getIndexer({ ...opts, vendor: \"envio\" });\n}\n"]}
|
|
@@ -38,13 +38,13 @@ function resolveCustom(protocol, chainId, templateURL) {
|
|
|
38
38
|
return {
|
|
39
39
|
chainId,
|
|
40
40
|
explorerURL: `${endpointUrl}/graphql`,
|
|
41
|
+
indexer: protocol,
|
|
41
42
|
kind: "custom",
|
|
42
43
|
name: subgraphName,
|
|
44
|
+
vendor: Vendor.Graph,
|
|
43
45
|
endpoint: {
|
|
44
46
|
url: endpointUrl,
|
|
45
47
|
},
|
|
46
|
-
protocol,
|
|
47
|
-
vendor: Vendor.Graph,
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
50
|
function resolveOfficial(protocol, chainId, subgraphId) {
|
|
@@ -52,15 +52,15 @@ function resolveOfficial(protocol, chainId, subgraphId) {
|
|
|
52
52
|
return {
|
|
53
53
|
chainId,
|
|
54
54
|
explorerURL: `https://thegraph.com/explorer/subgraphs/${subgraphId}`,
|
|
55
|
+
indexer: protocol,
|
|
55
56
|
kind: "official",
|
|
56
57
|
name: subgraphName,
|
|
58
|
+
testingURL: `https://api.studio.thegraph.com/query/${SUBGRAPH_STUDIO_USER_ID}/${subgraphName}/version/latest`,
|
|
59
|
+
vendor: Vendor.Graph,
|
|
57
60
|
endpoint: {
|
|
58
61
|
id: subgraphId,
|
|
59
62
|
url: `https://gateway.thegraph.com/api/subgraphs/id/${subgraphId}`,
|
|
60
63
|
},
|
|
61
|
-
protocol,
|
|
62
|
-
testingURL: `https://api.studio.thegraph.com/query/${SUBGRAPH_STUDIO_USER_ID}/${subgraphName}/version/latest`,
|
|
63
|
-
vendor: Vendor.Graph,
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
66
|
function custom(chainId, baseURL) {
|
|
@@ -183,14 +183,15 @@ function toSortedArray(indexerMaps, protocol) {
|
|
|
183
183
|
return chainNameA.localeCompare(chainNameB);
|
|
184
184
|
});
|
|
185
185
|
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
186
|
+
function toPublicIndexers(indexers, indexer) {
|
|
187
|
+
return indexers.map((entry) => ({ ...entry, indexer }));
|
|
188
|
+
}
|
|
189
|
+
export function getProtocolGraphIndexer(opts) {
|
|
190
|
+
return toSortedArray(ALL, opts.protocol).find((indexer) => indexer.chainId === opts.chainId);
|
|
191
|
+
}
|
|
189
192
|
export const graph = {
|
|
190
|
-
airdrops: toSortedArray(ALL, Protocol.Airdrops),
|
|
191
|
-
|
|
192
|
-
lockup: toSortedArray(ALL, Protocol.Lockup),
|
|
193
|
-
streams: STREAMS,
|
|
193
|
+
airdrops: toPublicIndexers(toSortedArray(ALL, Protocol.Airdrops), Protocol.Airdrops),
|
|
194
|
+
streams: toPublicIndexers(toSortedArray(ALL, Protocol.Lockup), "streams"),
|
|
194
195
|
};
|
|
195
|
-
export const graphChains = graph.
|
|
196
|
+
export const graphChains = graph.streams.map((c) => c.chainId);
|
|
196
197
|
//# sourceMappingURL=graph.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph.js","sourceRoot":"","sources":["../../../src/indexers/graph.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAarC,MAAM,0BAA0B,GAAkC;IAChE,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,cAAc;IACpC,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,cAAc;IACnC,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,OAAO;IAC5B,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,YAAY;CACjC,CAAC;AAKF,MAAM,4BAA4B,GAAkC;IAClE,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,cAAc;IACnC,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,UAAU;CAChC,CAAC;AAMF,MAAM,wBAAwB,GAAkC;IAC9D,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE,SAAS;CACjC,CAAC;AAEF,MAAM,mBAAmB,GAAG,iBAAiB,CAAC;AAM9C,MAAM,UAAU,iBAAi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CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC","sourcesContent":["/**\n * @file Use this file to define new indexers for The Graph.\n *\n */\nimport { sablier } from \"sablier\";\nimport { chains, Protocol } from \"sablier/evm\";\nimport { SUBGRAPH_STUDIO_USER_ID } from \"../constants.js\";\nimport { Vendor } from \"../enums.js\";\nimport type { Indexer } from \"../types.js\";\n\n/* -------------------------------------------------------------------------- */\n/* CONSTANTS */\n/* -------------------------------------------------------------------------- */\n\n/**\n * Custom chain slugs used by The Graph.\n *\n * ⚠️ NOTE: not all chain names used by The Graph are the same as the chain's slug defined in the Sablier SDK.\n * @see https://thegraph.com/docs/en/supported-networks\n */\nconst CHAIN_SLUG_GRAPH_OVERRIDES: { [chainId: number]: string } = {\n [chains.arbitrum.id]: \"arbitrum-one\",\n [chains.denergy.id]: \"denergychain\",\n [chains.polygon.id]: \"matic\",\n [chains.zksync.id]: \"zksync-era\",\n};\n\n/**\n * Custom chain slugs used by Sablier subgraphs.\n */\nconst CHAIN_SLUG_SABLIER_OVERRIDES: { [chainId: number]: string } = {\n [chains.denergy.id]: \"denergychain\",\n [chains.mainnet.id]: \"ethereum\",\n};\n\n/**\n * Some chains have made the really bad design choice of using custom network identifiers\n * in their subgraph.yaml files.\n */\nconst CHAIN_SLUG_SUBGRAPH_YAML: { [chainId: number]: string } = {\n [chains.lightlink.id]: \"mainnet\",\n};\n\nconst NAME_TEMPLATING_VAR = \"{SUBGRAPH_NAME}\";\n\n/* -------------------------------------------------------------------------- */\n/* HELPERS */\n/* -------------------------------------------------------------------------- */\n\nexport function getGraphChainSlug(chainId: number): string {\n return CHAIN_SLUG_GRAPH_OVERRIDES[chainId] ?? sablier.chains.getOrThrow(chainId).slug;\n}\n\nexport function getSablierChainSlug(chainId: number): string {\n return CHAIN_SLUG_SABLIER_OVERRIDES[chainId] ?? sablier.chains.getOrThrow(chainId).slug;\n}\n\nexport function getSubgraphYamlChainSlug(chainId: number): string {\n return CHAIN_SLUG_SUBGRAPH_YAML[chainId] ?? getGraphChainSlug(chainId);\n}\n\nfunction getSubgraphName(chainId: number, protocol: Indexer.DataProtocol): string {\n const graphChainName = getSablierChainSlug(chainId);\n return `sablier-${protocol}-${graphChainName}`;\n}\n\n/**\n * Sort indexers alphabetically by chain name.\n */\nfunction resolveCustom(\n protocol: Indexer.DataProtocol,\n chainId: number,\n templateURL: string\n): Indexer {\n if (!templateURL.includes(NAME_TEMPLATING_VAR)) {\n throw new Error(\n `Template URL for custom Graph indexer does not include ${NAME_TEMPLATING_VAR}`\n );\n }\n const subgraphName = getSubgraphName(chainId, protocol);\n\n const endpointUrl = templateURL.replace(NAME_TEMPLATING_VAR, subgraphName);\n return {\n chainId,\n explorerURL: `${endpointUrl}/graphql`,\n kind: \"custom\",\n name: subgraphName,\n endpoint: {\n url: endpointUrl,\n },\n protocol,\n vendor: Vendor.Graph,\n };\n}\n\nfunction resolveOfficial(\n protocol: Indexer.DataProtocol,\n chainId: number,\n subgraphId: string\n): Indexer {\n const subgraphName = getSubgraphName(chainId, protocol);\n return {\n chainId,\n explorerURL: `https://thegraph.com/explorer/subgraphs/${subgraphId}`,\n kind: \"official\",\n name: subgraphName,\n endpoint: {\n id: subgraphId,\n url: `https://gateway.thegraph.com/api/subgraphs/id/${subgraphId}`,\n },\n protocol,\n testingURL: `https://api.studio.thegraph.com/query/${SUBGRAPH_STUDIO_USER_ID}/${subgraphName}/version/latest`,\n vendor: Vendor.Graph,\n };\n}\n\n/* -------------------------------------------------------------------------- */\n/* DEFINITIONS */\n/* -------------------------------------------------------------------------- */\n\ntype SubgraphId = string;\ntype LegacyProtocol = Indexer.Protocol;\ntype SubgraphIdMap = Record<LegacyProtocol, SubgraphId>;\ntype IndexerGraphMap = Record<LegacyProtocol, Indexer>;\n\nfunction custom(chainId: number, baseURL: string): IndexerGraphMap {\n return {\n airdrops: resolveCustom(Protocol.Airdrops, chainId, baseURL),\n flow: resolveCustom(Protocol.Flow, chainId, baseURL),\n lockup: resolveCustom(Protocol.Lockup, chainId, baseURL),\n };\n}\n\nfunction official(chainId: number, idMap: SubgraphIdMap): IndexerGraphMap {\n return {\n airdrops: resolveOfficial(Protocol.Airdrops, chainId, idMap.airdrops),\n flow: resolveOfficial(Protocol.Flow, chainId, idMap.flow),\n lockup: resolveOfficial(Protocol.Lockup, chainId, idMap.lockup),\n };\n}\n\nconst CUSTOMS: IndexerGraphMap[] = [\n custom(\n chains.lightlink.id,\n \"https://graph.phoenix.lightlink.io/query/subgraphs/name/lightlink/{SUBGRAPH_NAME}\"\n ),\n custom(\n chains.denergy.id,\n \"https://thegraph.denergychain.com/subgraphs/name/denergychain/{SUBGRAPH_NAME}\"\n ),\n];\n\nconst OFFICIALS: IndexerGraphMap[] = [\n /* -------------------------------------------------------------------------- */\n /* MAINNETS */\n /* -------------------------------------------------------------------------- */\n official(chains.mainnet.id, {\n airdrops: \"DFD73EcSue44R7mpHvXeyvcgaT8tR1iKakZFjBsiFpjs\",\n flow: \"ECxBJhKceBGaVvK6vqmK3VQAncKwPeAQutEb8TeiUiod\",\n lockup: \"AvDAMYYHGaEwn9F9585uqq6MM5CfvRtYcb7KjK7LKPCt\",\n }),\n official(chains.abstract.id, {\n airdrops: \"DRrf6mYEhRt9QieKvTjDHnSWcBm3GW96hpedMKVxLABx\",\n flow: \"Gq3e1gihMoSynURwGXQnPoKGVZzdsyomdrMH934vQHuG\",\n lockup: \"2QjTdDFY233faXksUruMERMiDoQDdtGG5hBLC27aT1Pw\",\n }),\n official(chains.arbitrum.id, {\n airdrops: \"HkHDg6NVVVeobhpcU4pTPMktyC25zd6xAQBGpYrWDgRr\",\n flow: \"C3kBBUVtW2rxqGpAgSgEuSaT49izkH6Q8UibRt7XFTyW\",\n lockup: \"yvDXXHSyv6rGPSzfpbBcbQmMFrECac3Q2zADkYsMxam\",\n }),\n official(chains.avalanche.id, {\n airdrops: \"CpbN5Ps25UzqfdoqYdrjoSK4Him6nwDvdLK6a2sGS1PA\",\n flow: \"6PAizjTALVqLLB7Ycq6XnpTeck8Z8QUpDFnVznMnisUh\",\n lockup: \"FTDmonvFEm1VGkzECcnDY2CPHcW5dSmHRurSjEEfTkCX\",\n }),\n official(chains.base.id, {\n airdrops: \"4SxPXkQNifgBYqje2C4yP5gz69erZwtD7GuLWgXHSLGe\",\n flow: \"4XSxXh8ZgkzaA35nrbQG9Ry3FYz3ZFD8QBdWwVg5pF9W\",\n lockup: \"778GfecD9tsyB4xNnz4wfuAyfHU6rqGr79VCPZKu3t2F\",\n }),\n official(chains.berachain.id, {\n airdrops: \"CnYsdmzuY3Mebwywvqv1WrXw9UZuPMTrxoGgR2UdThJE\",\n flow: \"J87eaBLfTe7kKWgUGqe5TxntNCzA4pyWmqJowMddehuh\",\n lockup: \"C2r13APcUemQtVdPFm7p7T3aJkU2rH2EvdZzrQ53zi14\",\n }),\n official(chains.bsc.id, {\n airdrops: \"FXQT42kQPvpMJgsF5Bs6CqpxVvPP1LBqEhWThCCLMeGL\",\n flow: \"2vU8KF4yWh3vvFjtg7MrRXMnYF3hPX2T3cvVBdaiXhNb\",\n lockup: \"A8Vc9hi7j45u7P8Uw5dg4uqYJgPo4x1rB4oZtTVaiccK\",\n }),\n official(chains.chiliz.id, {\n airdrops: \"6LK1aqrhzZCp6c88MEBDAR1VDLpZQiXpBKkceJ5Lu4LU\",\n flow: \"7QX7tJsANNFpxFLLjqzmXRzfY1wPGp3Lty5xGbhgADa6\",\n lockup: \"4KsXUFvsKFHH7Q8k3BPgEv2NhCJJGwG78gCPAUpncYb\",\n }),\n official(chains.gnosis.id, {\n airdrops: \"kQEY5PYbjx4SMKyMUwqJHRLDzKH1aUqGsf1cnibU7Kn\",\n flow: \"4KiJ53cTNKdFWPBPmDNQ55tYj8hn1WQg8R4UcTY2STLL\",\n lockup: \"DtKniy1RvB19q1r2g1WLN4reMNKDacEnuAjh284rW2iK\",\n }),\n official(chains.linea.id, {\n airdrops: \"6koYFSd8FQizdQWLTdRpL1yTmAbpMgN1vZN5W6ajZiTN\",\n flow: \"DV9XgcCCPKzUn6pgetg4yPetpW2fNoRKBUQC43aNeLG6\",\n lockup: \"GvpecytqVzLzuwuQB3enozXoaZRFoVx8Kr7qrfMiE9bs\",\n }),\n official(chains.optimism.id, {\n airdrops: \"CHJtCNDzPqngpa1YJoaVrjuufZL6k6VkEkG9ZFUMQzF7\",\n flow: \"AygPgsehNGSB4K7DYYtvBPhTpEiU4dCu3nt95bh9FhRf\",\n lockup: \"NZHzd2JNFKhHP5EWUiDxa5TaxGCFbSD4g6YnYr8JGi6\",\n }),\n official(chains.polygon.id, {\n airdrops: \"FRbBKiDyM5YpFAqHLXRfQWwQdMGzFL82hqoPXPpXzAHE\",\n flow: \"ykp38sLarwz3cpmjSSPqo7UuTjYtkZ1KiL4PM2qwmT8\",\n lockup: \"8fgeQMEQ8sskVeWE5nvtsVL2VpezDrAkx2d1VeiHiheu\",\n }),\n official(chains.scroll.id, {\n airdrops: \"Ev4xS8VxuoUcpgqz5A2BkTgQxQeskm4Fg41XzVJ2DX9\",\n flow: \"HFpTrPzJyrHKWZ9ebb4VFRQSxRwpepyfz5wd138daFkF\",\n lockup: \"GycpYx8c9eRqxvEAfqnpNd1ZfXeuLzjRhnG7vvYaqEE1\",\n }),\n official(chains.sonic.id, {\n airdrops: \"5g8orwpm5Rf83G8eqDzDjodt3sG2D64cbiLC98Utmv4Q\",\n flow: \"HkQKZKuM6dZ7Vc4FGC1gZTVVTniYJWRhTRmDDMNzN8zk\",\n lockup: \"GnaSPX9XLkPn219CqbGFU1NgveuQk2Hh3c8WxjtesaEh\",\n }),\n official(chains.unichain.id, {\n airdrops: \"4rQMJ85hKNhcaDyirGipGvcqS4auGU3QCFRBnpiexyNy\",\n flow: \"Cb5uDYfy4ukN9fjhQ3PQZgDzyo6G66ztn1e847rS7Xa8\",\n lockup: \"3MUG4H3gZcp9fpGLiJMTMeUFcQQ6QdT317P4wYKyns9M\",\n }),\n official(chains.zksync.id, {\n airdrops: \"64iDUwNVWKukw67nqTXif5taEfLug4Qf1c2suAv5hrqN\",\n flow: \"9DRgWhDAMovpkej3eT8izum6jxEKHE62ciArffsTAScx\",\n lockup: \"7SuEYGYwZ835LjVGB85ZE8z5zmqdKgmRh8kAEeJefWQN\",\n }),\n /* -------------------------------------------------------------------------- */\n /* TESTNETS */\n /* -------------------------------------------------------------------------- */\n official(chains.baseSepolia.id, {\n airdrops: \"4R2hm27YJ7CVEJ97BbBJz2r4KTKYc8sTqqzrD8UzEfJt\",\n flow: \"AsnKT1waQMvuQxZAqfFuYwtRtAfN8uekDu75jPttfyLh\",\n lockup: \"DdiYENuyh5ztSybRJnBnCZuUgESkFasjGFHZUbURpKHz\",\n }),\n official(chains.sepolia.id, {\n airdrops: \"8PLGDyXEsPgRTAnozL7MAjmTUFY4TBzs8i4F9Pq3wwSh\",\n flow: \"EU9AWmJjrjMRkjxcdHfuWPZvPTNAL3hiXfNGN5MwUpvm\",\n lockup: \"5yDtFSxyRuqyjvGJyyuQhMEW3Uah7Ddy2KFSKVhy9VMa\",\n }),\n];\n\nconst ALL: IndexerGraphMap[] = [...CUSTOMS, ...OFFICIALS];\n\nfunction toSortedArray(indexerMaps: IndexerGraphMap[], protocol: LegacyProtocol): Indexer[] {\n return indexerMaps\n .map((indexerMap) => indexerMap[protocol])\n .sort((a, b) => {\n const chainNameA = sablier.chains.getOrThrow(a.chainId).name;\n const chainNameB = sablier.chains.getOrThrow(b.chainId).name;\n return chainNameA.localeCompare(chainNameB);\n });\n}\n\n/** Beta: streams subgraph deployed only on Sepolia. */\nconst STREAMS: Indexer[] = [\n resolveOfficial(\"streams\", chains.sepolia.id, \"gXjQjEXaeBpBsMLbVo9govzQMyBLUtJHciKbJdxQCjV\"),\n];\n\nexport const graph: Record<Indexer.DataProtocol, Indexer[]> = {\n airdrops: toSortedArray(ALL, Protocol.Airdrops),\n flow: toSortedArray(ALL, Protocol.Flow),\n lockup: toSortedArray(ALL, Protocol.Lockup),\n streams: STREAMS,\n};\n\n// It doesn't matter what protocol we are using since each chain supports all protocols.\nexport const graphChains = graph.lockup.map((c) => c.chainId);\n"]}
|
|
1
|
+
{"version":3,"file":"graph.js","sourceRoot":"","sources":["../../../src/indexers/graph.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAarC,MAAM,0BAA0B,GAAkC;IAChE,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,cAAc;IACpC,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,cAAc;IACnC,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,OAAO;IAC5B,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,YAAY;CACjC,CAAC;AAKF,MAAM,4BAA4B,GAAkC;IAClE,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,cAAc;IACnC,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,UAAU;CAChC,CAAC;AAMF,MAAM,wBAAwB,GAAkC;IAC9D,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE,SAAS;CACjC,CAAC;AAEF,MAAM,mBAAmB,GAAG,iBAAiB,CAAC;AAM9C,MAAM,UAAU,iBAAiB,CAAC,OAAe;IAC/C,OAAO,0BAA0B,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC;AACxF,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,OAAe;IACjD,OAAO,4BAA4B,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,MAAM,CAA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CAC1E,CAAC;AAGF,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC","sourcesContent":["/**\n * @file Use this file to define new indexers for The Graph.\n *\n */\nimport { sablier } from \"sablier\";\nimport { chains, Protocol } from \"sablier/evm\";\nimport { SUBGRAPH_STUDIO_USER_ID } from \"../constants.js\";\nimport { Vendor } from \"../enums.js\";\nimport type { Indexer } from \"../types.js\";\n\n/* -------------------------------------------------------------------------- */\n/* CONSTANTS */\n/* -------------------------------------------------------------------------- */\n\n/**\n * Custom chain slugs used by The Graph.\n *\n * ⚠️ NOTE: not all chain names used by The Graph are the same as the chain's slug defined in the Sablier SDK.\n * @see https://thegraph.com/docs/en/supported-networks\n */\nconst CHAIN_SLUG_GRAPH_OVERRIDES: { [chainId: number]: string } = {\n [chains.arbitrum.id]: \"arbitrum-one\",\n [chains.denergy.id]: \"denergychain\",\n [chains.polygon.id]: \"matic\",\n [chains.zksync.id]: \"zksync-era\",\n};\n\n/**\n * Custom chain slugs used by Sablier subgraphs.\n */\nconst CHAIN_SLUG_SABLIER_OVERRIDES: { [chainId: number]: string } = {\n [chains.denergy.id]: \"denergychain\",\n [chains.mainnet.id]: \"ethereum\",\n};\n\n/**\n * Some chains have made the really bad design choice of using custom network identifiers\n * in their subgraph.yaml files.\n */\nconst CHAIN_SLUG_SUBGRAPH_YAML: { [chainId: number]: string } = {\n [chains.lightlink.id]: \"mainnet\",\n};\n\nconst NAME_TEMPLATING_VAR = \"{SUBGRAPH_NAME}\";\n\n/* -------------------------------------------------------------------------- */\n/* HELPERS */\n/* -------------------------------------------------------------------------- */\n\nexport function getGraphChainSlug(chainId: number): string {\n return CHAIN_SLUG_GRAPH_OVERRIDES[chainId] ?? sablier.chains.getOrThrow(chainId).slug;\n}\n\nexport function getSablierChainSlug(chainId: number): string {\n return CHAIN_SLUG_SABLIER_OVERRIDES[chainId] ?? sablier.chains.getOrThrow(chainId).slug;\n}\n\nexport function getSubgraphYamlChainSlug(chainId: number): string {\n return CHAIN_SLUG_SUBGRAPH_YAML[chainId] ?? getGraphChainSlug(chainId);\n}\n\ntype ProtocolGraphIndexer = Omit<Indexer, \"indexer\"> & {\n indexer: Indexer.Protocol;\n};\n\nfunction getSubgraphName(chainId: number, protocol: Indexer.Protocol): string {\n const graphChainName = getSablierChainSlug(chainId);\n return `sablier-${protocol}-${graphChainName}`;\n}\n\n/**\n * Sort indexers alphabetically by chain name.\n */\nfunction resolveCustom(\n protocol: Indexer.Protocol,\n chainId: number,\n templateURL: string\n): ProtocolGraphIndexer {\n if (!templateURL.includes(NAME_TEMPLATING_VAR)) {\n throw new Error(\n `Template URL for custom Graph indexer does not include ${NAME_TEMPLATING_VAR}`\n );\n }\n const subgraphName = getSubgraphName(chainId, protocol);\n\n const endpointUrl = templateURL.replace(NAME_TEMPLATING_VAR, subgraphName);\n return {\n chainId,\n explorerURL: `${endpointUrl}/graphql`,\n indexer: protocol,\n kind: \"custom\",\n name: subgraphName,\n vendor: Vendor.Graph,\n endpoint: {\n url: endpointUrl,\n },\n };\n}\n\nfunction resolveOfficial(\n protocol: Indexer.Protocol,\n chainId: number,\n subgraphId: string\n): ProtocolGraphIndexer {\n const subgraphName = getSubgraphName(chainId, protocol);\n return {\n chainId,\n explorerURL: `https://thegraph.com/explorer/subgraphs/${subgraphId}`,\n indexer: protocol,\n kind: \"official\",\n name: subgraphName,\n testingURL: `https://api.studio.thegraph.com/query/${SUBGRAPH_STUDIO_USER_ID}/${subgraphName}/version/latest`,\n vendor: Vendor.Graph,\n endpoint: {\n id: subgraphId,\n url: `https://gateway.thegraph.com/api/subgraphs/id/${subgraphId}`,\n },\n };\n}\n\n/* -------------------------------------------------------------------------- */\n/* DEFINITIONS */\n/* -------------------------------------------------------------------------- */\n\ntype SubgraphId = string;\ntype SubgraphIdMap = Record<Indexer.Protocol, SubgraphId>;\ntype ProtocolIndexerGraphMap = Record<Indexer.Protocol, ProtocolGraphIndexer>;\n\nfunction custom(chainId: number, baseURL: string): ProtocolIndexerGraphMap {\n return {\n airdrops: resolveCustom(Protocol.Airdrops, chainId, baseURL),\n flow: resolveCustom(Protocol.Flow, chainId, baseURL),\n lockup: resolveCustom(Protocol.Lockup, chainId, baseURL),\n };\n}\n\nfunction official(chainId: number, idMap: SubgraphIdMap): ProtocolIndexerGraphMap {\n return {\n airdrops: resolveOfficial(Protocol.Airdrops, chainId, idMap.airdrops),\n flow: resolveOfficial(Protocol.Flow, chainId, idMap.flow),\n lockup: resolveOfficial(Protocol.Lockup, chainId, idMap.lockup),\n };\n}\n\nconst CUSTOMS: ProtocolIndexerGraphMap[] = [\n custom(\n chains.lightlink.id,\n \"https://graph.phoenix.lightlink.io/query/subgraphs/name/lightlink/{SUBGRAPH_NAME}\"\n ),\n custom(\n chains.denergy.id,\n \"https://thegraph.denergychain.com/subgraphs/name/denergychain/{SUBGRAPH_NAME}\"\n ),\n];\n\nconst OFFICIALS: ProtocolIndexerGraphMap[] = [\n /* -------------------------------------------------------------------------- */\n /* MAINNETS */\n /* -------------------------------------------------------------------------- */\n official(chains.mainnet.id, {\n airdrops: \"DFD73EcSue44R7mpHvXeyvcgaT8tR1iKakZFjBsiFpjs\",\n flow: \"ECxBJhKceBGaVvK6vqmK3VQAncKwPeAQutEb8TeiUiod\",\n lockup: \"AvDAMYYHGaEwn9F9585uqq6MM5CfvRtYcb7KjK7LKPCt\",\n }),\n official(chains.abstract.id, {\n airdrops: \"DRrf6mYEhRt9QieKvTjDHnSWcBm3GW96hpedMKVxLABx\",\n flow: \"Gq3e1gihMoSynURwGXQnPoKGVZzdsyomdrMH934vQHuG\",\n lockup: \"2QjTdDFY233faXksUruMERMiDoQDdtGG5hBLC27aT1Pw\",\n }),\n official(chains.arbitrum.id, {\n airdrops: \"HkHDg6NVVVeobhpcU4pTPMktyC25zd6xAQBGpYrWDgRr\",\n flow: \"C3kBBUVtW2rxqGpAgSgEuSaT49izkH6Q8UibRt7XFTyW\",\n lockup: \"yvDXXHSyv6rGPSzfpbBcbQmMFrECac3Q2zADkYsMxam\",\n }),\n official(chains.avalanche.id, {\n airdrops: \"CpbN5Ps25UzqfdoqYdrjoSK4Him6nwDvdLK6a2sGS1PA\",\n flow: \"6PAizjTALVqLLB7Ycq6XnpTeck8Z8QUpDFnVznMnisUh\",\n lockup: \"FTDmonvFEm1VGkzECcnDY2CPHcW5dSmHRurSjEEfTkCX\",\n }),\n official(chains.base.id, {\n airdrops: \"4SxPXkQNifgBYqje2C4yP5gz69erZwtD7GuLWgXHSLGe\",\n flow: \"4XSxXh8ZgkzaA35nrbQG9Ry3FYz3ZFD8QBdWwVg5pF9W\",\n lockup: \"778GfecD9tsyB4xNnz4wfuAyfHU6rqGr79VCPZKu3t2F\",\n }),\n official(chains.berachain.id, {\n airdrops: \"CnYsdmzuY3Mebwywvqv1WrXw9UZuPMTrxoGgR2UdThJE\",\n flow: \"J87eaBLfTe7kKWgUGqe5TxntNCzA4pyWmqJowMddehuh\",\n lockup: \"C2r13APcUemQtVdPFm7p7T3aJkU2rH2EvdZzrQ53zi14\",\n }),\n official(chains.bsc.id, {\n airdrops: \"FXQT42kQPvpMJgsF5Bs6CqpxVvPP1LBqEhWThCCLMeGL\",\n flow: \"2vU8KF4yWh3vvFjtg7MrRXMnYF3hPX2T3cvVBdaiXhNb\",\n lockup: \"A8Vc9hi7j45u7P8Uw5dg4uqYJgPo4x1rB4oZtTVaiccK\",\n }),\n official(chains.chiliz.id, {\n airdrops: \"6LK1aqrhzZCp6c88MEBDAR1VDLpZQiXpBKkceJ5Lu4LU\",\n flow: \"7QX7tJsANNFpxFLLjqzmXRzfY1wPGp3Lty5xGbhgADa6\",\n lockup: \"4KsXUFvsKFHH7Q8k3BPgEv2NhCJJGwG78gCPAUpncYb\",\n }),\n official(chains.gnosis.id, {\n airdrops: \"kQEY5PYbjx4SMKyMUwqJHRLDzKH1aUqGsf1cnibU7Kn\",\n flow: \"4KiJ53cTNKdFWPBPmDNQ55tYj8hn1WQg8R4UcTY2STLL\",\n lockup: \"DtKniy1RvB19q1r2g1WLN4reMNKDacEnuAjh284rW2iK\",\n }),\n official(chains.linea.id, {\n airdrops: \"6koYFSd8FQizdQWLTdRpL1yTmAbpMgN1vZN5W6ajZiTN\",\n flow: \"DV9XgcCCPKzUn6pgetg4yPetpW2fNoRKBUQC43aNeLG6\",\n lockup: \"GvpecytqVzLzuwuQB3enozXoaZRFoVx8Kr7qrfMiE9bs\",\n }),\n official(chains.optimism.id, {\n airdrops: \"CHJtCNDzPqngpa1YJoaVrjuufZL6k6VkEkG9ZFUMQzF7\",\n flow: \"AygPgsehNGSB4K7DYYtvBPhTpEiU4dCu3nt95bh9FhRf\",\n lockup: \"NZHzd2JNFKhHP5EWUiDxa5TaxGCFbSD4g6YnYr8JGi6\",\n }),\n official(chains.polygon.id, {\n airdrops: \"FRbBKiDyM5YpFAqHLXRfQWwQdMGzFL82hqoPXPpXzAHE\",\n flow: \"ykp38sLarwz3cpmjSSPqo7UuTjYtkZ1KiL4PM2qwmT8\",\n lockup: \"8fgeQMEQ8sskVeWE5nvtsVL2VpezDrAkx2d1VeiHiheu\",\n }),\n official(chains.scroll.id, {\n airdrops: \"Ev4xS8VxuoUcpgqz5A2BkTgQxQeskm4Fg41XzVJ2DX9\",\n flow: \"HFpTrPzJyrHKWZ9ebb4VFRQSxRwpepyfz5wd138daFkF\",\n lockup: \"GycpYx8c9eRqxvEAfqnpNd1ZfXeuLzjRhnG7vvYaqEE1\",\n }),\n official(chains.sonic.id, {\n airdrops: \"5g8orwpm5Rf83G8eqDzDjodt3sG2D64cbiLC98Utmv4Q\",\n flow: \"HkQKZKuM6dZ7Vc4FGC1gZTVVTniYJWRhTRmDDMNzN8zk\",\n lockup: \"GnaSPX9XLkPn219CqbGFU1NgveuQk2Hh3c8WxjtesaEh\",\n }),\n official(chains.unichain.id, {\n airdrops: \"4rQMJ85hKNhcaDyirGipGvcqS4auGU3QCFRBnpiexyNy\",\n flow: \"Cb5uDYfy4ukN9fjhQ3PQZgDzyo6G66ztn1e847rS7Xa8\",\n lockup: \"3MUG4H3gZcp9fpGLiJMTMeUFcQQ6QdT317P4wYKyns9M\",\n }),\n official(chains.zksync.id, {\n airdrops: \"64iDUwNVWKukw67nqTXif5taEfLug4Qf1c2suAv5hrqN\",\n flow: \"9DRgWhDAMovpkej3eT8izum6jxEKHE62ciArffsTAScx\",\n lockup: \"7SuEYGYwZ835LjVGB85ZE8z5zmqdKgmRh8kAEeJefWQN\",\n }),\n /* -------------------------------------------------------------------------- */\n /* TESTNETS */\n /* -------------------------------------------------------------------------- */\n official(chains.baseSepolia.id, {\n airdrops: \"4R2hm27YJ7CVEJ97BbBJz2r4KTKYc8sTqqzrD8UzEfJt\",\n flow: \"AsnKT1waQMvuQxZAqfFuYwtRtAfN8uekDu75jPttfyLh\",\n lockup: \"DdiYENuyh5ztSybRJnBnCZuUgESkFasjGFHZUbURpKHz\",\n }),\n official(chains.sepolia.id, {\n airdrops: \"8PLGDyXEsPgRTAnozL7MAjmTUFY4TBzs8i4F9Pq3wwSh\",\n flow: \"EU9AWmJjrjMRkjxcdHfuWPZvPTNAL3hiXfNGN5MwUpvm\",\n lockup: \"5yDtFSxyRuqyjvGJyyuQhMEW3Uah7Ddy2KFSKVhy9VMa\",\n }),\n];\n\nconst ALL: ProtocolIndexerGraphMap[] = [...CUSTOMS, ...OFFICIALS];\n\nfunction toSortedArray(\n indexerMaps: ProtocolIndexerGraphMap[],\n protocol: Indexer.Protocol\n): ProtocolGraphIndexer[] {\n return indexerMaps\n .map((indexerMap) => indexerMap[protocol])\n .sort((a, b) => {\n const chainNameA = sablier.chains.getOrThrow(a.chainId).name;\n const chainNameB = sablier.chains.getOrThrow(b.chainId).name;\n return chainNameA.localeCompare(chainNameB);\n });\n}\n\nfunction toPublicIndexers(\n indexers: ProtocolGraphIndexer[],\n indexer: Indexer.IndexerKey\n): Indexer[] {\n return indexers.map((entry) => ({ ...entry, indexer }));\n}\n\nexport function getProtocolGraphIndexer(opts: {\n chainId: number;\n protocol: Indexer.Protocol;\n}): ProtocolGraphIndexer | undefined {\n return toSortedArray(ALL, opts.protocol).find((indexer) => indexer.chainId === opts.chainId);\n}\n\nexport const graph: Record<Indexer.IndexerKey, Indexer[]> = {\n airdrops: toPublicIndexers(toSortedArray(ALL, Protocol.Airdrops), Protocol.Airdrops),\n streams: toPublicIndexers(toSortedArray(ALL, Protocol.Lockup), \"streams\"),\n};\n\n// It doesn't matter what protocol we are using since each chain supports all protocols.\nexport const graphChains = graph.streams.map((c) => c.chainId);\n"]}
|
package/dist/esm/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Sablier } from \"sablier\";\nimport type * as enums from \"./enums.js\";\n\nexport type Indexer = {\n chainId: number;\n explorerURL?: string;\n endpoint: {\n id?: string;\n url: string;\n };\n kind: \"custom\" | \"official\";\n
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Sablier } from \"sablier\";\nimport type * as enums from \"./enums.js\";\n\nexport type Indexer = {\n chainId: number;\n explorerURL?: string;\n endpoint: {\n id?: string;\n url: string;\n };\n kind: \"custom\" | \"official\";\n indexer: Indexer.IndexerKey;\n name: string;\n /** GraphQL endpoint that doesn't require an API key. Opening it in the browser may lead to a GraphiQL playground.*/\n testingURL?: string;\n vendor: Indexer.Vendor;\n};\n\nexport namespace Indexer {\n export type EnvioConfig = {\n chainId: number;\n hypersyncURL?: string;\n };\n\n export type EnvioDeployment = {\n /** Envio's Subgraph Converter endpoint URL, which provides a subgraph-compatible GraphQL API. */\n converterURL: string;\n /** Unix timestamp in seconds for when the indexer ID was created. */\n createdOn?: number;\n endpoint: {\n /** The indexer ID value, e.g. `53b7e25`. */\n id: string;\n /** The URL of the indexer. */\n url: string;\n };\n /** The URL on the Envio Hosted Service. */\n explorerURL: string;\n /** The indexer associated with this deployment. */\n indexer: Indexer.IndexerKey;\n /**\n * Unix timestamp in seconds for when the indexer ID was used last time in the Sablier Interface.\n * An undefined value means that the indexer ID is no longer used.\n */\n usedUntil?: number;\n };\n\n export type GraphConfig = {\n chainId: number;\n };\n\n /** Indexer build targets for codegen, schema generation, and CLI commands. */\n export type Target = \"airdrops\" | \"streams\" | \"analytics\";\n\n /** Public indexer keys exposed by the registry helpers and package surface. */\n export type IndexerKey = \"airdrops\" | \"streams\";\n\n /** Graph-specific build targets. */\n export type GraphTarget = Exclude<Target, \"analytics\">;\n\n /**\n * Bob and Legacy are excluded because they are not part of the Envio/Graph indexers.\n */\n export type Protocol = Exclude<Sablier.Protocol, \"bob\" | \"legacy\">;\n\n export type Vendor = `${enums.Vendor}` | enums.Vendor;\n}\n\n/**\n * Types needed for all indexers: Envio and The Graph.\n */\nexport namespace Model {\n export type ComponentMap<T> = {\n [contractName: string]: {\n [version: string]: T;\n };\n };\n\n /**\n * A variation of the Sablier.Contract with the `alias` and `block` fields required.\n * @see Sablier.Contract\n */\n export type Contract = Sablier.Contract & {\n alias: string;\n block: number;\n version: Sablier.Version;\n };\n\n export type ContractSource<V extends Version> = {\n /** The name of the contract, e.g., SablierFlow. */\n name: string;\n /** Whether the contract is a template, i.e., deployed by a factory. */\n isTemplate: boolean;\n /** The Sablier versions the contract is part of. */\n versions: V[];\n };\n\n /**\n * Event emitted by a Sablier contract that is tracked and processed by our indexers.\n * This type defines the metadata needed to identify and handle specific contract events\n * across different versions and protocols.\n */\n export type Event = {\n /** Name of contract whose ABI contains the event, e.g., SablierLockup. */\n contractName: string;\n /** Event name, e.g., Approval. */\n eventName: string;\n /** Indexers that should process the event, e.g., analytics, streams. */\n indexers: Indexer.Target[];\n /** Protocol of contract, e.g., flow. */\n protocol: Indexer.Protocol;\n /** Version of contract, e.g., v1.0. */\n version: Version;\n };\n\n export type EventMap = ComponentMap<Event[]>;\n\n export type ProtocolMap<T> = {\n [protocol in Indexer.Protocol]: T;\n };\n\n export type Version = Sablier.Version.Airdrops | Sablier.Version.Flow | Sablier.Version.Lockup;\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const indexers: {
|
|
2
|
-
envio: Record<import("../types.js").Indexer.
|
|
3
|
-
graph: Record<import("../types.js").Indexer.
|
|
2
|
+
envio: Record<import("../types.js").Indexer.IndexerKey, import("../types.js").Indexer[]>;
|
|
3
|
+
graph: Record<import("../types.js").Indexer.IndexerKey, import("../types.js").Indexer[]>;
|
|
4
4
|
};
|
|
5
5
|
//# sourceMappingURL=data.d.ts.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { Indexer } from "../types.js";
|
|
2
|
-
export declare const envioDeployments: Record<Indexer.
|
|
2
|
+
export declare const envioDeployments: Record<Indexer.IndexerKey, Indexer.EnvioDeployment>;
|
|
3
|
+
export declare function getEnvioDeployment(indexer: Indexer.IndexerKey): Indexer.EnvioDeployment;
|
|
3
4
|
//# sourceMappingURL=envio-deployments.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envio-deployments.d.ts","sourceRoot":"","sources":["../../../src/indexers/envio-deployments.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"envio-deployments.d.ts","sourceRoot":"","sources":["../../../src/indexers/envio-deployments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAiD3C,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,eAAe,CAGhF,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC,eAAe,CAEvF"}
|
|
@@ -7,7 +7,7 @@ type EnvioChain = {
|
|
|
7
7
|
config?: EnvioChainConfig;
|
|
8
8
|
id: number;
|
|
9
9
|
};
|
|
10
|
-
export declare const envio: Record<Indexer.
|
|
10
|
+
export declare const envio: Record<Indexer.IndexerKey, Indexer[]>;
|
|
11
11
|
export declare const envioChains: readonly [EnvioChain, EnvioChain, EnvioChain, EnvioChain, EnvioChain, EnvioChain, EnvioChain, EnvioChain, EnvioChain, EnvioChain, EnvioChain, EnvioChain, EnvioChain, EnvioChain, EnvioChain, EnvioChain, EnvioChain, EnvioChain, EnvioChain, EnvioChain, EnvioChain, EnvioChain, EnvioChain, EnvioChain, EnvioChain, EnvioChain, EnvioChain];
|
|
12
12
|
export {};
|
|
13
13
|
//# sourceMappingURL=envio.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envio.d.ts","sourceRoot":"","sources":["../../../src/indexers/envio.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAG3C,KAAK,gBAAgB,GAAG;IAKtB,SAAS,CAAC,EAAE,MAAM,CAAC;IAKnB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,KAAK,UAAU,GAAG;IAChB,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;
|
|
1
|
+
{"version":3,"file":"envio.d.ts","sourceRoot":"","sources":["../../../src/indexers/envio.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAG3C,KAAK,gBAAgB,GAAG;IAKtB,SAAS,CAAC,EAAE,MAAM,CAAC;IAKnB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,KAAK,UAAU,GAAG;IAChB,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAkEF,eAAO,MAAM,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,EAAE,CAG9C,CAAC;AAEX,eAAO,MAAM,WAAW,+UAAmB,CAAC"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import type { Indexer } from "../types.js";
|
|
2
2
|
type I = Indexer;
|
|
3
|
-
type
|
|
3
|
+
type K = Indexer.IndexerKey;
|
|
4
4
|
type V = Indexer.Vendor;
|
|
5
5
|
export declare function getIndexer(opts: {
|
|
6
6
|
chainId: number;
|
|
7
|
-
|
|
7
|
+
indexer: K;
|
|
8
8
|
vendor: V;
|
|
9
9
|
}): I | undefined;
|
|
10
10
|
export declare function getIndexerGraph(opts: {
|
|
11
11
|
chainId: number;
|
|
12
|
-
|
|
12
|
+
indexer: K;
|
|
13
13
|
}): I | undefined;
|
|
14
14
|
export declare function getIndexerEnvio(opts: {
|
|
15
15
|
chainId: number;
|
|
16
|
-
|
|
16
|
+
indexer: K;
|
|
17
17
|
}): I | undefined;
|
|
18
18
|
export {};
|
|
19
19
|
//# sourceMappingURL=getters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getters.d.ts","sourceRoot":"","sources":["../../../src/indexers/getters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAG3C,KAAK,CAAC,GAAG,OAAO,CAAC;AACjB,KAAK,CAAC,GAAG,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"getters.d.ts","sourceRoot":"","sources":["../../../src/indexers/getters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAG3C,KAAK,CAAC,GAAG,OAAO,CAAC;AACjB,KAAK,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC;AAC5B,KAAK,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;AAUxB,wBAAgB,UAAU,CAAC,IAAI,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,CAAC,CAAC;IAAC,MAAM,EAAE,CAAC,CAAA;CAAE,GAAG,CAAC,GAAG,SAAS,CAI1F;AAWD,wBAAgB,eAAe,CAAC,IAAI,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,CAAC,CAAA;CAAE,GAAG,CAAC,GAAG,SAAS,CAEpF;AAYD,wBAAgB,eAAe,CAAC,IAAI,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,CAAC,CAAA;CAAE,GAAG,CAAC,GAAG,SAAS,CAEpF"}
|
|
@@ -2,6 +2,14 @@ import type { Indexer } from "../types.js";
|
|
|
2
2
|
export declare function getGraphChainSlug(chainId: number): string;
|
|
3
3
|
export declare function getSablierChainSlug(chainId: number): string;
|
|
4
4
|
export declare function getSubgraphYamlChainSlug(chainId: number): string;
|
|
5
|
-
|
|
5
|
+
type ProtocolGraphIndexer = Omit<Indexer, "indexer"> & {
|
|
6
|
+
indexer: Indexer.Protocol;
|
|
7
|
+
};
|
|
8
|
+
export declare function getProtocolGraphIndexer(opts: {
|
|
9
|
+
chainId: number;
|
|
10
|
+
protocol: Indexer.Protocol;
|
|
11
|
+
}): ProtocolGraphIndexer | undefined;
|
|
12
|
+
export declare const graph: Record<Indexer.IndexerKey, Indexer[]>;
|
|
6
13
|
export declare const graphChains: number[];
|
|
14
|
+
export {};
|
|
7
15
|
//# sourceMappingURL=graph.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../../src/indexers/graph.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAyC3C,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEhE;
|
|
1
|
+
{"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../../src/indexers/graph.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAyC3C,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED,KAAK,oBAAoB,GAAG,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,GAAG;IACrD,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC;CAC3B,CAAC;AAqNF,wBAAgB,uBAAuB,CAAC,IAAI,EAAE;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC;CAC5B,GAAG,oBAAoB,GAAG,SAAS,CAEnC;AAED,eAAO,MAAM,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,EAAE,CAGvD,CAAC;AAGF,eAAO,MAAM,WAAW,UAAsC,CAAC"}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -8,8 +8,8 @@ export type Indexer = {
|
|
|
8
8
|
url: string;
|
|
9
9
|
};
|
|
10
10
|
kind: "custom" | "official";
|
|
11
|
+
indexer: Indexer.IndexerKey;
|
|
11
12
|
name: string;
|
|
12
|
-
protocol: Indexer.DataProtocol;
|
|
13
13
|
testingURL?: string;
|
|
14
14
|
vendor: Indexer.Vendor;
|
|
15
15
|
};
|
|
@@ -19,20 +19,22 @@ export declare namespace Indexer {
|
|
|
19
19
|
hypersyncURL?: string;
|
|
20
20
|
};
|
|
21
21
|
type EnvioDeployment = {
|
|
22
|
+
converterURL: string;
|
|
22
23
|
createdOn?: number;
|
|
23
24
|
endpoint: {
|
|
24
25
|
id: string;
|
|
25
26
|
url: string;
|
|
26
27
|
};
|
|
27
28
|
explorerURL: string;
|
|
28
|
-
|
|
29
|
+
indexer: Indexer.IndexerKey;
|
|
29
30
|
usedUntil?: number;
|
|
30
31
|
};
|
|
31
32
|
type GraphConfig = {
|
|
32
33
|
chainId: number;
|
|
33
34
|
};
|
|
34
|
-
type
|
|
35
|
-
type
|
|
35
|
+
type Target = "airdrops" | "streams" | "analytics";
|
|
36
|
+
type IndexerKey = "airdrops" | "streams";
|
|
37
|
+
type GraphTarget = Exclude<Target, "analytics">;
|
|
36
38
|
type Protocol = Exclude<Sablier.Protocol, "bob" | "legacy">;
|
|
37
39
|
type Vendor = `${enums.Vendor}` | enums.Vendor;
|
|
38
40
|
}
|
|
@@ -55,7 +57,7 @@ export declare namespace Model {
|
|
|
55
57
|
type Event = {
|
|
56
58
|
contractName: string;
|
|
57
59
|
eventName: string;
|
|
58
|
-
indexers: Indexer.
|
|
60
|
+
indexers: Indexer.Target[];
|
|
59
61
|
protocol: Indexer.Protocol;
|
|
60
62
|
version: Version;
|
|
61
63
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,KAAK,KAAK,MAAM,YAAY,CAAC;AAEzC,MAAM,MAAM,OAAO,GAAG;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE;QACR,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,IAAI,EAAE,QAAQ,GAAG,UAAU,CAAC;IAC5B,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,KAAK,KAAK,KAAK,MAAM,YAAY,CAAC;AAEzC,MAAM,MAAM,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AC;CACvD;AAKD,yBAAiB,KAAK,CAAC;IACrB,KAAY,YAAY,CAAC,CAAC,IAAI;QAC5B,CAAC,YAAY,EAAE,MAAM,GAAG;YACtB,CAAC,OAAO,EAAE,MAAM,GAAG,CAAC,CAAC;SACtB,CAAC;KACH,CAAC;IAMF,KAAY,QAAQ,GAAG,OAAO,CAAC,QAAQ,GAAG;QACxC,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC;KAC1B,CAAC;IAEF,KAAY,cAAc,CAAC,CAAC,SAAS,OAAO,IAAI;QAE9C,IAAI,EAAE,MAAM,CAAC;QAEb,UAAU,EAAE,OAAO,CAAC;QAEpB,QAAQ,EAAE,CAAC,EAAE,CAAC;KACf,CAAC;IAOF,KAAY,KAAK,GAAG;QAElB,YAAY,EAAE,MAAM,CAAC;QAErB,SAAS,EAAE,MAAM,CAAC;QAElB,QAAQ,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC;QAE3B,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC;QAE3B,OAAO,EAAE,OAAO,CAAC;KAClB,CAAC;IAEF,KAAY,QAAQ,GAAG,YAAY,CAAC,KAAK,EAAE,CAAC,CAAC;IAE7C,KAAY,WAAW,CAAC,CAAC,IAAI;SAC1B,QAAQ,IAAI,OAAO,CAAC,QAAQ,GAAG,CAAC;KAClC,CAAC;IAEF,KAAY,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC;CAChG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sablier/indexers",
|
|
3
|
-
"version": "3.1.0-beta.
|
|
3
|
+
"version": "3.1.0-beta.2",
|
|
4
4
|
"description": "Data indexers for the Sablier Protocol",
|
|
5
5
|
"homepage": "https://github.com/sablier-labs/indexers#readme",
|
|
6
6
|
"license": "GPL-3.0-or-later",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"url": "https://sablier.com"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"sablier": "^3.3.
|
|
18
|
+
"sablier": "^3.3.5"
|
|
19
19
|
},
|
|
20
20
|
"exports": {
|
|
21
21
|
".": {
|