essential-eth 0.6.1 → 0.7.0

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 (112) hide show
  1. package/dist/cjs/classes/Contract.js +310 -71
  2. package/dist/cjs/classes/test/Contract/crv-abi.js +252 -256
  3. package/dist/cjs/classes/test/Contract/crv.test.js +690 -0
  4. package/dist/cjs/classes/test/Contract/ens-abi.js +497 -212
  5. package/dist/cjs/classes/test/Contract/ens.test.js +217 -0
  6. package/dist/cjs/classes/test/Contract/fei-abi.js +605 -284
  7. package/dist/cjs/classes/test/Contract/fei.test.js +224 -0
  8. package/dist/cjs/classes/test/Contract/foo-abi.js +44 -21
  9. package/dist/cjs/classes/test/Contract/foo.test.js +33 -0
  10. package/dist/cjs/classes/test/Contract/uni.test.js +387 -0
  11. package/dist/cjs/classes/test/Contract/uniswap-abi.js +64 -68
  12. package/dist/cjs/classes/utils/clean-block.d.ts +1 -2
  13. package/dist/cjs/classes/utils/clean-block.js +52 -30
  14. package/dist/cjs/classes/utils/clean-log.js +42 -20
  15. package/dist/cjs/classes/utils/clean-transaction-receipt.js +51 -29
  16. package/dist/cjs/classes/utils/clean-transaction.js +52 -29
  17. package/dist/cjs/classes/utils/encode-decode-transaction.d.ts +1 -1
  18. package/dist/cjs/classes/utils/encode-decode-transaction.js +163 -83
  19. package/dist/cjs/classes/utils/fetchers.js +169 -42
  20. package/dist/cjs/classes/utils/hex-to-decimal.js +1 -6
  21. package/dist/cjs/classes/utils/prepare-transaction.js +59 -36
  22. package/dist/cjs/index.js +25 -54
  23. package/dist/cjs/index.umd.js +1 -1
  24. package/dist/cjs/index.umd.js.map +1 -1
  25. package/dist/cjs/logger/logger.js +79 -23
  26. package/dist/cjs/logger/package-version.d.ts +1 -1
  27. package/dist/cjs/logger/package-version.js +1 -4
  28. package/dist/cjs/providers/BaseProvider.js +824 -475
  29. package/dist/cjs/providers/FallthroughProvider.js +118 -37
  30. package/dist/cjs/providers/JsonRpcProvider.js +93 -28
  31. package/dist/cjs/providers/test/fallthrough-provider/get-gas-price.test.js +228 -0
  32. package/dist/cjs/providers/test/get-transaction-count.test.js +276 -0
  33. package/dist/cjs/providers/test/json-rpc-provider/call.test.js +436 -0
  34. package/dist/cjs/providers/test/json-rpc-provider/estimate-gas.test.js +288 -0
  35. package/dist/cjs/providers/test/json-rpc-provider/get-balance.test.js +261 -0
  36. package/dist/cjs/providers/test/json-rpc-provider/get-block-number.test.js +230 -0
  37. package/dist/cjs/providers/test/json-rpc-provider/get-block.test.js +501 -0
  38. package/dist/cjs/providers/test/json-rpc-provider/get-code.test.js +311 -0
  39. package/dist/cjs/providers/test/json-rpc-provider/get-gas-price.test.js +202 -0
  40. package/dist/cjs/providers/test/json-rpc-provider/get-logs.test.js +361 -0
  41. package/dist/cjs/providers/test/json-rpc-provider/get-network.test.js +274 -0
  42. package/dist/cjs/providers/test/json-rpc-provider/get-transaction-receipt.test.js +301 -0
  43. package/dist/cjs/providers/test/json-rpc-provider/get-transaction.test.js +307 -0
  44. package/dist/cjs/providers/test/rpc-urls.js +9 -12
  45. package/dist/cjs/providers/utils/chains-info.js +1 -3
  46. package/dist/cjs/shared/tiny-big/helpers.js +93 -42
  47. package/dist/cjs/shared/tiny-big/helpers.test.js +29 -0
  48. package/dist/cjs/shared/tiny-big/tiny-big.js +161 -72
  49. package/dist/cjs/shared/tiny-big/tiny-big.test.js +34 -0
  50. package/dist/cjs/shared/validate-type.js +7 -7
  51. package/dist/cjs/types/Block.types.js +1 -2
  52. package/dist/cjs/types/Contract.types.js +1 -2
  53. package/dist/cjs/types/Filter.types.js +1 -2
  54. package/dist/cjs/types/Network.types.js +3 -2
  55. package/dist/cjs/types/Transaction.types.js +1 -2
  56. package/dist/cjs/utils/bytes.js +286 -318
  57. package/dist/cjs/utils/compute-address.js +8 -14
  58. package/dist/cjs/utils/compute-public-key.js +5 -10
  59. package/dist/cjs/utils/ether-to-gwei.js +10 -11
  60. package/dist/cjs/utils/ether-to-wei.js +10 -11
  61. package/dist/cjs/utils/gwei-to-ether.js +10 -11
  62. package/dist/cjs/utils/hash-message.d.ts +1 -1
  63. package/dist/cjs/utils/hash-message.js +11 -14
  64. package/dist/cjs/utils/is-address.js +8 -12
  65. package/dist/cjs/utils/keccak256.js +8 -14
  66. package/dist/cjs/utils/solidity-keccak256.js +49 -60
  67. package/dist/cjs/utils/split-signature.js +55 -73
  68. package/dist/cjs/utils/tests/bytes/arrayify.test.js +40 -0
  69. package/dist/cjs/utils/tests/bytes/concat.test.js +15 -0
  70. package/dist/cjs/utils/tests/bytes/hex-concat.test.js +63 -0
  71. package/dist/cjs/utils/tests/bytes/hex-data-length.test.js +49 -0
  72. package/dist/cjs/utils/tests/bytes/hex-data-slice.test.js +52 -0
  73. package/dist/cjs/utils/tests/bytes/hex-strip-zeros.test.js +58 -0
  74. package/dist/cjs/utils/tests/bytes/hex-value.test.js +85 -0
  75. package/dist/cjs/utils/tests/bytes/hex-zero-pad.test.js +62 -0
  76. package/dist/cjs/utils/tests/bytes/hexlify.test.js +62 -0
  77. package/dist/cjs/utils/tests/bytes/is-bytes-like.test.js +69 -0
  78. package/dist/cjs/utils/tests/bytes/is-bytes.test.js +33 -0
  79. package/dist/cjs/utils/tests/bytes/is-hex-string.test.js +88 -0
  80. package/dist/cjs/utils/tests/bytes/strip-zeros.test.js +57 -0
  81. package/dist/cjs/utils/tests/bytes/zero-pad.test.js +80 -0
  82. package/dist/cjs/utils/tests/compute-address.test.js +27 -0
  83. package/dist/cjs/utils/tests/compute-public-key.test.js +15 -0
  84. package/dist/cjs/utils/tests/ether-to-gwei.test.js +26 -0
  85. package/dist/cjs/utils/tests/ether-to-wei.test.js +44 -0
  86. package/dist/cjs/utils/tests/gwei-to-ether.test.js +28 -0
  87. package/dist/cjs/utils/tests/hash-message.test.js +21 -0
  88. package/dist/cjs/utils/tests/is-address.test.js +55 -0
  89. package/dist/cjs/utils/tests/keccak256.test.js +97 -0
  90. package/dist/cjs/utils/tests/solidity-keccak256.test.js +310 -0
  91. package/dist/cjs/utils/tests/split-signature.test.js +25 -0
  92. package/dist/cjs/utils/tests/to-checksum-address.test.js +42 -0
  93. package/dist/cjs/utils/tests/to-utf8-bytes.test.js +14 -0
  94. package/dist/cjs/utils/tests/wei-to-ether.test.js +51 -0
  95. package/dist/cjs/utils/to-checksum-address.js +15 -20
  96. package/dist/cjs/utils/to-utf8-bytes.js +1 -6
  97. package/dist/cjs/utils/wei-to-ether.js +13 -15
  98. package/dist/esm/classes/Contract.js +3 -7
  99. package/dist/esm/classes/utils/clean-block.d.ts +1 -2
  100. package/dist/esm/classes/utils/clean-block.js +1 -1
  101. package/dist/esm/classes/utils/clean-transaction-receipt.js +2 -1
  102. package/dist/esm/classes/utils/clean-transaction.js +2 -1
  103. package/dist/esm/classes/utils/encode-decode-transaction.d.ts +1 -1
  104. package/dist/esm/classes/utils/encode-decode-transaction.js +37 -2
  105. package/dist/esm/logger/package-version.d.ts +1 -1
  106. package/dist/esm/logger/package-version.js +1 -1
  107. package/dist/esm/utils/compute-address.js +2 -1
  108. package/dist/esm/utils/hash-message.d.ts +1 -1
  109. package/dist/esm/utils/hash-message.js +3 -1
  110. package/dist/esm/utils/is-address.js +1 -1
  111. package/package.json +8 -6
  112. package/readme.md +34 -3
@@ -1,93 +1,324 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
1
+ function _assertThisInitialized(self) {
2
+ if (self === void 0) {
3
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
4
+ }
5
+ return self;
6
+ }
7
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
8
+ try {
9
+ var info = gen[key](arg);
10
+ var value = info.value;
11
+ } catch (error) {
12
+ reject(error);
13
+ return;
14
+ }
15
+ if (info.done) {
16
+ resolve(value);
17
+ } else {
18
+ Promise.resolve(value).then(_next, _throw);
19
+ }
20
+ }
21
+ function _asyncToGenerator(fn) {
22
+ return function() {
23
+ var self = this, args = arguments;
24
+ return new Promise(function(resolve, reject) {
25
+ var gen = fn.apply(self, args);
26
+ function _next(value) {
27
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
28
+ }
29
+ function _throw(err) {
30
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
31
+ }
32
+ _next(undefined);
33
+ });
34
+ };
35
+ }
36
+ function _classCallCheck(instance, Constructor) {
37
+ if (!(instance instanceof Constructor)) {
38
+ throw new TypeError("Cannot call a class as a function");
39
+ }
40
+ }
41
+ function _defineProperty(obj, key, value) {
42
+ if (key in obj) {
43
+ Object.defineProperty(obj, key, {
44
+ value: value,
45
+ enumerable: true,
46
+ configurable: true,
47
+ writable: true
48
+ });
49
+ } else {
50
+ obj[key] = value;
51
+ }
52
+ return obj;
53
+ }
54
+ function _getPrototypeOf(o) {
55
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
56
+ return o.__proto__ || Object.getPrototypeOf(o);
57
+ };
58
+ return _getPrototypeOf(o);
59
+ }
60
+ function _inherits(subClass, superClass) {
61
+ if (typeof superClass !== "function" && superClass !== null) {
62
+ throw new TypeError("Super expression must either be null or a function");
63
+ }
64
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
65
+ constructor: {
66
+ value: subClass,
67
+ writable: true,
68
+ configurable: true
69
+ }
9
70
  });
71
+ if (superClass) _setPrototypeOf(subClass, superClass);
72
+ }
73
+ function _objectSpread(target) {
74
+ for(var i = 1; i < arguments.length; i++){
75
+ var source = arguments[i] != null ? arguments[i] : {};
76
+ var ownKeys = Object.keys(source);
77
+ if (typeof Object.getOwnPropertySymbols === "function") {
78
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
79
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
80
+ }));
81
+ }
82
+ ownKeys.forEach(function(key) {
83
+ _defineProperty(target, key, source[key]);
84
+ });
85
+ }
86
+ return target;
87
+ }
88
+ function _possibleConstructorReturn(self, call) {
89
+ if (call && (_typeof(call) === "object" || typeof call === "function")) {
90
+ return call;
91
+ }
92
+ return _assertThisInitialized(self);
93
+ }
94
+ function _setPrototypeOf(o, p) {
95
+ _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
96
+ o.__proto__ = p;
97
+ return o;
98
+ };
99
+ return _setPrototypeOf(o, p);
100
+ }
101
+ var _typeof = function(obj) {
102
+ "@swc/helpers - typeof";
103
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
10
104
  };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.Contract = exports.defineReadOnly = exports.BaseContract = void 0;
13
- const encode_decode_transaction_1 = require("./utils/encode-decode-transaction");
14
- const fetchers_1 = require("./utils/fetchers");
105
+ function _isNativeReflectConstruct() {
106
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
107
+ if (Reflect.construct.sham) return false;
108
+ if (typeof Proxy === "function") return true;
109
+ try {
110
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
111
+ return true;
112
+ } catch (e) {
113
+ return false;
114
+ }
115
+ }
116
+ function _createSuper(Derived) {
117
+ var hasNativeReflectConstruct = _isNativeReflectConstruct();
118
+ return function _createSuperInternal() {
119
+ var Super = _getPrototypeOf(Derived), result;
120
+ if (hasNativeReflectConstruct) {
121
+ var NewTarget = _getPrototypeOf(this).constructor;
122
+ result = Reflect.construct(Super, arguments, NewTarget);
123
+ } else {
124
+ result = Super.apply(this, arguments);
125
+ }
126
+ return _possibleConstructorReturn(this, result);
127
+ };
128
+ }
129
+ var __generator = this && this.__generator || function(thisArg, body) {
130
+ var f, y, t, g, _ = {
131
+ label: 0,
132
+ sent: function() {
133
+ if (t[0] & 1) throw t[1];
134
+ return t[1];
135
+ },
136
+ trys: [],
137
+ ops: []
138
+ };
139
+ return(g = {
140
+ next: verb(0),
141
+ "throw": verb(1),
142
+ "return": verb(2)
143
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
144
+ return this;
145
+ }), g);
146
+ function verb(n) {
147
+ return function(v) {
148
+ return step([
149
+ n,
150
+ v
151
+ ]);
152
+ };
153
+ }
154
+ function step(op) {
155
+ if (f) throw new TypeError("Generator is already executing.");
156
+ while(_)try {
157
+ 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;
158
+ if (y = 0, t) op = [
159
+ op[0] & 2,
160
+ t.value
161
+ ];
162
+ switch(op[0]){
163
+ case 0:
164
+ case 1:
165
+ t = op;
166
+ break;
167
+ case 4:
168
+ _.label++;
169
+ return {
170
+ value: op[1],
171
+ done: false
172
+ };
173
+ case 5:
174
+ _.label++;
175
+ y = op[1];
176
+ op = [
177
+ 0
178
+ ];
179
+ continue;
180
+ case 7:
181
+ op = _.ops.pop();
182
+ _.trys.pop();
183
+ continue;
184
+ default:
185
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
186
+ _ = 0;
187
+ continue;
188
+ }
189
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
190
+ _.label = op[1];
191
+ break;
192
+ }
193
+ if (op[0] === 6 && _.label < t[1]) {
194
+ _.label = t[1];
195
+ t = op;
196
+ break;
197
+ }
198
+ if (t && _.label < t[2]) {
199
+ _.label = t[2];
200
+ _.ops.push(op);
201
+ break;
202
+ }
203
+ if (t[2]) _.ops.pop();
204
+ _.trys.pop();
205
+ continue;
206
+ }
207
+ op = body.call(thisArg, _);
208
+ } catch (e) {
209
+ op = [
210
+ 6,
211
+ e
212
+ ];
213
+ y = 0;
214
+ } finally{
215
+ f = t = 0;
216
+ }
217
+ if (op[0] & 5) throw op[1];
218
+ return {
219
+ value: op[0] ? op[1] : void 0,
220
+ done: true
221
+ };
222
+ }
223
+ };
224
+ import { decodeRPCResponse, encodeData } from "./utils/encode-decode-transaction";
15
225
  /**
16
- *
17
226
  * @param txnData
18
227
  * @example
19
- */
20
- function estimateGas(txnData) {
228
+ */ function estimateGas(txnData) {
21
229
  // https://ethereum.stackexchange.com/questions/1570/what-does-intrinsic-gas-too-low-mean/1694
22
- txnData.split('').reduce((previousValue, currentValue) => {
230
+ txnData.split("").reduce(function(previousValue, currentValue) {
23
231
  // 0 characters are 4 gwei, all others are 48 gwei
24
- const characterCost = currentValue === '0' ? 4 : 68;
232
+ var characterCost = currentValue === "0" ? 4 : 68;
25
233
  return previousValue + characterCost;
26
234
  }, 0);
27
235
  }
28
- class BaseContract {
29
- /**
30
- * @param addressOrName The ethereum address of the smart-contract
31
- * @param contractInterface The JSON ABI of the smart-contract (like http://api.etherscan.io/api?module=contract&action=getabi&address=0x090d4613473dee047c3f2706764f49e0821d256e&format=raw)
32
- * @param signerOrProvider An instantiated essential-eth provider
33
- * @example
34
- */
35
- constructor(addressOrName, contractInterface, signerOrProvider) {
36
- this._address = addressOrName;
37
- this._provider = signerOrProvider;
38
- contractInterface
39
- .filter((jsonABIArgument) => jsonABIArgument.type === 'function')
40
- .forEach((jsonABIArgument) => {
41
- if ('name' in jsonABIArgument &&
42
- typeof jsonABIArgument.name === 'string') {
43
- defineReadOnly(this, jsonABIArgument.name, (..._args) => __awaiter(this, void 0, void 0, function* () {
44
- let functionArguments = _args;
45
- let options = {};
46
- // remove options from encoding
47
- const lastArg = _args[_args.length - 1];
48
- if (!Array.isArray(lastArg) && typeof lastArg === 'object') {
49
- options = lastArg;
50
- functionArguments = _args.slice(0, _args.length - 1);
236
+ export var BaseContract = function BaseContract(addressOrName, contractInterface, signerOrProvider) {
237
+ "use strict";
238
+ var _this = this;
239
+ _classCallCheck(this, BaseContract);
240
+ this._address = addressOrName;
241
+ this._provider = signerOrProvider;
242
+ contractInterface.filter(function(jsonABIArgument) {
243
+ return jsonABIArgument.type === "function";
244
+ }).forEach(function(jsonABIArgument) {
245
+ if ("name" in jsonABIArgument && typeof jsonABIArgument.name === "string") {
246
+ var _this1 = _this;
247
+ defineReadOnly(_this, jsonABIArgument.name, /*#__PURE__*/ _asyncToGenerator(function() {
248
+ var _len, _args, _key, functionArguments, options, lastArg, data, decimalGas, req, nodeResponse;
249
+ var _arguments = arguments;
250
+ return __generator(this, function(_state) {
251
+ switch(_state.label){
252
+ case 0:
253
+ for(_len = _arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++){
254
+ _args[_key] = _arguments[_key];
255
+ }
256
+ functionArguments = _args;
257
+ options = {};
258
+ lastArg = _args[_args.length - 1];
259
+ if (!Array.isArray(lastArg) && typeof lastArg === "object") {
260
+ options = lastArg;
261
+ functionArguments = _args.slice(0, _args.length - 1);
262
+ }
263
+ data = encodeData(jsonABIArgument, functionArguments);
264
+ decimalGas = typeof options.gasLimit === "number" ? options.gasLimit /* user passed in "gasLimit" directly */ : typeof (jsonABIArgument === null || jsonABIArgument === void 0 ? void 0 : jsonABIArgument.gas) === "number" /* ABI specified "gas". */ ? estimateGas(data) : null;
265
+ req = function() {
266
+ var _ref = _asyncToGenerator(function() {
267
+ return __generator(this, function(_state) {
268
+ switch(_state.label){
269
+ case 0:
270
+ return [
271
+ 4,
272
+ _this1._provider.call(_objectSpread({
273
+ to: _this1._address.toLowerCase(),
274
+ data: data
275
+ }, decimalGas ? {
276
+ gas: "0x".concat(decimalGas.toString(16))
277
+ } : {}), "latest")
278
+ ];
279
+ case 1:
280
+ return [
281
+ 2,
282
+ _state.sent()
283
+ ];
284
+ }
285
+ });
286
+ });
287
+ return function req() {
288
+ return _ref.apply(this, arguments);
289
+ };
290
+ }();
291
+ return [
292
+ 4,
293
+ req()
294
+ ];
295
+ case 1:
296
+ nodeResponse = _state.sent();
297
+ return [
298
+ 2,
299
+ decodeRPCResponse(jsonABIArgument, nodeResponse)
300
+ ];
51
301
  }
52
- const data = (0, encode_decode_transaction_1.encodeData)(jsonABIArgument, functionArguments);
53
- const decimalGas = typeof options.gasLimit === 'number'
54
- ? options.gasLimit /* user passed in "gasLimit" directly */
55
- : typeof (jsonABIArgument === null || jsonABIArgument === void 0 ? void 0 : jsonABIArgument.gas) ===
56
- 'number' /* ABI specified "gas". */
57
- ? estimateGas(data)
58
- : null;
59
- const req = () => __awaiter(this, void 0, void 0, function* () {
60
- return yield (0, fetchers_1.post)(this._provider.selectRpcUrl(), (0, fetchers_1.buildRPCPostBody)('eth_call', [
61
- Object.assign({ to: this._address.toLowerCase(), data }, (decimalGas
62
- ? { gas: `0x${decimalGas.toString(16)}` }
63
- : {})),
64
- 'latest',
65
- ]));
66
- });
67
- const nodeResponse = yield req();
68
- return (0, encode_decode_transaction_1.decodeRPCResponse)(jsonABIArgument, nodeResponse);
69
- }));
70
- }
71
- });
72
- }
73
- }
74
- exports.BaseContract = BaseContract;
302
+ });
303
+ }));
304
+ }
305
+ });
306
+ };
75
307
  /**
76
308
  * Applies the unique contract's methods to the instantiated Contract in the constructor based-upon the provided ABI
77
309
  *
78
310
  * @param object
79
311
  * @param name
80
312
  * @param value
313
+ * @internal
81
314
  * @example
82
- */
83
- function defineReadOnly(object, name, value) {
315
+ */ export function defineReadOnly(object, name, value) {
84
316
  Object.defineProperty(object, name, {
85
317
  enumerable: true,
86
318
  value: value,
87
- writable: false,
319
+ writable: false
88
320
  });
89
321
  }
90
- exports.defineReadOnly = defineReadOnly;
91
322
  /**
92
323
  * @alpha
93
324
  * Only accepts ABIS in JSON format. This allows for stronger typing and assurances of data-types
@@ -98,6 +329,8 @@ exports.defineReadOnly = defineReadOnly;
98
329
  * // UNI airdrop contract
99
330
  * const contractAddress = '0x090D4613473dEE047c3f2706764f49E0821D256e';
100
331
  * const provider = new JsonRpcProvider();
332
+ * // for more robust contract calls, provide a fallback:
333
+ * // const provider = new FallthroughProvider(['bad', 'https://free-eth-node.com/api/eth']);
101
334
  *
102
335
  * const JSONABI = [
103
336
  * {
@@ -134,7 +367,13 @@ exports.defineReadOnly = defineReadOnly;
134
367
  *
135
368
  *
136
369
  * ```
137
- */
138
- class Contract extends BaseContract {
139
- }
140
- exports.Contract = Contract;
370
+ */ export var Contract = /*#__PURE__*/ function(BaseContract) {
371
+ "use strict";
372
+ _inherits(Contract, BaseContract);
373
+ var _super = _createSuper(Contract);
374
+ function Contract() {
375
+ _classCallCheck(this, Contract);
376
+ return _super.apply(this, arguments);
377
+ }
378
+ return Contract;
379
+ }(BaseContract);