@defillama/sdk 5.0.9 → 5.0.11

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.
@@ -1,33 +1,13 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
14
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
15
- if (ar || !(i in from)) {
16
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
17
- ar[i] = from[i];
18
- }
19
- }
20
- return to.concat(ar || Array.prototype.slice.call(from));
21
- };
22
2
  Object.defineProperty(exports, "__esModule", { value: true });
23
3
  function isNumberOrBigNumber(value) {
24
4
  return typeof value === 'bigint' || typeof value === "number";
25
5
  }
26
6
  function stringifyBigNumbers(result) {
27
- var final = __assign({}, result);
7
+ let final = { ...result };
28
8
  if (Array.isArray(result))
29
- final = __spreadArray([], result, true);
30
- Object.keys(result).forEach(function (key) {
9
+ final = [...result];
10
+ Object.keys(result).forEach((key) => {
31
11
  if (isNumberOrBigNumber(result[key]))
32
12
  final[key] = result[key].toString();
33
13
  else if (typeof result[key] === "object")
@@ -38,15 +18,15 @@ function stringifyBigNumbers(result) {
38
18
  return final;
39
19
  }
40
20
  function default_1(results, functionABI) {
41
- var response;
21
+ let response;
42
22
  if (typeof results === "string" || typeof results === "boolean")
43
23
  return results;
44
24
  if (isNumberOrBigNumber(results))
45
25
  return results.toString();
46
26
  response = stringifyBigNumbers(results);
47
27
  if (functionABI && functionABI.outputs) {
48
- var outputNames = functionABI.outputs.map(function (i) { return i.name; });
49
- outputNames.map(function (name, i) {
28
+ const outputNames = functionABI.outputs.map((i) => i.name);
29
+ outputNames.map((name, i) => {
50
30
  setComponentDetails(response[i], functionABI.outputs[i]);
51
31
  if (name)
52
32
  response[name] = response[i];
@@ -64,10 +44,10 @@ function setComponentDetails(component, componentDefinition) {
64
44
  if (componentDefinition.type === "tuple")
65
45
  return setDetails(component);
66
46
  function setDetails(value) {
67
- var definitions = componentDefinition.components || componentDefinition.arrayChildren.components;
68
- definitions.map(function (def, i) {
47
+ const definitions = componentDefinition.components || componentDefinition.arrayChildren.components;
48
+ definitions.map((def, i) => {
69
49
  setComponentDetails(value[i], def);
70
- var name = def.name;
50
+ const name = def.name;
71
51
  if (name)
72
52
  value[name] = value[i];
73
53
  });