@sentio/sdk 2.18.1-rc.3 → 2.18.1-rc.4
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/utils/call.d.ts +1 -0
- package/lib/utils/call.js +18 -0
- package/lib/utils/call.js.map +1 -0
- package/package.json +3 -3
- package/src/utils/call.ts +15 -0
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,18 @@
|
|
1
|
+
/**
|
2
|
+
* ignore eth call exception and return undefined if that happened
|
3
|
+
* @param call
|
4
|
+
*/
|
5
|
+
async function ignoreCallException(call) {
|
6
|
+
try {
|
7
|
+
return await call();
|
8
|
+
}
|
9
|
+
catch (err) {
|
10
|
+
if (err.code === 'CALL_EXCEPTION') {
|
11
|
+
console.log('eth call exception, return undefined', err);
|
12
|
+
return undefined;
|
13
|
+
}
|
14
|
+
throw err;
|
15
|
+
}
|
16
|
+
}
|
17
|
+
export {};
|
18
|
+
//# sourceMappingURL=call.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"call.js","sourceRoot":"","sources":["../../src/utils/call.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,KAAK,UAAU,mBAAmB,CAAM,IAAwB;IAC9D,IAAI;QACF,OAAO,MAAM,IAAI,EAAE,CAAA;KACpB;IAAC,OAAO,GAAG,EAAE;QACZ,IAAI,GAAG,CAAC,IAAI,KAAK,gBAAgB,EAAE;YACjC,OAAO,CAAC,GAAG,CAAC,sCAAsC,EAAE,GAAG,CAAC,CAAA;YACxD,OAAO,SAAS,CAAA;SACjB;QACD,MAAM,GAAG,CAAA;KACV;AACH,CAAC","sourcesContent":["/**\n * ignore eth call exception and return undefined if that happened\n * @param call\n */\nasync function ignoreCallException<Res>(call: () => Promise<Res>): Promise<Res | undefined> {\n try {\n return await call()\n } catch (err) {\n if (err.code === 'CALL_EXCEPTION') {\n console.log('eth call exception, return undefined', err)\n return undefined\n }\n throw err\n }\n}\n"]}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@sentio/sdk",
|
3
|
-
"version": "2.18.1-rc.
|
3
|
+
"version": "2.18.1-rc.4",
|
4
4
|
"license": "Apache-2.0",
|
5
5
|
"type": "module",
|
6
6
|
"exports": {
|
@@ -71,8 +71,8 @@
|
|
71
71
|
"typedoc": "^0.24.1",
|
72
72
|
"utility-types": "^3.10.0",
|
73
73
|
"yaml": "^2.2.1",
|
74
|
-
"@sentio/protos": "2.18.1-rc.
|
75
|
-
"@sentio/runtime": "^2.18.1-rc.
|
74
|
+
"@sentio/protos": "2.18.1-rc.4",
|
75
|
+
"@sentio/runtime": "^2.18.1-rc.4"
|
76
76
|
},
|
77
77
|
"peerDependencies": {
|
78
78
|
"tsup": "npm:@sentio/tsup@^6.7.0"
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/**
|
2
|
+
* ignore eth call exception and return undefined if that happened
|
3
|
+
* @param call
|
4
|
+
*/
|
5
|
+
async function ignoreCallException<Res>(call: () => Promise<Res>): Promise<Res | undefined> {
|
6
|
+
try {
|
7
|
+
return await call()
|
8
|
+
} catch (err) {
|
9
|
+
if (err.code === 'CALL_EXCEPTION') {
|
10
|
+
console.log('eth call exception, return undefined', err)
|
11
|
+
return undefined
|
12
|
+
}
|
13
|
+
throw err
|
14
|
+
}
|
15
|
+
}
|