essential-eth 0.9.1-next.0 → 0.9.1-next.1

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.
Files changed (104) hide show
  1. package/dist/cjs/classes/Contract.js +66 -311
  2. package/dist/cjs/classes/test/Contract/crv-abi.js +256 -252
  3. package/dist/cjs/classes/test/Contract/ens-abi.js +212 -497
  4. package/dist/cjs/classes/test/Contract/fei-abi.js +284 -605
  5. package/dist/cjs/classes/test/Contract/foo-abi.js +21 -44
  6. package/dist/cjs/classes/test/Contract/uniswap-abi.js +68 -64
  7. package/dist/cjs/classes/utils/clean-block.js +30 -52
  8. package/dist/cjs/classes/utils/clean-log.js +20 -42
  9. package/dist/cjs/classes/utils/clean-transaction-receipt.js +30 -51
  10. package/dist/cjs/classes/utils/clean-transaction.js +30 -52
  11. package/dist/cjs/classes/utils/encode-decode-transaction.js +107 -148
  12. package/dist/cjs/classes/utils/fetchers.js +44 -166
  13. package/dist/cjs/classes/utils/hex-to-decimal.js +6 -1
  14. package/dist/cjs/classes/utils/prepare-transaction.js +36 -59
  15. package/dist/cjs/index.js +56 -25
  16. package/dist/cjs/index.umd.js +1 -1
  17. package/dist/cjs/index.umd.js.map +1 -1
  18. package/dist/cjs/logger/logger.js +29 -123
  19. package/dist/cjs/logger/package-version.d.ts +1 -1
  20. package/dist/cjs/logger/package-version.js +4 -1
  21. package/dist/cjs/providers/AlchemyProvider.js +9 -82
  22. package/dist/cjs/providers/BaseProvider.js +520 -958
  23. package/dist/cjs/providers/FallthroughProvider.js +47 -156
  24. package/dist/cjs/providers/JsonRpcProvider.js +28 -114
  25. package/dist/cjs/providers/test/json-rpc-provider/get-logs/mocks.js +104 -101
  26. package/dist/cjs/providers/test/mock-of.js +6 -3
  27. package/dist/cjs/providers/test/rpc-urls.js +23 -15
  28. package/dist/cjs/providers/utils/chains-info.js +3 -1
  29. package/dist/cjs/shared/tiny-big/helpers.js +42 -93
  30. package/dist/cjs/shared/tiny-big/tiny-big.js +81 -210
  31. package/dist/cjs/shared/validate-type.js +7 -7
  32. package/dist/cjs/types/Block.types.js +2 -1
  33. package/dist/cjs/types/Contract.types.js +2 -1
  34. package/dist/cjs/types/FeeData.types.js +2 -1
  35. package/dist/cjs/types/Filter.types.js +2 -1
  36. package/dist/cjs/types/Network.types.js +2 -3
  37. package/dist/cjs/types/Transaction.types.js +2 -1
  38. package/dist/cjs/utils/bytes.js +318 -286
  39. package/dist/cjs/utils/compute-address.js +15 -8
  40. package/dist/cjs/utils/compute-public-key.js +10 -5
  41. package/dist/cjs/utils/ether-to-gwei.js +11 -10
  42. package/dist/cjs/utils/ether-to-wei.js +11 -10
  43. package/dist/cjs/utils/gwei-to-ether.js +11 -10
  44. package/dist/cjs/utils/hash-message.js +16 -11
  45. package/dist/cjs/utils/is-address.js +12 -8
  46. package/dist/cjs/utils/keccak256.js +14 -8
  47. package/dist/cjs/utils/solidity-keccak256.js +60 -49
  48. package/dist/cjs/utils/split-signature.js +73 -55
  49. package/dist/cjs/utils/to-checksum-address.js +20 -15
  50. package/dist/cjs/utils/to-utf8-bytes.js +6 -1
  51. package/dist/cjs/utils/wei-to-ether.js +15 -13
  52. package/dist/esm/logger/package-version.d.ts +1 -1
  53. package/dist/esm/logger/package-version.js +1 -1
  54. package/package.json +2 -2
  55. package/readme.md +1 -1
  56. package/dist/cjs/classes/test/Contract/crv.test.js +0 -497
  57. package/dist/cjs/classes/test/Contract/ens.test.js +0 -160
  58. package/dist/cjs/classes/test/Contract/fei.test.js +0 -224
  59. package/dist/cjs/classes/test/Contract/foo.test.js +0 -33
  60. package/dist/cjs/classes/test/Contract/uni.test.js +0 -289
  61. package/dist/cjs/providers/test/fallthrough-provider/get-gas-price.test.js +0 -228
  62. package/dist/cjs/providers/test/get-transaction-count.test.js +0 -239
  63. package/dist/cjs/providers/test/json-rpc-provider/call.test.js +0 -375
  64. package/dist/cjs/providers/test/json-rpc-provider/estimate-gas.test.js +0 -217
  65. package/dist/cjs/providers/test/json-rpc-provider/get-balance.test.js +0 -223
  66. package/dist/cjs/providers/test/json-rpc-provider/get-block-number.test.js +0 -163
  67. package/dist/cjs/providers/test/json-rpc-provider/get-block.test.js +0 -414
  68. package/dist/cjs/providers/test/json-rpc-provider/get-code.test.js +0 -282
  69. package/dist/cjs/providers/test/json-rpc-provider/get-fee-data.test.js +0 -187
  70. package/dist/cjs/providers/test/json-rpc-provider/get-gas-price.test.js +0 -167
  71. package/dist/cjs/providers/test/json-rpc-provider/get-logs/get-logs.test.js +0 -219
  72. package/dist/cjs/providers/test/json-rpc-provider/get-network.test.js +0 -232
  73. package/dist/cjs/providers/test/json-rpc-provider/get-transaction-receipt.test.js +0 -280
  74. package/dist/cjs/providers/test/json-rpc-provider/get-transaction.test.js +0 -266
  75. package/dist/cjs/providers/test/test-alchemy-provider.test.js +0 -151
  76. package/dist/cjs/shared/tiny-big/helpers.test.js +0 -29
  77. package/dist/cjs/shared/tiny-big/tiny-big.test.js +0 -34
  78. package/dist/cjs/utils/tests/bytes/arrayify.test.js +0 -64
  79. package/dist/cjs/utils/tests/bytes/concat.test.js +0 -17
  80. package/dist/cjs/utils/tests/bytes/hex-concat.test.js +0 -65
  81. package/dist/cjs/utils/tests/bytes/hex-data-length.test.js +0 -66
  82. package/dist/cjs/utils/tests/bytes/hex-data-slice.test.js +0 -51
  83. package/dist/cjs/utils/tests/bytes/hex-strip-zeros.test.js +0 -75
  84. package/dist/cjs/utils/tests/bytes/hex-value.test.js +0 -141
  85. package/dist/cjs/utils/tests/bytes/hex-zero-pad.test.js +0 -100
  86. package/dist/cjs/utils/tests/bytes/hexlify.test.js +0 -78
  87. package/dist/cjs/utils/tests/bytes/is-bytes-like.test.js +0 -68
  88. package/dist/cjs/utils/tests/bytes/is-bytes.test.js +0 -76
  89. package/dist/cjs/utils/tests/bytes/is-hex-string.test.js +0 -97
  90. package/dist/cjs/utils/tests/bytes/strip-zeros.test.js +0 -106
  91. package/dist/cjs/utils/tests/bytes/zero-pad.test.js +0 -144
  92. package/dist/cjs/utils/tests/compute-address.test.js +0 -49
  93. package/dist/cjs/utils/tests/compute-public-key.test.js +0 -26
  94. package/dist/cjs/utils/tests/ether-to-gwei.test.js +0 -26
  95. package/dist/cjs/utils/tests/ether-to-wei.test.js +0 -36
  96. package/dist/cjs/utils/tests/gwei-to-ether.test.js +0 -28
  97. package/dist/cjs/utils/tests/hash-message.test.js +0 -32
  98. package/dist/cjs/utils/tests/is-address.test.js +0 -48
  99. package/dist/cjs/utils/tests/keccak256.test.js +0 -121
  100. package/dist/cjs/utils/tests/solidity-keccak256.test.js +0 -311
  101. package/dist/cjs/utils/tests/split-signature.test.js +0 -46
  102. package/dist/cjs/utils/tests/to-checksum-address.test.js +0 -39
  103. package/dist/cjs/utils/tests/to-utf8-bytes.test.js +0 -34
  104. package/dist/cjs/utils/tests/wei-to-ether.test.js +0 -41
@@ -1,5 +1,8 @@
1
- import { Keccak } from "sha3";
2
- import { validateType } from "../shared/validate-type";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toChecksumAddress = void 0;
4
+ const sha3_1 = require("sha3");
5
+ const validate_type_1 = require("../shared/validate-type");
3
6
  /**
4
7
  * Returns an Ethereum address in proper mixed-case checksum.
5
8
  * Does NOT support ICAP
@@ -15,27 +18,29 @@ import { validateType } from "../shared/validate-type";
15
18
  * Similar to ["getAddress" in ethers.js](https://docs.ethers.io/v5/api/utils/address/#utils-getAddress)
16
19
  *
17
20
  * Similar to ["toChecksumAddress" in web3.js](https://web3js.readthedocs.io/en/v1.7.1/web3-utils.html#tochecksumaddress)
18
- */ export function toChecksumAddress(address) {
19
- validateType(address, [
20
- "string"
21
- ]);
21
+ */
22
+ function toChecksumAddress(address) {
23
+ (0, validate_type_1.validateType)(address, ['string']);
22
24
  if (!/^(0x)?[0-9a-f]{40}$/i.test(address)) {
23
- throw new Error('Invalid Ethereum address "'.concat(address, '"'));
25
+ throw new Error(`Invalid Ethereum address "${address}"`);
24
26
  }
25
- var _address = address.toLowerCase().replace(/^0x/i, "");
26
- var keccak = new Keccak(256);
27
- var addressHash = keccak.update(_address).digest("hex").replace(/^0x/i, "");
28
- var checksumAddress = "0x";
29
- for(var i = 0; i < _address.length; i++){
27
+ const _address = address.toLowerCase().replace(/^0x/i, '');
28
+ const keccak = new sha3_1.Keccak(256);
29
+ const addressHash = keccak.update(_address).digest('hex').replace(/^0x/i, '');
30
+ let checksumAddress = '0x';
31
+ for (let i = 0; i < _address.length; i++) {
30
32
  // If ith character is 8 to f then make it uppercase
31
33
  if (parseInt(addressHash[i], 16) > 7) {
32
34
  checksumAddress += _address[i].toUpperCase();
33
- } else {
35
+ }
36
+ else {
34
37
  checksumAddress += _address[i];
35
38
  }
36
39
  }
37
- if (address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) && checksumAddress !== address) {
38
- throw new Error('Invalid Checksum address for "'.concat(address, '"'));
40
+ if (address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) &&
41
+ checksumAddress !== address) {
42
+ throw new Error(`Invalid Checksum address for "${address}"`);
39
43
  }
40
44
  return checksumAddress;
41
45
  }
46
+ exports.toChecksumAddress = toChecksumAddress;
@@ -1,3 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toUtf8Bytes = void 0;
1
4
  /**
2
5
  * Converts a string into a UTF-8 Byte Array
3
6
  *
@@ -11,6 +14,8 @@
11
14
  * toUtf8Bytes('ethereum');
12
15
  * // Uint8Array { [Iterator] 0: 101, 1: 116, 2: 104, 3: 101, 4: 114, 5: 101, 6: 117, 7: 109 }
13
16
  * ```
14
- */ export function toUtf8Bytes(data) {
17
+ */
18
+ function toUtf8Bytes(data) {
15
19
  return new Uint8Array(Buffer.from(data));
16
20
  }
21
+ exports.toUtf8Bytes = toUtf8Bytes;
@@ -1,5 +1,8 @@
1
- import { tinyBig } from "../shared/tiny-big/tiny-big";
2
- import { validateType } from "../shared/validate-type";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.weiToEther = void 0;
4
+ const tiny_big_1 = require("../shared/tiny-big/tiny-big");
5
+ const validate_type_1 = require("../shared/validate-type");
3
6
  /**
4
7
  * Convert from Wei to Ether
5
8
  *
@@ -23,21 +26,20 @@ import { validateType } from "../shared/validate-type";
23
26
  * weiToEther(1000000000000000000000).toNumber()
24
27
  * // 1000
25
28
  * ```
26
- */ export function weiToEther(weiQuantity) {
27
- validateType(weiQuantity, [
28
- "string",
29
- "number",
30
- "object"
31
- ]);
29
+ */
30
+ function weiToEther(weiQuantity) {
31
+ (0, validate_type_1.validateType)(weiQuantity, ['string', 'number', 'object']);
32
32
  // eslint-disable-next-line no-useless-catch
33
33
  try {
34
- var _weiQuantity = weiQuantity;
35
- if (typeof weiQuantity === "string" && weiQuantity.slice(0, 2) === "0x") {
34
+ let _weiQuantity = weiQuantity;
35
+ if (typeof weiQuantity === 'string' && weiQuantity.slice(0, 2) === '0x') {
36
36
  _weiQuantity = BigInt(weiQuantity).toString();
37
37
  }
38
- var result = tinyBig(_weiQuantity).div("1000000000000000000");
39
- return tinyBig(result);
40
- } catch (error) {
38
+ const result = (0, tiny_big_1.tinyBig)(_weiQuantity).div('1000000000000000000');
39
+ return (0, tiny_big_1.tinyBig)(result);
40
+ }
41
+ catch (error) {
41
42
  throw error;
42
43
  }
43
44
  }
45
+ exports.weiToEther = weiToEther;
@@ -1 +1 @@
1
- export declare const version = "0.9.1-next.0";
1
+ export declare const version = "0.9.1-next.1";
@@ -1 +1 @@
1
- export const version = '0.9.1-next.0';
1
+ export const version = '0.9.1-next.1';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "essential-eth",
3
3
  "description": "Ultralight JS for Ethereum",
4
- "version": "0.9.1-next.0",
4
+ "version": "0.9.1-next.1",
5
5
  "license": "MIT",
6
6
  "sideEffects": false,
7
7
  "private": false,
@@ -26,7 +26,7 @@
26
26
  "compile": "npm-run-all --parallel build:esm build:cjs build:umd",
27
27
  "build": "rm -rf dist && npm run compile",
28
28
  "build:esm": "tsc -p tsconfig.json",
29
- "build:cjs": "swc src -d dist/cjs",
29
+ "build:cjs": "tsc -p tsconfig-cjs.json",
30
30
  "build:umd": "microbundle --external none --format umd",
31
31
  "build:readme": "bash ./scripts/markdown-magic/build-readme.sh",
32
32
  "jest": "jest",
package/readme.md CHANGED
@@ -126,7 +126,7 @@ Browsers:
126
126
 
127
127
  ```html
128
128
  <!-- index.html -->
129
- <script src="https://unpkg.com/essential-eth@0.9.1-next.0"></script>
129
+ <script src="https://unpkg.com/essential-eth@0.9.1-next.1"></script>
130
130
  ```
131
131
 
132
132
  <!-- ⛔️ AUTO-GENERATED-CONTENT:END (UNPKG_SCRIPT_TAG) -->
@@ -1,497 +0,0 @@
1
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
2
- try {
3
- var info = gen[key](arg);
4
- var value = info.value;
5
- } catch (error) {
6
- reject(error);
7
- return;
8
- }
9
- if (info.done) {
10
- resolve(value);
11
- } else {
12
- Promise.resolve(value).then(_next, _throw);
13
- }
14
- }
15
- function _async_to_generator(fn) {
16
- return function() {
17
- var self = this, args = arguments;
18
- return new Promise(function(resolve, reject) {
19
- var gen = fn.apply(self, args);
20
- function _next(value) {
21
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
22
- }
23
- function _throw(err) {
24
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
25
- }
26
- _next(undefined);
27
- });
28
- };
29
- }
30
- function _ts_generator(thisArg, body) {
31
- var f, y, t, g, _ = {
32
- label: 0,
33
- sent: function() {
34
- if (t[0] & 1) throw t[1];
35
- return t[1];
36
- },
37
- trys: [],
38
- ops: []
39
- };
40
- return g = {
41
- next: verb(0),
42
- "throw": verb(1),
43
- "return": verb(2)
44
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
45
- return this;
46
- }), g;
47
- function verb(n) {
48
- return function(v) {
49
- return step([
50
- n,
51
- v
52
- ]);
53
- };
54
- }
55
- function step(op) {
56
- if (f) throw new TypeError("Generator is already executing.");
57
- while(_)try {
58
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
59
- if (y = 0, t) op = [
60
- op[0] & 2,
61
- t.value
62
- ];
63
- switch(op[0]){
64
- case 0:
65
- case 1:
66
- t = op;
67
- break;
68
- case 4:
69
- _.label++;
70
- return {
71
- value: op[1],
72
- done: false
73
- };
74
- case 5:
75
- _.label++;
76
- y = op[1];
77
- op = [
78
- 0
79
- ];
80
- continue;
81
- case 7:
82
- op = _.ops.pop();
83
- _.trys.pop();
84
- continue;
85
- default:
86
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
87
- _ = 0;
88
- continue;
89
- }
90
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
91
- _.label = op[1];
92
- break;
93
- }
94
- if (op[0] === 6 && _.label < t[1]) {
95
- _.label = t[1];
96
- t = op;
97
- break;
98
- }
99
- if (t && _.label < t[2]) {
100
- _.label = t[2];
101
- _.ops.push(op);
102
- break;
103
- }
104
- if (t[2]) _.ops.pop();
105
- _.trys.pop();
106
- continue;
107
- }
108
- op = body.call(thisArg, _);
109
- } catch (e) {
110
- op = [
111
- 6,
112
- e
113
- ];
114
- y = 0;
115
- } finally{
116
- f = t = 0;
117
- }
118
- if (op[0] & 5) throw op[1];
119
- return {
120
- value: op[0] ? op[1] : void 0,
121
- done: true
122
- };
123
- }
124
- }
125
- import { JsonRpcProvider } from "../../../index";
126
- import { rpcUrls } from "../../../providers/test/rpc-urls";
127
- import { Contract as EssentialEthContract } from "../../Contract";
128
- import { abi } from "./crv-abi";
129
- // The JSONABI
130
- var JSONABI = abi;
131
- var rpcURL = rpcUrls.mainnet;
132
- var essentialEthProvider = new JsonRpcProvider(rpcURL);
133
- // https://etherscan.io/address/0x575CCD8e2D300e2377B43478339E364000318E2c
134
- var contractAddress = "0x575CCD8e2D300e2377B43478339E364000318E2c";
135
- var essentialEthContract = new EssentialEthContract(contractAddress, JSONABI, essentialEthProvider);
136
- describe("cRV contract", function() {
137
- var address = "0xf8cd644baf494d13406187cf8628754dca0a10c2";
138
- it('should fetch "uint256" balanceOf', /*#__PURE__*/ _async_to_generator(function() {
139
- var balanceOf;
140
- return _ts_generator(this, function(_state) {
141
- switch(_state.label){
142
- case 0:
143
- return [
144
- 4,
145
- essentialEthContract.balanceOf(address, {
146
- gasLimit: 40955
147
- })
148
- ];
149
- case 1:
150
- balanceOf = _state.sent();
151
- expect(balanceOf.toString()).toBe("6684485761284788581");
152
- return [
153
- 2
154
- ];
155
- }
156
- });
157
- }));
158
- it('should fetch "uint256" total_claimed', /*#__PURE__*/ _async_to_generator(function() {
159
- var totalClaimed;
160
- return _ts_generator(this, function(_state) {
161
- switch(_state.label){
162
- case 0:
163
- return [
164
- 4,
165
- essentialEthContract.total_claimed(address, {})
166
- ];
167
- case 1:
168
- totalClaimed = _state.sent();
169
- expect(totalClaimed.toString()).toBe("0");
170
- expect(totalClaimed.toNumber()).toBe(0);
171
- return [
172
- 2
173
- ];
174
- }
175
- });
176
- }));
177
- it('should fetch "uint256" vested supply', /*#__PURE__*/ _async_to_generator(function() {
178
- var vestedSupply;
179
- return _ts_generator(this, function(_state) {
180
- switch(_state.label){
181
- case 0:
182
- return [
183
- 4,
184
- essentialEthContract.vestedSupply({
185
- gasLimit: 40955
186
- })
187
- ];
188
- case 1:
189
- vestedSupply = _state.sent();
190
- expect(vestedSupply.toString()).toBe("151515151515151515151515151");
191
- return [
192
- 2
193
- ];
194
- }
195
- });
196
- }));
197
- it('should fetch "uint256" locked supply', /*#__PURE__*/ _async_to_generator(function() {
198
- var lockedSupply;
199
- return _ts_generator(this, function(_state) {
200
- switch(_state.label){
201
- case 0:
202
- return [
203
- 4,
204
- essentialEthContract.lockedSupply({
205
- gasLimit: 40955
206
- })
207
- ];
208
- case 1:
209
- lockedSupply = _state.sent();
210
- expect(lockedSupply.toString()).toBe("0");
211
- return [
212
- 2
213
- ];
214
- }
215
- });
216
- }));
217
- it('should fetch "uint256" vested of', /*#__PURE__*/ _async_to_generator(function() {
218
- var vestedOf;
219
- return _ts_generator(this, function(_state) {
220
- switch(_state.label){
221
- case 0:
222
- return [
223
- 4,
224
- essentialEthContract.vestedOf(address, {
225
- gasLimit: 40955
226
- })
227
- ];
228
- case 1:
229
- vestedOf = _state.sent();
230
- expect(vestedOf.toString()).toBe("6684485761284788581");
231
- return [
232
- 2
233
- ];
234
- }
235
- });
236
- }));
237
- it('should fetch "uint256" lockedOf', /*#__PURE__*/ _async_to_generator(function() {
238
- var lockedOf;
239
- return _ts_generator(this, function(_state) {
240
- switch(_state.label){
241
- case 0:
242
- return [
243
- 4,
244
- essentialEthContract.lockedOf(address, {
245
- gasLimit: 40955
246
- })
247
- ];
248
- case 1:
249
- lockedOf = _state.sent();
250
- expect(lockedOf.toString()).toBe("0");
251
- return [
252
- 2
253
- ];
254
- }
255
- });
256
- }));
257
- it('should fetch "address" token', /*#__PURE__*/ _async_to_generator(function() {
258
- var token;
259
- return _ts_generator(this, function(_state) {
260
- switch(_state.label){
261
- case 0:
262
- return [
263
- 4,
264
- essentialEthContract.token({
265
- gasLimit: 40955
266
- })
267
- ];
268
- case 1:
269
- token = _state.sent();
270
- expect(token).toBe("0xD533a949740bb3306d119CC777fa900bA034cd52");
271
- return [
272
- 2
273
- ];
274
- }
275
- });
276
- }));
277
- it('should fetch "uint256" start_time', /*#__PURE__*/ _async_to_generator(function() {
278
- var startTime;
279
- return _ts_generator(this, function(_state) {
280
- switch(_state.label){
281
- case 0:
282
- return [
283
- 4,
284
- essentialEthContract.start_time({
285
- gasLimit: 40955
286
- })
287
- ];
288
- case 1:
289
- startTime = _state.sent();
290
- expect(startTime.toString()).toBe("1597357048");
291
- return [
292
- 2
293
- ];
294
- }
295
- });
296
- }));
297
- it('should fetch "uint256" end_time', /*#__PURE__*/ _async_to_generator(function() {
298
- var endTime;
299
- return _ts_generator(this, function(_state) {
300
- switch(_state.label){
301
- case 0:
302
- return [
303
- 4,
304
- essentialEthContract.end_time({
305
- gasLimit: 40955
306
- })
307
- ];
308
- case 1:
309
- endTime = _state.sent();
310
- expect(endTime.toString()).toBe("1628893048");
311
- return [
312
- 2
313
- ];
314
- }
315
- });
316
- }));
317
- it('should fetch "uint256" initial_locked', /*#__PURE__*/ _async_to_generator(function() {
318
- var initialLocked;
319
- return _ts_generator(this, function(_state) {
320
- switch(_state.label){
321
- case 0:
322
- return [
323
- 4,
324
- essentialEthContract.initial_locked(address, {
325
- gasLimit: 40955
326
- })
327
- ];
328
- case 1:
329
- initialLocked = _state.sent();
330
- expect(initialLocked.toString()).toBe("6684485761284788581");
331
- return [
332
- 2
333
- ];
334
- }
335
- });
336
- }));
337
- it('should fetch "uint256" initial_locked_supply', /*#__PURE__*/ _async_to_generator(function() {
338
- var initialLockedSupply;
339
- return _ts_generator(this, function(_state) {
340
- switch(_state.label){
341
- case 0:
342
- return [
343
- 4,
344
- essentialEthContract.initial_locked_supply({
345
- gasLimit: 40955
346
- })
347
- ];
348
- case 1:
349
- initialLockedSupply = _state.sent();
350
- expect(initialLockedSupply.toString()).toBe("151515151515151515151515151");
351
- return [
352
- 2
353
- ];
354
- }
355
- });
356
- }));
357
- it('should fetch "uint256" unallocated_supply', /*#__PURE__*/ _async_to_generator(function() {
358
- var unallocatedSupply;
359
- return _ts_generator(this, function(_state) {
360
- switch(_state.label){
361
- case 0:
362
- return [
363
- 4,
364
- essentialEthContract.unallocated_supply({
365
- gasLimit: 40955
366
- })
367
- ];
368
- case 1:
369
- unallocatedSupply = _state.sent();
370
- expect(unallocatedSupply.toString()).toBe("0");
371
- return [
372
- 2
373
- ];
374
- }
375
- });
376
- }));
377
- it('should fetch "bool" can_disable', /*#__PURE__*/ _async_to_generator(function() {
378
- var canDisable;
379
- return _ts_generator(this, function(_state) {
380
- switch(_state.label){
381
- case 0:
382
- return [
383
- 4,
384
- essentialEthContract.can_disable({
385
- gasLimit: 40955
386
- })
387
- ];
388
- case 1:
389
- canDisable = _state.sent();
390
- expect(canDisable).toBe(false);
391
- return [
392
- 2
393
- ];
394
- }
395
- });
396
- }));
397
- it('should fetch "uint256" disabled_at', /*#__PURE__*/ _async_to_generator(function() {
398
- var disabledAt;
399
- return _ts_generator(this, function(_state) {
400
- switch(_state.label){
401
- case 0:
402
- return [
403
- 4,
404
- essentialEthContract.disabled_at(address, {
405
- gasLimit: 40955
406
- })
407
- ];
408
- case 1:
409
- disabledAt = _state.sent();
410
- expect(disabledAt.toString()).toBe("0");
411
- return [
412
- 2
413
- ];
414
- }
415
- });
416
- }));
417
- it('should fetch "address" admin', /*#__PURE__*/ _async_to_generator(function() {
418
- var admin;
419
- return _ts_generator(this, function(_state) {
420
- switch(_state.label){
421
- case 0:
422
- return [
423
- 4,
424
- essentialEthContract.admin({
425
- gasLimit: 40955
426
- })
427
- ];
428
- case 1:
429
- admin = _state.sent();
430
- expect(admin).toBe("0x00000000000000000000000000000010B57e6da0");
431
- return [
432
- 2
433
- ];
434
- }
435
- });
436
- }));
437
- it('should fetch "address" future_admin', /*#__PURE__*/ _async_to_generator(function() {
438
- var futureAdmin;
439
- return _ts_generator(this, function(_state) {
440
- switch(_state.label){
441
- case 0:
442
- return [
443
- 4,
444
- essentialEthContract.future_admin({
445
- gasLimit: 40955
446
- })
447
- ];
448
- case 1:
449
- futureAdmin = _state.sent();
450
- expect(futureAdmin).toBe("0x00000000000000000000000000000010B57e6da0");
451
- return [
452
- 2
453
- ];
454
- }
455
- });
456
- }));
457
- it('should fetch "bool" fund_admins_enabled', /*#__PURE__*/ _async_to_generator(function() {
458
- var fundAdminsEnabled;
459
- return _ts_generator(this, function(_state) {
460
- switch(_state.label){
461
- case 0:
462
- return [
463
- 4,
464
- essentialEthContract.fund_admins_enabled({
465
- gasLimit: 40955
466
- })
467
- ];
468
- case 1:
469
- fundAdminsEnabled = _state.sent();
470
- expect(fundAdminsEnabled).toBe(false);
471
- return [
472
- 2
473
- ];
474
- }
475
- });
476
- }));
477
- it('should fetch "bool" fund_admins', /*#__PURE__*/ _async_to_generator(function() {
478
- var fundAdmins;
479
- return _ts_generator(this, function(_state) {
480
- switch(_state.label){
481
- case 0:
482
- return [
483
- 4,
484
- essentialEthContract.fund_admins(address, {
485
- gasLimit: 40955
486
- })
487
- ];
488
- case 1:
489
- fundAdmins = _state.sent();
490
- expect(fundAdmins).toBe(false);
491
- return [
492
- 2
493
- ];
494
- }
495
- });
496
- }));
497
- });