@defillama/sdk 3.0.17 → 3.0.18

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.
@@ -71,8 +71,11 @@ function resolveABI(providedAbi) {
71
71
  abi = cachedABIs_1.default[abi];
72
72
  if (abi === undefined) {
73
73
  var _a = providedAbi.split(':'), outputType = _a[0], name_1 = _a[1];
74
- if (!knownTypes.includes(outputType) || !name_1)
75
- throw new Error("ABI method undefined");
74
+ if (!knownTypes.includes(outputType) || !name_1) {
75
+ var contractInterface = new ethers_1.ethers.utils.Interface([providedAbi]);
76
+ var jsonAbi = contractInterface.format(ethers_1.ethers.utils.FormatTypes.json);
77
+ return JSON.parse(jsonAbi)[0];
78
+ }
76
79
  abi = {
77
80
  constant: true,
78
81
  inputs: [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defillama/sdk",
3
- "version": "3.0.17",
3
+ "version": "3.0.18",
4
4
  "description": "SDK for calculating TVL",
5
5
  "main": "build/index.js",
6
6
  "scripts": {