@lidofinance/api-rpc 0.30.0 → 0.31.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 +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +4 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -25,15 +25,15 @@ var $47b14a281d9aea1d$exports = {};
|
|
|
25
25
|
$parcel$export($47b14a281d9aea1d$exports, "trackedFetchRpcFactory", () => $47b14a281d9aea1d$export$78b2eac677e7bce5);
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
const $47b14a281d9aea1d$export$78b2eac677e7bce5 = ({ prefix: prefix
|
|
29
|
-
const { rpcRequestCount: rpcRequestCount
|
|
30
|
-
return async (url, init, { chainId: chainId
|
|
28
|
+
const $47b14a281d9aea1d$export$78b2eac677e7bce5 = ({ prefix: prefix, registry: registry })=>{
|
|
29
|
+
const { rpcRequestCount: rpcRequestCount, rpcRequestMethods: rpcRequestMethods, rpcResponseTime: rpcResponseTime } = (0, $3WQie$lidofinanceapimetrics.rpcMetricsFactory)(prefix, registry);
|
|
30
|
+
return async (url, init, { chainId: chainId })=>{
|
|
31
31
|
const provider = (0, $3WQie$lidofinanceapimetrics.getProviderLabel)(url);
|
|
32
32
|
rpcRequestCount.labels({
|
|
33
33
|
chainId: chainId,
|
|
34
34
|
provider: provider
|
|
35
35
|
}).inc();
|
|
36
|
-
for (const { method: method
|
|
36
|
+
for (const { method: method } of Array.isArray(init.body) ? init.body : [
|
|
37
37
|
init.body
|
|
38
38
|
])rpcRequestMethods.labels({
|
|
39
39
|
method: method
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;ACWO,MAAM,4CAAyB,CAAC,UAAE,MAAM,YAAE,QAAQ,EAAoC;IAC3F,MAAM,mBAAE,eAAe,qBAAE,iBAAiB,mBAAE,eAAe,EAAE,GAAG,CAAA,GAAA,8CAAgB,EAAE,QAAQ;IAE1F,OAAO,OAAO,KAAK,MAAM,WAAE,OAAO,EAAE;QAClC,MAAM,WAAW,CAAA,GAAA,6CAAe,EAAE;QAElC,gBAAgB,OAAO;qBAAE;sBAAS;QAAS,GAAG;QAC9C,KAAK,MAAM,UAAE,MAAM,EAAE,IAAI,MAAM,QAAQ,KAAK,QAAQ,KAAK,OAAO;YAAC,KAAK;SAAK,CACzE,kBAAkB,OAAO;oBAAE;QAAO,GAAG;QAEvC,MAAM,eAAe,gBAAgB;QAErC,MAAM,WAAW,MAAM,CAAA,GAAA,8BAAO,EAAE,KAAK;QAErC,MAAM,SAAS,CAAA,GAAA,2CAAa,EAAE,SAAS;QACvC,aAAa;qBAAE;sBAAS;oBAAU;QAAO;QAEzC,OAAO;IACT;AACF","sources":["packages/api/rpc/src/index.ts","packages/api/rpc/src/trackedFetchRpcFactory.ts"],"sourcesContent":["export * from './trackedFetchRpcFactory'\n","import { Registry } from 'prom-client'\nimport { FetchRpc, fetchRpc } from '@lidofinance/rpc'\nimport { rpcMetricsFactory, getProviderLabel, getStatusLabel } from '@lidofinance/api-metrics'\n\nexport type TrackedFetchRpcFactoryParameters = {\n prefix: string\n registry: Registry\n}\n\nexport type TrackedFetchRPC = FetchRpc<{ chainId: string | number }>\n\nexport const trackedFetchRpcFactory = ({ prefix, registry }: TrackedFetchRpcFactoryParameters): TrackedFetchRPC => {\n const { rpcRequestCount, rpcRequestMethods, rpcResponseTime } = rpcMetricsFactory(prefix, registry)\n\n return async (url, init, { chainId }) => {\n const provider = getProviderLabel(url)\n\n rpcRequestCount.labels({ chainId, provider }).inc()\n for (const { method } of Array.isArray(init.body) ? init.body : [init.body]) {\n rpcRequestMethods.labels({ method }).inc()\n }\n const responseTime = rpcResponseTime.startTimer()\n\n const response = await fetchRpc(url, init)\n\n const status = getStatusLabel(response.status)\n responseTime({ chainId, provider, status })\n\n return response\n }\n}\n"],"names":[],"version":3,"file":"index.cjs.map","sourceRoot":"../../../../"}
|
package/dist/index.mjs
CHANGED
|
@@ -9,15 +9,15 @@ var $a3758ff406a352af$exports = {};
|
|
|
9
9
|
$parcel$export($a3758ff406a352af$exports, "trackedFetchRpcFactory", () => $a3758ff406a352af$export$78b2eac677e7bce5);
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
const $a3758ff406a352af$export$78b2eac677e7bce5 = ({ prefix: prefix
|
|
13
|
-
const { rpcRequestCount: rpcRequestCount
|
|
14
|
-
return async (url, init, { chainId: chainId
|
|
12
|
+
const $a3758ff406a352af$export$78b2eac677e7bce5 = ({ prefix: prefix, registry: registry })=>{
|
|
13
|
+
const { rpcRequestCount: rpcRequestCount, rpcRequestMethods: rpcRequestMethods, rpcResponseTime: rpcResponseTime } = (0, $1xKrC$rpcMetricsFactory)(prefix, registry);
|
|
14
|
+
return async (url, init, { chainId: chainId })=>{
|
|
15
15
|
const provider = (0, $1xKrC$getProviderLabel)(url);
|
|
16
16
|
rpcRequestCount.labels({
|
|
17
17
|
chainId: chainId,
|
|
18
18
|
provider: provider
|
|
19
19
|
}).inc();
|
|
20
|
-
for (const { method: method
|
|
20
|
+
for (const { method: method } of Array.isArray(init.body) ? init.body : [
|
|
21
21
|
init.body
|
|
22
22
|
])rpcRequestMethods.labels({
|
|
23
23
|
method: method
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;;;;;ACWO,MAAM,4CAAyB,CAAC,UAAE,MAAM,YAAE,QAAQ,EAAoC;IAC3F,MAAM,mBAAE,eAAe,qBAAE,iBAAiB,mBAAE,eAAe,EAAE,GAAG,CAAA,GAAA,wBAAgB,EAAE,QAAQ;IAE1F,OAAO,OAAO,KAAK,MAAM,WAAE,OAAO,EAAE;QAClC,MAAM,WAAW,CAAA,GAAA,uBAAe,EAAE;QAElC,gBAAgB,OAAO;qBAAE;sBAAS;QAAS,GAAG;QAC9C,KAAK,MAAM,UAAE,MAAM,EAAE,IAAI,MAAM,QAAQ,KAAK,QAAQ,KAAK,OAAO;YAAC,KAAK;SAAK,CACzE,kBAAkB,OAAO;oBAAE;QAAO,GAAG;QAEvC,MAAM,eAAe,gBAAgB;QAErC,MAAM,WAAW,MAAM,CAAA,GAAA,eAAO,EAAE,KAAK;QAErC,MAAM,SAAS,CAAA,GAAA,qBAAa,EAAE,SAAS;QACvC,aAAa;qBAAE;sBAAS;oBAAU;QAAO;QAEzC,OAAO;IACT;AACF","sources":["packages/api/rpc/src/index.ts","packages/api/rpc/src/trackedFetchRpcFactory.ts"],"sourcesContent":["export * from './trackedFetchRpcFactory'\n","import { Registry } from 'prom-client'\nimport { FetchRpc, fetchRpc } from '@lidofinance/rpc'\nimport { rpcMetricsFactory, getProviderLabel, getStatusLabel } from '@lidofinance/api-metrics'\n\nexport type TrackedFetchRpcFactoryParameters = {\n prefix: string\n registry: Registry\n}\n\nexport type TrackedFetchRPC = FetchRpc<{ chainId: string | number }>\n\nexport const trackedFetchRpcFactory = ({ prefix, registry }: TrackedFetchRpcFactoryParameters): TrackedFetchRPC => {\n const { rpcRequestCount, rpcRequestMethods, rpcResponseTime } = rpcMetricsFactory(prefix, registry)\n\n return async (url, init, { chainId }) => {\n const provider = getProviderLabel(url)\n\n rpcRequestCount.labels({ chainId, provider }).inc()\n for (const { method } of Array.isArray(init.body) ? init.body : [init.body]) {\n rpcRequestMethods.labels({ method }).inc()\n }\n const responseTime = rpcResponseTime.startTimer()\n\n const response = await fetchRpc(url, init)\n\n const status = getStatusLabel(response.status)\n responseTime({ chainId, provider, status })\n\n return response\n }\n}\n"],"names":[],"version":3,"file":"index.mjs.map","sourceRoot":"../../../../"}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "FetchRpc extension for api",
|
|
4
4
|
"repository": "git@github.com:lidofinance/warehouse.git",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.31.0",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist"
|
|
9
9
|
],
|
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
"types": "tsc --noEmit"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"@lidofinance/api-metrics": "~0.
|
|
25
|
-
"@lidofinance/rpc": "~0.
|
|
24
|
+
"@lidofinance/api-metrics": "~0.31.0",
|
|
25
|
+
"@lidofinance/rpc": "~0.31.0",
|
|
26
26
|
"prom-client": "^14.0.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@lidofinance/api-metrics": "~0.
|
|
30
|
-
"@lidofinance/config-prettier": "~0.
|
|
31
|
-
"@lidofinance/rpc": "~0.
|
|
29
|
+
"@lidofinance/api-metrics": "~0.31.0",
|
|
30
|
+
"@lidofinance/config-prettier": "~0.31.0",
|
|
31
|
+
"@lidofinance/rpc": "~0.31.0",
|
|
32
32
|
"prom-client": "^14.1.0"
|
|
33
33
|
}
|
|
34
34
|
}
|