@lidofinance/eth-api-providers 0.10.0 → 0.11.0
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/dist/index.cjs.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;ACAA;AAUO,MAAM,
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;ACAA;AAUO,MAAM,4CAAyB,CAAmC,UACvE,OAAM,YACN,SAAQ,YACR,SAAQ,EAC4B,GAAQ;IAC5C,MAAM,mBAAE,gBAAe,qBAAE,kBAAiB,mBAAE,gBAAe,EAAE,GAAG,CAAA,GAAA,8CAAiB,AAAD,EAAE,QAAQ;IAE1F,kDAAkD;IAClD,OAAO,cAAc;QACnB,MAAM,KAAK,MAAc,EAAE,MAAiB,EAAE;YAC5C,MAAM,UAAU,IAAI,CAAC,QAAQ,CAAC,OAAO;YACrC,MAAM,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG;YAE/B,MAAM,WAAW,CAAA,GAAA,6CAAe,EAAE;YAClC,gBAAgB,MAAM,CAAC;yBAAE;0BAAS;YAAS,GAAG,GAAG;YACjD,kBAAkB,MAAM,CAAC;wBAAE;YAAO,GAAG,GAAG;YACxC,MAAM,eAAe,gBAAgB,UAAU;YAE/C,mEAAmE;YACnE,MAAM,WAAW,MAAM,KAAK,CAAC,IAAI,CAAC,QAAQ;YAE1C,aACE,wFAAwF;YACxF;yBAAE;0BAAS;gBAAU,QAAQ;YAAM;YAGrC,+DAA+D;YAC/D,OAAO;QACT;IACF;AACF;;ADxCA","sources":["packages/eth/api/providers/src/index.ts","packages/eth/api/providers/src/trackedJsonRpcProvider.ts"],"sourcesContent":["export * from './trackedJsonRpcProvider'\n","import { JsonRpcProvider } from '@ethersproject/providers'\nimport { getProviderLabel, rpcMetricsFactory } from '@lidofinance/api-metrics'\nimport { Registry } from 'prom-client'\n\nexport type TrackedJsonRpcProviderParameters<P extends typeof JsonRpcProvider> = {\n prefix: string\n registry: Registry\n Provider: P\n}\n\nexport const trackedJsonRpcProvider = <P extends typeof JsonRpcProvider>({\n prefix,\n registry,\n Provider,\n}: TrackedJsonRpcProviderParameters<P>): P => {\n const { rpcRequestCount, rpcRequestMethods, rpcResponseTime } = rpcMetricsFactory(prefix, registry)\n\n // @ts-expect-error need to investigate how to fix\n return class extends Provider {\n async send(method: string, params: unknown[]) {\n const chainId = this._network.chainId\n const url = this.connection.url\n\n const provider = getProviderLabel(url)\n rpcRequestCount.labels({ chainId, provider }).inc()\n rpcRequestMethods.labels({ method }).inc()\n const responseTime = rpcResponseTime.startTimer()\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const response = await super.send(method, params)\n\n responseTime(\n // Not sure how to get correct status here, but it's probably 2xx, or it throws an error\n { chainId, provider, status: '2xx' },\n )\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return response\n }\n }\n}\n"],"names":[],"version":3,"file":"index.cjs.map","sourceRoot":"../../../../../"}
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;ACAA;AAUO,MAAM,
|
|
1
|
+
{"mappings":";;;;;;;;ACAA;AAUO,MAAM,4CAAyB,CAAmC,UACvE,OAAM,YACN,SAAQ,YACR,SAAQ,EAC4B,GAAQ;IAC5C,MAAM,mBAAE,gBAAe,qBAAE,kBAAiB,mBAAE,gBAAe,EAAE,GAAG,CAAA,GAAA,wBAAiB,AAAD,EAAE,QAAQ;IAE1F,kDAAkD;IAClD,OAAO,cAAc;QACnB,MAAM,KAAK,MAAc,EAAE,MAAiB,EAAE;YAC5C,MAAM,UAAU,IAAI,CAAC,QAAQ,CAAC,OAAO;YACrC,MAAM,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG;YAE/B,MAAM,WAAW,CAAA,GAAA,uBAAe,EAAE;YAClC,gBAAgB,MAAM,CAAC;yBAAE;0BAAS;YAAS,GAAG,GAAG;YACjD,kBAAkB,MAAM,CAAC;wBAAE;YAAO,GAAG,GAAG;YACxC,MAAM,eAAe,gBAAgB,UAAU;YAE/C,mEAAmE;YACnE,MAAM,WAAW,MAAM,KAAK,CAAC,IAAI,CAAC,QAAQ;YAE1C,aACE,wFAAwF;YACxF;yBAAE;0BAAS;gBAAU,QAAQ;YAAM;YAGrC,+DAA+D;YAC/D,OAAO;QACT;IACF;AACF;;ADxCA","sources":["packages/eth/api/providers/src/index.ts","packages/eth/api/providers/src/trackedJsonRpcProvider.ts"],"sourcesContent":["export * from './trackedJsonRpcProvider'\n","import { JsonRpcProvider } from '@ethersproject/providers'\nimport { getProviderLabel, rpcMetricsFactory } from '@lidofinance/api-metrics'\nimport { Registry } from 'prom-client'\n\nexport type TrackedJsonRpcProviderParameters<P extends typeof JsonRpcProvider> = {\n prefix: string\n registry: Registry\n Provider: P\n}\n\nexport const trackedJsonRpcProvider = <P extends typeof JsonRpcProvider>({\n prefix,\n registry,\n Provider,\n}: TrackedJsonRpcProviderParameters<P>): P => {\n const { rpcRequestCount, rpcRequestMethods, rpcResponseTime } = rpcMetricsFactory(prefix, registry)\n\n // @ts-expect-error need to investigate how to fix\n return class extends Provider {\n async send(method: string, params: unknown[]) {\n const chainId = this._network.chainId\n const url = this.connection.url\n\n const provider = getProviderLabel(url)\n rpcRequestCount.labels({ chainId, provider }).inc()\n rpcRequestMethods.labels({ method }).inc()\n const responseTime = rpcResponseTime.startTimer()\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const response = await super.send(method, params)\n\n responseTime(\n // Not sure how to get correct status here, but it's probably 2xx, or it throws an error\n { chainId, provider, status: '2xx' },\n )\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return response\n }\n }\n}\n"],"names":[],"version":3,"file":"index.mjs.map","sourceRoot":"../../../../../"}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Wraps JsonRpcProvider to track requests to RPC",
|
|
4
4
|
"repository": "git@github.com:lidofinance/warehouse.git",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.11.0",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist"
|
|
9
9
|
],
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"types": "dist/index.d.ts",
|
|
17
17
|
"scripts": {
|
|
18
18
|
"build": "parcel build",
|
|
19
|
-
"
|
|
20
|
-
"
|
|
19
|
+
"lint": "eslint . && prettier --check src",
|
|
20
|
+
"lint:fix": "eslint --fix . && prettier --check src --write",
|
|
21
21
|
"types": "tsc --noEmit"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@ethersproject/networks": "^5.5.0",
|
|
26
26
|
"@ethersproject/properties": "^5.5.0",
|
|
27
27
|
"@ethersproject/providers": "^5.5.0",
|
|
28
|
-
"@lidofinance/api-metrics": "~0.
|
|
28
|
+
"@lidofinance/api-metrics": "~0.11.0",
|
|
29
29
|
"prom-client": "^14.0.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"@ethersproject/networks": "^5.7.1",
|
|
34
34
|
"@ethersproject/properties": "^5.7.0",
|
|
35
35
|
"@ethersproject/providers": "^5.7.2",
|
|
36
|
-
"@lidofinance/api-metrics": "~0.
|
|
37
|
-
"@lidofinance/config-prettier": "~0.
|
|
36
|
+
"@lidofinance/api-metrics": "~0.11.0",
|
|
37
|
+
"@lidofinance/config-prettier": "~0.11.0",
|
|
38
38
|
"prom-client": "^14.1.0"
|
|
39
39
|
}
|
|
40
40
|
}
|