@sentio/sdk 2.18.1-rc.3 → 2.18.1-rc.5
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/lib/utils/call.d.ts +5 -0
- package/lib/utils/call.js +17 -0
- package/lib/utils/call.js.map +1 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +1 -0
- package/lib/utils/index.js.map +1 -1
- package/package.json +3 -3
- package/src/utils/call.ts +15 -0
- package/src/utils/index.ts +1 -0
@@ -0,0 +1,17 @@
|
|
1
|
+
/**
|
2
|
+
* ignore eth call exception and return undefined if that happened
|
3
|
+
* @param call
|
4
|
+
*/
|
5
|
+
export async function ethCallIgnoreException(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
|
+
//# sourceMappingURL=call.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"call.js","sourceRoot":"","sources":["../../src/utils/call.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAM,IAAwB;IACxE,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 */\nexport async function ethCallIgnoreException<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/lib/utils/index.d.ts
CHANGED
package/lib/utils/index.js
CHANGED
package/lib/utils/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AACnC,cAAc,gBAAgB,CAAA;AAC9B,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA","sourcesContent":["export * from './conversion.js'\nexport * as token from './token.js'\nexport * from './dex-price.js'\nexport { getPriceByType, getPriceClient, getPriceBySymbol } from './price.js'\n"]}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AACnC,cAAc,gBAAgB,CAAA;AAC9B,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAC7E,cAAc,WAAW,CAAA","sourcesContent":["export * from './conversion.js'\nexport * as token from './token.js'\nexport * from './dex-price.js'\nexport { getPriceByType, getPriceClient, getPriceBySymbol } from './price.js'\nexport * from './call.js'\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.5",
|
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.5",
|
75
|
+
"@sentio/runtime": "^2.18.1-rc.5"
|
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
|
+
export async function ethCallIgnoreException<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
|
+
}
|
package/src/utils/index.ts
CHANGED