essential-eth 0.9.1-next.1 → 0.9.2-beta.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 (205) hide show
  1. package/dist/essential-eth.esm.mjs +2 -0
  2. package/dist/essential-eth.esm.mjs.map +1 -0
  3. package/dist/essential-eth.js +2 -0
  4. package/dist/essential-eth.js.map +1 -0
  5. package/dist/essential-eth.modern.mjs +2 -0
  6. package/dist/essential-eth.modern.mjs.map +1 -0
  7. package/dist/essential-eth.umd.js +2 -0
  8. package/dist/essential-eth.umd.js.map +1 -0
  9. package/dist/logger/package-version.d.ts +1 -0
  10. package/package.json +11 -13
  11. package/readme.md +1 -1
  12. package/dist/cjs/classes/Contract.js +0 -138
  13. package/dist/cjs/classes/test/Contract/crv-abi.js +0 -488
  14. package/dist/cjs/classes/test/Contract/ens-abi.js +0 -453
  15. package/dist/cjs/classes/test/Contract/fei-abi.js +0 -526
  16. package/dist/cjs/classes/test/Contract/foo-abi.js +0 -42
  17. package/dist/cjs/classes/test/Contract/uniswap-abi.js +0 -121
  18. package/dist/cjs/classes/utils/clean-block.js +0 -160
  19. package/dist/cjs/classes/utils/clean-log.js +0 -37
  20. package/dist/cjs/classes/utils/clean-transaction-receipt.js +0 -51
  21. package/dist/cjs/classes/utils/clean-transaction.js +0 -52
  22. package/dist/cjs/classes/utils/encode-decode-transaction.js +0 -177
  23. package/dist/cjs/classes/utils/fetchers.js +0 -94
  24. package/dist/cjs/classes/utils/hex-to-decimal.js +0 -24
  25. package/dist/cjs/classes/utils/prepare-transaction.js +0 -45
  26. package/dist/cjs/index.js +0 -56
  27. package/dist/cjs/index.umd.js +0 -2
  28. package/dist/cjs/index.umd.js.map +0 -1
  29. package/dist/cjs/logger/logger.js +0 -36
  30. package/dist/cjs/logger/package-version.d.ts +0 -1
  31. package/dist/cjs/logger/package-version.js +0 -5
  32. package/dist/cjs/providers/AlchemyProvider.js +0 -11
  33. package/dist/cjs/providers/BaseProvider.js +0 -549
  34. package/dist/cjs/providers/FallthroughProvider.js +0 -73
  35. package/dist/cjs/providers/JsonRpcProvider.js +0 -46
  36. package/dist/cjs/providers/test/json-rpc-provider/get-logs/mocks.js +0 -152
  37. package/dist/cjs/providers/test/mock-of.js +0 -12
  38. package/dist/cjs/providers/test/rpc-urls.js +0 -25
  39. package/dist/cjs/providers/utils/chains-info.js +0 -71
  40. package/dist/cjs/shared/tiny-big/helpers.js +0 -97
  41. package/dist/cjs/shared/tiny-big/tiny-big.js +0 -101
  42. package/dist/cjs/shared/validate-type.js +0 -9
  43. package/dist/cjs/types/Block.types.js +0 -2
  44. package/dist/cjs/types/Contract.types.js +0 -2
  45. package/dist/cjs/types/FeeData.types.js +0 -2
  46. package/dist/cjs/types/Filter.types.js +0 -2
  47. package/dist/cjs/types/Network.types.js +0 -2
  48. package/dist/cjs/types/Transaction.types.js +0 -2
  49. package/dist/cjs/utils/bytes.js +0 -711
  50. package/dist/cjs/utils/compute-address.js +0 -34
  51. package/dist/cjs/utils/compute-public-key.js +0 -26
  52. package/dist/cjs/utils/ether-to-gwei.js +0 -35
  53. package/dist/cjs/utils/ether-to-wei.js +0 -35
  54. package/dist/cjs/utils/gwei-to-ether.js +0 -35
  55. package/dist/cjs/utils/hash-message.js +0 -30
  56. package/dist/cjs/utils/is-address.js +0 -39
  57. package/dist/cjs/utils/keccak256.js +0 -31
  58. package/dist/cjs/utils/solidity-keccak256.js +0 -138
  59. package/dist/cjs/utils/split-signature.js +0 -163
  60. package/dist/cjs/utils/to-checksum-address.js +0 -46
  61. package/dist/cjs/utils/to-utf8-bytes.js +0 -21
  62. package/dist/cjs/utils/wei-to-ether.js +0 -45
  63. package/dist/esm/classes/Contract.d.ts +0 -11
  64. package/dist/esm/classes/Contract.js +0 -61
  65. package/dist/esm/classes/test/Contract/crv-abi.d.ts +0 -2
  66. package/dist/esm/classes/test/Contract/crv-abi.js +0 -470
  67. package/dist/esm/classes/test/Contract/ens-abi.d.ts +0 -2
  68. package/dist/esm/classes/test/Contract/ens-abi.js +0 -435
  69. package/dist/esm/classes/test/Contract/fei-abi.d.ts +0 -2
  70. package/dist/esm/classes/test/Contract/fei-abi.js +0 -521
  71. package/dist/esm/classes/test/Contract/foo-abi.d.ts +0 -2
  72. package/dist/esm/classes/test/Contract/foo-abi.js +0 -33
  73. package/dist/esm/classes/test/Contract/uniswap-abi.d.ts +0 -2
  74. package/dist/esm/classes/test/Contract/uniswap-abi.js +0 -116
  75. package/dist/esm/classes/utils/clean-block.d.ts +0 -2
  76. package/dist/esm/classes/utils/clean-block.js +0 -35
  77. package/dist/esm/classes/utils/clean-log.d.ts +0 -2
  78. package/dist/esm/classes/utils/clean-log.js +0 -26
  79. package/dist/esm/classes/utils/clean-transaction-receipt.d.ts +0 -2
  80. package/dist/esm/classes/utils/clean-transaction-receipt.js +0 -35
  81. package/dist/esm/classes/utils/clean-transaction.d.ts +0 -2
  82. package/dist/esm/classes/utils/clean-transaction.js +0 -34
  83. package/dist/esm/classes/utils/encode-decode-transaction.d.ts +0 -4
  84. package/dist/esm/classes/utils/encode-decode-transaction.js +0 -134
  85. package/dist/esm/classes/utils/fetchers.d.ts +0 -15
  86. package/dist/esm/classes/utils/fetchers.js +0 -46
  87. package/dist/esm/classes/utils/hex-to-decimal.d.ts +0 -1
  88. package/dist/esm/classes/utils/hex-to-decimal.js +0 -3
  89. package/dist/esm/classes/utils/prepare-transaction.d.ts +0 -2
  90. package/dist/esm/classes/utils/prepare-transaction.js +0 -34
  91. package/dist/esm/index.d.ts +0 -25
  92. package/dist/esm/index.js +0 -20
  93. package/dist/esm/logger/logger.d.ts +0 -11
  94. package/dist/esm/logger/logger.js +0 -33
  95. package/dist/esm/logger/package-version.d.ts +0 -1
  96. package/dist/esm/logger/package-version.js +0 -1
  97. package/dist/esm/providers/AlchemyProvider.d.ts +0 -4
  98. package/dist/esm/providers/AlchemyProvider.js +0 -7
  99. package/dist/esm/providers/BaseProvider.d.ts +0 -26
  100. package/dist/esm/providers/BaseProvider.js +0 -172
  101. package/dist/esm/providers/FallthroughProvider.d.ts +0 -11
  102. package/dist/esm/providers/FallthroughProvider.js +0 -49
  103. package/dist/esm/providers/JsonRpcProvider.d.ts +0 -7
  104. package/dist/esm/providers/JsonRpcProvider.js +0 -15
  105. package/dist/esm/providers/test/json-rpc-provider/get-logs/mocks.d.ts +0 -14
  106. package/dist/esm/providers/test/json-rpc-provider/get-logs/mocks.js +0 -142
  107. package/dist/esm/providers/test/mock-of.d.ts +0 -2
  108. package/dist/esm/providers/test/mock-of.js +0 -1
  109. package/dist/esm/providers/test/rpc-urls.d.ts +0 -12
  110. package/dist/esm/providers/test/rpc-urls.js +0 -19
  111. package/dist/esm/providers/utils/chains-info.d.ts +0 -24
  112. package/dist/esm/providers/utils/chains-info.js +0 -67
  113. package/dist/esm/shared/tiny-big/helpers.d.ts +0 -1
  114. package/dist/esm/shared/tiny-big/helpers.js +0 -58
  115. package/dist/esm/shared/tiny-big/tiny-big.d.ts +0 -10
  116. package/dist/esm/shared/tiny-big/tiny-big.js +0 -45
  117. package/dist/esm/shared/validate-type.d.ts +0 -3
  118. package/dist/esm/shared/validate-type.js +0 -5
  119. package/dist/esm/types/Block.types.d.ts +0 -40
  120. package/dist/esm/types/Block.types.js +0 -1
  121. package/dist/esm/types/Contract.types.d.ts +0 -24
  122. package/dist/esm/types/Contract.types.js +0 -1
  123. package/dist/esm/types/FeeData.types.d.ts +0 -7
  124. package/dist/esm/types/FeeData.types.js +0 -1
  125. package/dist/esm/types/Filter.types.d.ts +0 -12
  126. package/dist/esm/types/Filter.types.js +0 -1
  127. package/dist/esm/types/Network.types.d.ts +0 -5
  128. package/dist/esm/types/Network.types.js +0 -1
  129. package/dist/esm/types/Transaction.types.d.ts +0 -113
  130. package/dist/esm/types/Transaction.types.js +0 -1
  131. package/dist/esm/utils/bytes.d.ts +0 -40
  132. package/dist/esm/utils/bytes.js +0 -245
  133. package/dist/esm/utils/compute-address.d.ts +0 -1
  134. package/dist/esm/utils/compute-address.js +0 -12
  135. package/dist/esm/utils/compute-public-key.d.ts +0 -2
  136. package/dist/esm/utils/compute-public-key.js +0 -6
  137. package/dist/esm/utils/ether-to-gwei.d.ts +0 -3
  138. package/dist/esm/utils/ether-to-gwei.js +0 -7
  139. package/dist/esm/utils/ether-to-wei.d.ts +0 -3
  140. package/dist/esm/utils/ether-to-wei.js +0 -7
  141. package/dist/esm/utils/gwei-to-ether.d.ts +0 -3
  142. package/dist/esm/utils/gwei-to-ether.js +0 -7
  143. package/dist/esm/utils/hash-message.d.ts +0 -2
  144. package/dist/esm/utils/hash-message.js +0 -14
  145. package/dist/esm/utils/is-address.d.ts +0 -1
  146. package/dist/esm/utils/is-address.js +0 -12
  147. package/dist/esm/utils/keccak256.d.ts +0 -2
  148. package/dist/esm/utils/keccak256.js +0 -13
  149. package/dist/esm/utils/solidity-keccak256.d.ts +0 -2
  150. package/dist/esm/utils/solidity-keccak256.js +0 -85
  151. package/dist/esm/utils/split-signature.d.ts +0 -2
  152. package/dist/esm/utils/split-signature.js +0 -126
  153. package/dist/esm/utils/to-checksum-address.d.ts +0 -1
  154. package/dist/esm/utils/to-checksum-address.js +0 -25
  155. package/dist/esm/utils/to-utf8-bytes.d.ts +0 -1
  156. package/dist/esm/utils/to-utf8-bytes.js +0 -3
  157. package/dist/esm/utils/wei-to-ether.d.ts +0 -3
  158. package/dist/esm/utils/wei-to-ether.js +0 -16
  159. /package/dist/{cjs/classes → classes}/Contract.d.ts +0 -0
  160. /package/dist/{cjs/classes → classes}/test/Contract/crv-abi.d.ts +0 -0
  161. /package/dist/{cjs/classes → classes}/test/Contract/ens-abi.d.ts +0 -0
  162. /package/dist/{cjs/classes → classes}/test/Contract/fei-abi.d.ts +0 -0
  163. /package/dist/{cjs/classes → classes}/test/Contract/foo-abi.d.ts +0 -0
  164. /package/dist/{cjs/classes → classes}/test/Contract/uniswap-abi.d.ts +0 -0
  165. /package/dist/{cjs/classes → classes}/utils/clean-block.d.ts +0 -0
  166. /package/dist/{cjs/classes → classes}/utils/clean-log.d.ts +0 -0
  167. /package/dist/{cjs/classes → classes}/utils/clean-transaction-receipt.d.ts +0 -0
  168. /package/dist/{cjs/classes → classes}/utils/clean-transaction.d.ts +0 -0
  169. /package/dist/{cjs/classes → classes}/utils/encode-decode-transaction.d.ts +0 -0
  170. /package/dist/{cjs/classes → classes}/utils/fetchers.d.ts +0 -0
  171. /package/dist/{cjs/classes → classes}/utils/hex-to-decimal.d.ts +0 -0
  172. /package/dist/{cjs/classes → classes}/utils/prepare-transaction.d.ts +0 -0
  173. /package/dist/{cjs/index.d.ts → index.d.ts} +0 -0
  174. /package/dist/{cjs/logger → logger}/logger.d.ts +0 -0
  175. /package/dist/{cjs/providers → providers}/AlchemyProvider.d.ts +0 -0
  176. /package/dist/{cjs/providers → providers}/BaseProvider.d.ts +0 -0
  177. /package/dist/{cjs/providers → providers}/FallthroughProvider.d.ts +0 -0
  178. /package/dist/{cjs/providers → providers}/JsonRpcProvider.d.ts +0 -0
  179. /package/dist/{cjs/providers → providers}/test/json-rpc-provider/get-logs/mocks.d.ts +0 -0
  180. /package/dist/{cjs/providers → providers}/test/mock-of.d.ts +0 -0
  181. /package/dist/{cjs/providers → providers}/test/rpc-urls.d.ts +0 -0
  182. /package/dist/{cjs/providers → providers}/utils/chains-info.d.ts +0 -0
  183. /package/dist/{cjs/shared → shared}/tiny-big/helpers.d.ts +0 -0
  184. /package/dist/{cjs/shared → shared}/tiny-big/tiny-big.d.ts +0 -0
  185. /package/dist/{cjs/shared → shared}/validate-type.d.ts +0 -0
  186. /package/dist/{cjs/types → types}/Block.types.d.ts +0 -0
  187. /package/dist/{cjs/types → types}/Contract.types.d.ts +0 -0
  188. /package/dist/{cjs/types → types}/FeeData.types.d.ts +0 -0
  189. /package/dist/{cjs/types → types}/Filter.types.d.ts +0 -0
  190. /package/dist/{cjs/types → types}/Network.types.d.ts +0 -0
  191. /package/dist/{cjs/types → types}/Transaction.types.d.ts +0 -0
  192. /package/dist/{cjs/utils → utils}/bytes.d.ts +0 -0
  193. /package/dist/{cjs/utils → utils}/compute-address.d.ts +0 -0
  194. /package/dist/{cjs/utils → utils}/compute-public-key.d.ts +0 -0
  195. /package/dist/{cjs/utils → utils}/ether-to-gwei.d.ts +0 -0
  196. /package/dist/{cjs/utils → utils}/ether-to-wei.d.ts +0 -0
  197. /package/dist/{cjs/utils → utils}/gwei-to-ether.d.ts +0 -0
  198. /package/dist/{cjs/utils → utils}/hash-message.d.ts +0 -0
  199. /package/dist/{cjs/utils → utils}/is-address.d.ts +0 -0
  200. /package/dist/{cjs/utils → utils}/keccak256.d.ts +0 -0
  201. /package/dist/{cjs/utils → utils}/solidity-keccak256.d.ts +0 -0
  202. /package/dist/{cjs/utils → utils}/split-signature.d.ts +0 -0
  203. /package/dist/{cjs/utils → utils}/to-checksum-address.d.ts +0 -0
  204. /package/dist/{cjs/utils → utils}/to-utf8-bytes.d.ts +0 -0
  205. /package/dist/{cjs/utils → utils}/wei-to-ether.d.ts +0 -0
@@ -1,45 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.prepareTransaction = void 0;
7
- const big_js_1 = __importDefault(require("big.js"));
8
- const tiny_big_1 = require("../../shared/tiny-big/tiny-big");
9
- const bytes_1 = require("../../utils/bytes");
10
- /**
11
- * @param transaction
12
- * @example
13
- */
14
- function prepareTransaction(transaction) {
15
- const preparedTransaction = Object.assign({}, transaction);
16
- Object.keys(transaction).forEach((key) => {
17
- switch (key) {
18
- case 'gas':
19
- case 'gasPrice':
20
- case 'nonce':
21
- case 'maxFeePerGas':
22
- case 'maxPriorityFeePerGas':
23
- case 'value': {
24
- const value = transaction[key];
25
- if (value instanceof tiny_big_1.TinyBig) {
26
- preparedTransaction[key] = value.toHexString();
27
- }
28
- else if (value instanceof big_js_1.default) {
29
- preparedTransaction[key] = `0x${BigInt(value.toString()).toString(16)}`;
30
- }
31
- else if (typeof transaction[key] === 'number')
32
- preparedTransaction[key] =
33
- '0x' + transaction[key].toString(16);
34
- else
35
- preparedTransaction[key] = transaction[key].toString();
36
- break;
37
- }
38
- case 'data':
39
- preparedTransaction[key] = (0, bytes_1.hexlify)(transaction[key]);
40
- break;
41
- }
42
- });
43
- return preparedTransaction;
44
- }
45
- exports.prepareTransaction = prepareTransaction;
package/dist/cjs/index.js DELETED
@@ -1,56 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.weiToEther = exports.toUtf8Bytes = exports.toChecksumAddress = exports.splitSignature = exports.isAddress = exports.hashMessage = exports.gweiToEther = exports.etherToWei = exports.etherToGwei = exports.computePublicKey = exports.computeAddress = exports.TinyBig = exports.tinyBig = exports.JsonRpcProvider = exports.jsonRpcProvider = exports.FallthroughProvider = exports.AlchemyProvider = exports.BaseContract = exports.Contract = void 0;
18
- var Contract_1 = require("./classes/Contract");
19
- Object.defineProperty(exports, "Contract", { enumerable: true, get: function () { return Contract_1.Contract; } });
20
- Object.defineProperty(exports, "BaseContract", { enumerable: true, get: function () { return Contract_1.BaseContract; } });
21
- var AlchemyProvider_1 = require("./providers/AlchemyProvider");
22
- Object.defineProperty(exports, "AlchemyProvider", { enumerable: true, get: function () { return AlchemyProvider_1.AlchemyProvider; } });
23
- var FallthroughProvider_1 = require("./providers/FallthroughProvider");
24
- Object.defineProperty(exports, "FallthroughProvider", { enumerable: true, get: function () { return FallthroughProvider_1.FallthroughProvider; } });
25
- var JsonRpcProvider_1 = require("./providers/JsonRpcProvider");
26
- Object.defineProperty(exports, "jsonRpcProvider", { enumerable: true, get: function () { return JsonRpcProvider_1.jsonRpcProvider; } });
27
- Object.defineProperty(exports, "JsonRpcProvider", { enumerable: true, get: function () { return JsonRpcProvider_1.JsonRpcProvider; } });
28
- var tiny_big_1 = require("./shared/tiny-big/tiny-big");
29
- Object.defineProperty(exports, "tinyBig", { enumerable: true, get: function () { return tiny_big_1.tinyBig; } });
30
- Object.defineProperty(exports, "TinyBig", { enumerable: true, get: function () { return tiny_big_1.TinyBig; } });
31
- var compute_address_1 = require("./utils/compute-address");
32
- Object.defineProperty(exports, "computeAddress", { enumerable: true, get: function () { return compute_address_1.computeAddress; } });
33
- var compute_public_key_1 = require("./utils/compute-public-key");
34
- Object.defineProperty(exports, "computePublicKey", { enumerable: true, get: function () { return compute_public_key_1.computePublicKey; } });
35
- var ether_to_gwei_1 = require("./utils/ether-to-gwei");
36
- Object.defineProperty(exports, "etherToGwei", { enumerable: true, get: function () { return ether_to_gwei_1.etherToGwei; } });
37
- var ether_to_wei_1 = require("./utils/ether-to-wei");
38
- Object.defineProperty(exports, "etherToWei", { enumerable: true, get: function () { return ether_to_wei_1.etherToWei; } });
39
- var gwei_to_ether_1 = require("./utils/gwei-to-ether");
40
- Object.defineProperty(exports, "gweiToEther", { enumerable: true, get: function () { return gwei_to_ether_1.gweiToEther; } });
41
- var hash_message_1 = require("./utils/hash-message");
42
- Object.defineProperty(exports, "hashMessage", { enumerable: true, get: function () { return hash_message_1.hashMessage; } });
43
- var is_address_1 = require("./utils/is-address");
44
- Object.defineProperty(exports, "isAddress", { enumerable: true, get: function () { return is_address_1.isAddress; } });
45
- var split_signature_1 = require("./utils/split-signature");
46
- Object.defineProperty(exports, "splitSignature", { enumerable: true, get: function () { return split_signature_1.splitSignature; } });
47
- var to_checksum_address_1 = require("./utils/to-checksum-address");
48
- Object.defineProperty(exports, "toChecksumAddress", { enumerable: true, get: function () { return to_checksum_address_1.toChecksumAddress; } });
49
- var to_utf8_bytes_1 = require("./utils/to-utf8-bytes");
50
- Object.defineProperty(exports, "toUtf8Bytes", { enumerable: true, get: function () { return to_utf8_bytes_1.toUtf8Bytes; } });
51
- var wei_to_ether_1 = require("./utils/wei-to-ether");
52
- Object.defineProperty(exports, "weiToEther", { enumerable: true, get: function () { return wei_to_ether_1.weiToEther; } });
53
- __exportStar(require("./utils/bytes"), exports);
54
- __exportStar(require("./utils/hash-message"), exports);
55
- __exportStar(require("./utils/keccak256"), exports);
56
- __exportStar(require("./utils/solidity-keccak256"), exports);
@@ -1,2 +0,0 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("buffer")):"function"==typeof define&&define.amd?define(["exports","buffer"],e):e((t||self).essentialEth={},t.buffer$1)}(this,function(t,e){function r(){return r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},r.apply(this,arguments)}function n(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,i(t,e)}function i(t,e){return i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},i(t,e)}function o(t){var e={exports:{}};return t(e,e.exports),e.exports}for(var s=[],u=[],f="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=0,h=a.length;c<h;++c)s[c]=a[c],u[a.charCodeAt(c)]=c;function l(t,e,r){for(var n,i=[],o=e;o<r;o+=3)i.push(s[(n=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(255&t[o+2]))>>18&63]+s[n>>12&63]+s[n>>6&63]+s[63&n]);return i.join("")}u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63;var p=function(t,e,r,n,i){var o,s,u=8*i-n-1,f=(1<<u)-1,a=f>>1,c=-7,h=r?i-1:0,l=r?-1:1,p=t[e+h];for(h+=l,o=p&(1<<-c)-1,p>>=-c,c+=u;c>0;o=256*o+t[e+h],h+=l,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=n;c>0;s=256*s+t[e+h],h+=l,c-=8);if(0===o)o=1-a;else{if(o===f)return s?NaN:Infinity*(p?-1:1);s+=Math.pow(2,n),o-=a}return(p?-1:1)*s*Math.pow(2,o-n)},g=function(t,e,r,n,i,o){var s,u,f,a=8*o-i-1,c=(1<<a)-1,h=c>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,g=n?1:-1,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||Infinity===e?(u=isNaN(e)?1:0,s=c):(s=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-s))<1&&(s--,f*=2),(e+=s+h>=1?l/f:l*Math.pow(2,1-h))*f>=2&&(s++,f/=2),s+h>=c?(u=0,s=c):s+h>=1?(u=(e*f-1)*Math.pow(2,i),s+=h):(u=e*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;t[r+p]=255&u,p+=g,u/=256,i-=8);for(s=s<<i|u,a+=i;a>0;t[r+p]=255&s,p+=g,s/=256,a-=8);t[r+p-g]|=128*d},d=o(function(t,e){const r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=o,e.SlowBuffer=function(t){return+t!=t&&(t=0),o.alloc(+t)},e.INSPECT_MAX_BYTES=50;const n=2147483647;function i(t){if(t>n)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,o.prototype),e}function o(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return h(t)}return a(t,e,r)}function a(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!o.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|v(t,e);let n=i(r);const s=n.write(t,e);return s!==r&&(n=n.slice(0,s)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(X(t,Uint8Array)){const e=new Uint8Array(t);return y(e.buffer,e.byteOffset,e.byteLength)}return d(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(X(t,ArrayBuffer)||t&&X(t.buffer,ArrayBuffer))return y(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(X(t,SharedArrayBuffer)||t&&X(t.buffer,SharedArrayBuffer)))return y(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return o.from(n,e,r);const s=function(t){if(o.isBuffer(t)){const e=0|m(t.length),r=i(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||Q(t.length)?i(0):d(t):"Buffer"===t.type&&Array.isArray(t.data)?d(t.data):void 0}(t);if(s)return s;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return o.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function c(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function h(t){return c(t),i(t<0?0:0|m(t))}function d(t){const e=t.length<0?0:0|m(t.length),r=i(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function y(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,o.prototype),n}function m(t){if(t>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return 0|t}function v(t,e){if(o.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||X(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return J(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return K(t).length;default:if(i)return n?-1:J(t).length;e=(""+e).toLowerCase(),i=!0}}function w(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return N(this,e,r);case"utf8":case"utf-8":return _(this,e,r);case"ascii":return k(this,e,r);case"latin1":case"binary":return O(this,e,r);case"base64":return U(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function b(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function E(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Q(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=o.from(e,n)),o.isBuffer(e))return 0===e.length?-1:x(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):x(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function x(t,e,r,n,i){let o,s=1,u=t.length,f=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,u/=2,f/=2,r/=2}function a(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){let n=-1;for(o=r;o<u;o++)if(a(t,o)===a(e,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===f)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+f>u&&(r=u-f),o=r;o>=0;o--){let r=!0;for(let n=0;n<f;n++)if(a(t,o+n)!==a(e,n)){r=!1;break}if(r)return o}return-1}function A(t,e,r,n){r=Number(r)||0;const i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=e.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(e.substr(2*s,2),16);if(Q(n))return s;t[r+s]=n}return s}function B(t,e,r,n){return Y(J(e,t.length-r),t,r,n)}function P(t,e,r,n){return Y(function(t){const e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function I(t,e,r,n){return Y(K(e),t,r,n)}function S(t,e,r,n){return Y(function(t,e){let r,n,i;const o=[];for(let s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function U(t,e,r){return function(t){for(var e,r=t.length,n=r%3,i=[],o=16383,u=0,f=r-n;u<f;u+=o)i.push(l(t,u,u+o>f?f:u+o));return 1===n?i.push(s[(e=t[r-1])>>2]+s[e<<4&63]+"=="):2===n&&i.push(s[(e=(t[r-2]<<8)+t[r-1])>>10]+s[e>>4&63]+s[e<<2&63]+"="),i.join("")}(0===e&&r===t.length?t:t.slice(e,r))}function _(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i<r;){const e=t[i];let o=null,s=e>239?4:e>223?3:e>191?2:1;if(i+s<=r){let r,n,u,f;switch(s){case 1:e<128&&(o=e);break;case 2:r=t[i+1],128==(192&r)&&(f=(31&e)<<6|63&r,f>127&&(o=f));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(f=(15&e)<<12|(63&r)<<6|63&n,f>2047&&(f<55296||f>57343)&&(o=f));break;case 4:r=t[i+1],n=t[i+2],u=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&u)&&(f=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&u,f>65535&&f<1114112&&(o=f))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(t){const e=t.length;if(e<=R)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=R));return r}(n)}e.kMaxLength=n,(o.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}())||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}}),o.poolSize=8192,o.from=function(t,e,r){return a(t,e,r)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array),o.alloc=function(t,e,r){return function(t,e,r){return c(t),t<=0?i(t):void 0!==e?"string"==typeof r?i(t).fill(e,r):i(t).fill(e):i(t)}(t,e,r)},o.allocUnsafe=function(t){return h(t)},o.allocUnsafeSlow=function(t){return h(t)},o.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==o.prototype},o.compare=function(t,e){if(X(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),X(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(t)||!o.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,n=e.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},o.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return o.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;const n=o.allocUnsafe(e);let i=0;for(r=0;r<t.length;++r){let e=t[r];if(X(e,Uint8Array))i+e.length>n.length?(o.isBuffer(e)||(e=o.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!o.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},o.byteLength=v,o.prototype._isBuffer=!0,o.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)b(this,e,e+1);return this},o.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)b(this,e,e+3),b(this,e+1,e+2);return this},o.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)b(this,e,e+7),b(this,e+1,e+6),b(this,e+2,e+5),b(this,e+3,e+4);return this},o.prototype.toLocaleString=o.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?_(this,0,t):w.apply(this,arguments)},o.prototype.equals=function(t){if(!o.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===o.compare(this,t)},o.prototype.inspect=function(){let t="";const r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},r&&(o.prototype[r]=o.prototype.inspect),o.prototype.compare=function(t,e,r,n,i){if(X(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;let s=(i>>>=0)-(n>>>=0),u=(r>>>=0)-(e>>>=0);const f=Math.min(s,u),a=this.slice(n,i),c=t.slice(e,r);for(let t=0;t<f;++t)if(a[t]!==c[t]){s=a[t],u=c[t];break}return s<u?-1:u<s?1:0},o.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},o.prototype.indexOf=function(t,e,r){return E(this,t,e,r,!0)},o.prototype.lastIndexOf=function(t,e,r){return E(this,t,e,r,!1)},o.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return A(this,t,e,r);case"utf8":case"utf-8":return B(this,t,e,r);case"ascii":case"latin1":case"binary":return P(this,t,e,r);case"base64":return I(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const R=4096;function k(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function O(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function N(t,e,r){const n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=e;n<r;++n)i+=tt[t[n]];return i}function C(t,e,r){const n=t.slice(e,r);let i="";for(let t=0;t<n.length-1;t+=2)i+=String.fromCharCode(n[t]+256*n[t+1]);return i}function T(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function j(t,e,r,n,i,s){if(!o.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<s)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function M(t,e,r,n,i){q(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,r}function L(t,e,r,n,i){q(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=s,s>>=8,t[r+2]=s,s>>=8,t[r+1]=s,s>>=8,t[r]=s,r+8}function $(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(t,e,r,n,i){return e=+e,r>>>=0,i||$(t,0,r,4),g(t,e,r,n,23,4),r+4}function G(t,e,r,n,i){return e=+e,r>>>=0,i||$(t,0,r,8),g(t,e,r,n,52,8),r+8}o.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);const n=this.subarray(t,e);return Object.setPrototypeOf(n,o.prototype),n},o.prototype.readUintLE=o.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||T(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return n},o.prototype.readUintBE=o.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||T(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},o.prototype.readUint8=o.prototype.readUInt8=function(t,e){return t>>>=0,e||T(t,1,this.length),this[t]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(t,e){return t>>>=0,e||T(t,2,this.length),this[t]|this[t+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(t,e){return t>>>=0,e||T(t,2,this.length),this[t]<<8|this[t+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(t,e){return t>>>=0,e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(t,e){return t>>>=0,e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},o.prototype.readBigUInt64LE=et(function(t){W(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||Z(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))}),o.prototype.readBigUInt64BE=et(function(t){W(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||Z(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)}),o.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||T(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*e)),n},o.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||T(t,e,this.length);let n=e,i=1,o=this[t+--n];for(;n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},o.prototype.readInt8=function(t,e){return t>>>=0,e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},o.prototype.readInt16LE=function(t,e){t>>>=0,e||T(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt16BE=function(t,e){t>>>=0,e||T(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt32LE=function(t,e){return t>>>=0,e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},o.prototype.readInt32BE=function(t,e){return t>>>=0,e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},o.prototype.readBigInt64LE=et(function(t){W(t>>>=0,"offset");const e=this[t],r=this[t+7];return void 0!==e&&void 0!==r||Z(t,this.length-8),(BigInt(this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24))<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)}),o.prototype.readBigInt64BE=et(function(t){W(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||Z(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+r)}),o.prototype.readFloatLE=function(t,e){return t>>>=0,e||T(t,4,this.length),p(this,t,!0,23,4)},o.prototype.readFloatBE=function(t,e){return t>>>=0,e||T(t,4,this.length),p(this,t,!1,23,4)},o.prototype.readDoubleLE=function(t,e){return t>>>=0,e||T(t,8,this.length),p(this,t,!0,52,8)},o.prototype.readDoubleBE=function(t,e){return t>>>=0,e||T(t,8,this.length),p(this,t,!1,52,8)},o.prototype.writeUintLE=o.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||j(this,t,e,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||j(this,t,e,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},o.prototype.writeUint8=o.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,1,255,0),this[e]=255&t,e+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},o.prototype.writeBigUInt64LE=et(function(t,e=0){return M(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=et(function(t,e=0){return L(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);j(this,t,e,r,n-1,-n)}let i=0,o=1,s=0;for(this[e]=255&t;++i<r&&(o*=256);)t<0&&0===s&&0!==this[e+i-1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+r},o.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);j(this,t,e,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+r},o.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},o.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},o.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},o.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},o.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||j(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},o.prototype.writeBigInt64LE=et(function(t,e=0){return M(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=et(function(t,e=0){return L(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeFloatLE=function(t,e,r){return F(this,t,e,!0,r)},o.prototype.writeFloatBE=function(t,e,r){return F(this,t,e,!1,r)},o.prototype.writeDoubleLE=function(t,e,r){return G(this,t,e,!0,r)},o.prototype.writeDoubleBE=function(t,e,r){return G(this,t,e,!1,r)},o.prototype.copy=function(t,e,r,n){if(!o.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);const i=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),i},o.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!o.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){const e=t.charCodeAt(0);("utf8"===n&&e<128||"latin1"===n)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;let i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{const s=o.isBuffer(t)?t:o.from(t,n),u=s.length;if(0===u)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<r-e;++i)this[i+e]=s[i%u]}return this};const H={};function z(t,e,r){H[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function D(t){let e="",r=t.length;const n="-"===t[0]?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function q(t,e,r,n,i,o){if(t>r||t<e){const n="bigint"==typeof e?"n":"";let i;throw i=o>3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new H.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){W(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||Z(e,t.length-(r+1))}(n,i,o)}function W(t,e){if("number"!=typeof t)throw new H.ERR_INVALID_ARG_TYPE(e,"number",t)}function Z(t,e,r){if(Math.floor(t)!==t)throw W(t,r),new H.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new H.ERR_BUFFER_OUT_OF_BOUNDS;throw new H.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}z("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),z("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError),z("ERR_OUT_OF_RANGE",function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=D(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=D(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n},RangeError);const V=/[^+/0-9A-Za-z-_]/g;function J(t,e){let r;e=e||Infinity;const n=t.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=t.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function K(t){return function(t){var e,r,n=function(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}(t),i=n[0],o=n[1],s=new f(function(t,e,r){return 3*(e+r)/4-r}(0,i,o)),a=0,c=o>0?i-4:i;for(r=0;r<c;r+=4)e=u[t.charCodeAt(r)]<<18|u[t.charCodeAt(r+1)]<<12|u[t.charCodeAt(r+2)]<<6|u[t.charCodeAt(r+3)],s[a++]=e>>16&255,s[a++]=e>>8&255,s[a++]=255&e;return 2===o&&(e=u[t.charCodeAt(r)]<<2|u[t.charCodeAt(r+1)]>>4,s[a++]=255&e),1===o&&(e=u[t.charCodeAt(r)]<<10|u[t.charCodeAt(r+1)]<<4|u[t.charCodeAt(r+2)]>>2,s[a++]=e>>8&255,s[a++]=255&e),s}(function(t){if((t=(t=t.split("=")[0]).trim().replace(V,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function Y(t,e,r,n){let i;for(i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function X(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Q(t){return t!=t}const tt=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function et(t){return"undefined"==typeof BigInt?rt:t}function rt(){throw new Error("BigInt not supported")}}),y=function(t,e){return function(r,n){var i=2*n,o=2*e;r[i]=t[o],r[i+1]=t[o+1]}},m=o(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,n=(r=y)&&r.__esModule?r:{default:r};e.default=function(t){for(var e=t.A,r=t.C,i=0;i<25;i+=5){for(var o=0;o<5;o++)(0,n.default)(e,i+o)(r,o);for(var s=0;s<5;s++){var u=2*(i+s),f=(s+1)%5*2,a=(s+2)%5*2;e[u]^=~r[f]&r[a],e[u+1]^=~r[f+1]&r[a+1]}}}}),v=o(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=new Uint32Array([0,1,0,32898,2147483648,32906,2147483648,2147516416,0,32907,0,2147483649,2147483648,2147516545,2147483648,32777,0,138,0,136,0,2147516425,0,2147483658,0,2147516555,2147483648,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,0,32778,2147483648,2147483658,2147483648,2147516545,2147483648,32896,0,2147483649,2147483648,2147516424]);e.default=r}),w=o(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,n=(r=v)&&r.__esModule?r:{default:r};e.default=function(t){var e=t.A,r=2*t.roundIndex;e[0]^=n.default[r],e[1]^=n.default[r+1]}}),b=o(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.default=[10,7,11,17,18,3,5,16,8,21,24,4,15,23,19,13,12,2,20,14,22,9,6,1]}),E=o(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,e.default=[1,3,6,10,15,21,28,36,45,55,2,14,27,41,56,8,25,43,62,18,39,61,20,44]}),x=o(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=o(b),n=o(E),i=o(y);function o(t){return t&&t.__esModule?t:{default:t}}e.default=function(t){var e=t.A,o=t.C,s=t.W;(0,i.default)(e,1)(s,0);for(var u=0,f=0,a=0,c=32,h=0;h<24;h++){var l=r.default[h],p=n.default[h];(0,i.default)(e,l)(o,0),s[a=p<32?0:1]=(u=s[0])<<p|(f=s[1])>>>(c=32-p),s[(a+1)%2]=f<<p|u>>>c,(0,i.default)(s,0)(e,l),(0,i.default)(o,0)(s,0)}}}),A=o(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,n=(r=y)&&r.__esModule?r:{default:r};e.default=function(t){for(var e=t.A,r=t.C,i=t.D,o=t.W,s=0,u=0,f=0;f<5;f++){var a=2*f,c=2*(f+5),h=2*(f+10),l=2*(f+15),p=2*(f+20);r[a]=e[a]^e[c]^e[h]^e[l]^e[p],r[a+1]=e[a+1]^e[c+1]^e[h+1]^e[l+1]^e[p+1]}for(var g=0;g<5;g++){(0,n.default)(r,(g+1)%5)(o,0),o[0]=(s=o[0])<<1|(u=o[1])>>>31,o[1]=u<<1|s>>>31,i[2*g]=r[(g+4)%5*2]^o[0],i[2*g+1]=r[(g+4)%5*2+1]^o[1];for(var d=0;d<25;d+=5)e[2*(d+g)]^=i[2*g],e[2*(d+g)+1]^=i[2*g+1]}}}),B=o(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=s(m),n=s(w),i=s(x),o=s(A);function s(t){return t&&t.__esModule?t:{default:t}}e.default=function(){var t=new Uint32Array(10),e=new Uint32Array(10),s=new Uint32Array(2);return function(u){for(var f=0;f<24;f++)(0,o.default)({A:u,C:t,D:e,W:s}),(0,i.default)({A:u,C:t,W:s}),(0,r.default)({A:u,C:t}),(0,n.default)({A:u,roundIndex:f});t.fill(0),e.fill(0),s.fill(0)}}}),P=o(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,n=(r=B)&&r.__esModule?r:{default:r},i=function(t,e){for(var r=0;r<t.length;r+=8){var n=r/4;e[n]^=t[r+7]<<24|t[r+6]<<16|t[r+5]<<8|t[r+4],e[n+1]^=t[r+3]<<24|t[r+2]<<16|t[r+1]<<8|t[r]}return e},o=function(t,e){for(var r=0;r<e.length;r+=8){var n=r/4;e[r]=t[n+1],e[r+1]=t[n+1]>>>8,e[r+2]=t[n+1]>>>16,e[r+3]=t[n+1]>>>24,e[r+4]=t[n],e[r+5]=t[n]>>>8,e[r+6]=t[n]>>>16,e[r+7]=t[n]>>>24}return e};e.default=function(t){var e=this,r=t.capacity,s=t.padding,u=(0,n.default)(),f=r/8,a=200-r/4,c=0,h=new Uint32Array(50),l=d.Buffer.allocUnsafe(a);return this.absorb=function(t){for(var r=0;r<t.length;r++)l[c]=t[r],(c+=1)>=a&&(i(l,h),u(h),c=0);return e},this.squeeze=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={buffer:t.buffer||d.Buffer.allocUnsafe(f),padding:t.padding||s,queue:d.Buffer.allocUnsafe(l.length),state:new Uint32Array(h.length)};l.copy(e.queue);for(var r=0;r<h.length;r++)e.state[r]=h[r];e.queue.fill(0,c),e.queue[c]|=e.padding,e.queue[a-1]|=128,i(e.queue,e.state);for(var n=0;n<e.buffer.length;n+=a)u(e.state),o(e.state,e.buffer.slice(n,n+a));return e.buffer},this.reset=function(){return l.fill(0),h.fill(0),c=0,e},this}}),I=o(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.SHAKE=e.SHA3Hash=e.SHA3=e.Keccak=void 0;var r,n=(r=P)&&r.__esModule?r:{default:r},i=function(t){var e=t.allowedSizes,r=t.defaultSize,i=t.padding;return function t(){var o=this,s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r;if(!this||this.constructor!==t)return new t(s);if(e&&!e.includes(s))throw new Error("Unsupported hash length");var u=new n.default({capacity:s});return this.update=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8";if(d.Buffer.isBuffer(t))return u.absorb(t),o;if("string"==typeof t)return o.update(d.Buffer.from(t,e));throw new TypeError("Not a string or buffer")},this.digest=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"binary",e="string"==typeof t?{format:t}:t,r=u.squeeze({buffer:e.buffer,padding:e.padding||i});return e.format&&"binary"!==e.format?r.toString(e.format):r},this.reset=function(){return u.reset(),o},this}},o=i({allowedSizes:[224,256,384,512],defaultSize:512,padding:1});e.Keccak=o;var s=i({allowedSizes:[224,256,384,512],defaultSize:512,padding:6});e.SHA3=s;var u=i({allowedSizes:[128,256],defaultSize:256,padding:31});e.SHAKE=u;var f=o;e.SHA3Hash=f,s.SHA3Hash=f,e.default=s}),S=1e6,U="[big.js] ",_=U+"Invalid ",R=_+"decimal places",k=U+"Division by zero",O={},N=void 0,C=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;function T(t,e,r,n){var i=t.c;if(r===N&&(r=t.constructor.RM),0!==r&&1!==r&&2!==r&&3!==r)throw Error("[big.js] Invalid rounding mode");if(e<1)n=3===r&&(n||!!i[0])||0===e&&(1===r&&i[0]>=5||2===r&&(i[0]>5||5===i[0]&&(n||i[1]!==N))),i.length=1,n?(t.e=t.e-e+1,i[0]=1):i[0]=t.e=0;else if(e<i.length){if(n=1===r&&i[e]>=5||2===r&&(i[e]>5||5===i[e]&&(n||i[e+1]!==N||1&i[e-1]))||3===r&&(n||!!i[0]),i.length=e,n)for(;++i[--e]>9;)if(i[e]=0,0===e){++t.e,i.unshift(1);break}for(e=i.length;!i[--e];)i.pop()}return t}function j(t,e,r){var n=t.e,i=t.c.join(""),o=i.length;if(e)i=i.charAt(0)+(o>1?"."+i.slice(1):"")+(n<0?"e":"e+")+n;else if(n<0){for(;++n;)i="0"+i;i="0."+i}else if(n>0)if(++n>o)for(n-=o;n--;)i+="0";else n<o&&(i=i.slice(0,n)+"."+i.slice(n));else o>1&&(i=i.charAt(0)+"."+i.slice(1));return t.s<0&&r?"-"+i:i}O.abs=function(){var t=new this.constructor(this);return t.s=1,t},O.cmp=function(t){var e,r=this,n=r.c,i=(t=new r.constructor(t)).c,o=r.s,s=t.s,u=r.e,f=t.e;if(!n[0]||!i[0])return n[0]?o:i[0]?-s:0;if(o!=s)return o;if(e=o<0,u!=f)return u>f^e?1:-1;for(s=(u=n.length)<(f=i.length)?u:f,o=-1;++o<s;)if(n[o]!=i[o])return n[o]>i[o]^e?1:-1;return u==f?0:u>f^e?1:-1},O.div=function(t){var e=this,r=e.constructor,n=e.c,i=(t=new r(t)).c,o=e.s==t.s?1:-1,s=r.DP;if(s!==~~s||s<0||s>S)throw Error(R);if(!i[0])throw Error(k);if(!n[0])return t.s=o,t.c=[t.e=0],t;var u,f,a,c,h,l=i.slice(),p=u=i.length,g=n.length,d=n.slice(0,u),y=d.length,m=t,v=m.c=[],w=0,b=s+(m.e=e.e-t.e)+1;for(m.s=o,o=b<0?0:b,l.unshift(0);y++<u;)d.push(0);do{for(a=0;a<10;a++){if(u!=(y=d.length))c=u>y?1:-1;else for(h=-1,c=0;++h<u;)if(i[h]!=d[h]){c=i[h]>d[h]?1:-1;break}if(!(c<0))break;for(f=y==u?i:l;y;){if(d[--y]<f[y]){for(h=y;h&&!d[--h];)d[h]=9;--d[h],d[y]+=10}d[y]-=f[y]}for(;!d[0];)d.shift()}v[w++]=c?a:++a,d[0]&&c?d[y]=n[p]||0:d=[n[p]]}while((p++<g||d[0]!==N)&&o--);return v[0]||1==w||(v.shift(),m.e--,b--),w>b&&T(m,b,r.RM,d[0]!==N),m},O.eq=function(t){return 0===this.cmp(t)},O.gt=function(t){return this.cmp(t)>0},O.gte=function(t){return this.cmp(t)>-1},O.lt=function(t){return this.cmp(t)<0},O.lte=function(t){return this.cmp(t)<1},O.minus=O.sub=function(t){var e,r,n,i,o=this,s=o.constructor,u=o.s,f=(t=new s(t)).s;if(u!=f)return t.s=-f,o.plus(t);var a=o.c.slice(),c=o.e,h=t.c,l=t.e;if(!a[0]||!h[0])return h[0]?t.s=-f:a[0]?t=new s(o):t.s=1,t;if(u=c-l){for((i=u<0)?(u=-u,n=a):(l=c,n=h),n.reverse(),f=u;f--;)n.push(0);n.reverse()}else for(r=((i=a.length<h.length)?a:h).length,u=f=0;f<r;f++)if(a[f]!=h[f]){i=a[f]<h[f];break}if(i&&(n=a,a=h,h=n,t.s=-t.s),(f=(r=h.length)-(e=a.length))>0)for(;f--;)a[e++]=0;for(f=e;r>u;){if(a[--r]<h[r]){for(e=r;e&&!a[--e];)a[e]=9;--a[e],a[r]+=10}a[r]-=h[r]}for(;0===a[--f];)a.pop();for(;0===a[0];)a.shift(),--l;return a[0]||(t.s=1,a=[l=0]),t.c=a,t.e=l,t},O.mod=function(t){var e,r=this,n=r.constructor,i=r.s,o=(t=new n(t)).s;if(!t.c[0])throw Error(k);return r.s=t.s=1,e=1==t.cmp(r),r.s=i,t.s=o,e?new n(r):(i=n.DP,o=n.RM,n.DP=n.RM=0,r=r.div(t),n.DP=i,n.RM=o,this.minus(r.times(t)))},O.neg=function(){var t=new this.constructor(this);return t.s=-t.s,t},O.plus=O.add=function(t){var e,r,n,i=this,o=i.constructor;if(t=new o(t),i.s!=t.s)return t.s=-t.s,i.minus(t);var s=i.e,u=i.c,f=t.e,a=t.c;if(!u[0]||!a[0])return a[0]||(u[0]?t=new o(i):t.s=i.s),t;if(u=u.slice(),e=s-f){for(e>0?(f=s,n=a):(e=-e,n=u),n.reverse();e--;)n.push(0);n.reverse()}for(u.length-a.length<0&&(n=a,a=u,u=n),e=a.length,r=0;e;u[e]%=10)r=(u[--e]=u[e]+a[e]+r)/10|0;for(r&&(u.unshift(r),++f),e=u.length;0===u[--e];)u.pop();return t.c=u,t.e=f,t},O.pow=function(t){var e=this,r=new e.constructor("1"),n=r,i=t<0;if(t!==~~t||t<-1e6||t>1e6)throw Error(_+"exponent");for(i&&(t=-t);1&t&&(n=n.times(e)),t>>=1;)e=e.times(e);return i?r.div(n):n},O.prec=function(t,e){if(t!==~~t||t<1||t>S)throw Error(_+"precision");return T(new this.constructor(this),t,e)},O.round=function(t,e){if(t===N)t=0;else if(t!==~~t||t<-S||t>S)throw Error(R);return T(new this.constructor(this),t+this.e+1,e)},O.sqrt=function(){var t,e,r,n=this,i=n.constructor,o=n.s,s=n.e,u=new i("0.5");if(!n.c[0])return new i(n);if(o<0)throw Error(U+"No square root");0===(o=Math.sqrt(n+""))||o===1/0?((e=n.c.join("")).length+s&1||(e+="0"),s=((s+1)/2|0)-(s<0||1&s),t=new i(((o=Math.sqrt(e))==1/0?"5e":(o=o.toExponential()).slice(0,o.indexOf("e")+1))+s)):t=new i(o+""),s=t.e+(i.DP+=4);do{t=u.times((r=t).plus(n.div(r)))}while(r.c.slice(0,s).join("")!==t.c.slice(0,s).join(""));return T(t,(i.DP-=4)+t.e+1,i.RM)},O.times=O.mul=function(t){var e,r=this,n=r.c,i=(t=new(0,r.constructor)(t)).c,o=n.length,s=i.length,u=r.e,f=t.e;if(t.s=r.s==t.s?1:-1,!n[0]||!i[0])return t.c=[t.e=0],t;for(t.e=u+f,o<s&&(e=n,n=i,i=e,f=o,o=s,s=f),e=new Array(f=o+s);f--;)e[f]=0;for(u=s;u--;){for(s=0,f=o+u;f>u;)s=e[f]+i[u]*n[f-u-1]+s,e[f--]=s%10,s=s/10|0;e[f]=s}for(s?++t.e:e.shift(),u=e.length;!e[--u];)e.pop();return t.c=e,t},O.toExponential=function(t,e){var r=this,n=r.c[0];if(t!==N){if(t!==~~t||t<0||t>S)throw Error(R);for(r=T(new r.constructor(r),++t,e);r.c.length<t;)r.c.push(0)}return j(r,!0,!!n)},O.toFixed=function(t,e){var r=this,n=r.c[0];if(t!==N){if(t!==~~t||t<0||t>S)throw Error(R);for(t=t+(r=T(new r.constructor(r),t+r.e+1,e)).e+1;r.c.length<t;)r.c.push(0)}return j(r,!1,!!n)},O[Symbol.for("nodejs.util.inspect.custom")]=O.toJSON=O.toString=function(){var t=this,e=t.constructor;return j(t,t.e<=e.NE||t.e>=e.PE,!!t.c[0])},O.toNumber=function(){var t=Number(j(this,!0,!0));if(!0===this.constructor.strict&&!this.eq(t.toString()))throw Error(U+"Imprecise conversion");return t},O.toPrecision=function(t,e){var r=this,n=r.constructor,i=r.c[0];if(t!==N){if(t!==~~t||t<1||t>S)throw Error(_+"precision");for(r=T(new n(r),t,e);r.c.length<t;)r.c.push(0)}return j(r,t<=r.e||r.e<=n.NE||r.e>=n.PE,!!i)},O.valueOf=function(){var t=this,e=t.constructor;if(!0===e.strict)throw Error(U+"valueOf disallowed");return j(t,t.e<=e.NE||t.e>=e.PE,!0)};var M=function t(){function e(r){var n=this;if(!(n instanceof e))return r===N?t():new e(r);if(r instanceof e)n.s=r.s,n.e=r.e,n.c=r.c.slice();else{if("string"!=typeof r){if(!0===e.strict&&"bigint"!=typeof r)throw TypeError(_+"value");r=0===r&&1/r<0?"-0":String(r)}!function(t,e){var r,n,i;if(!C.test(e))throw Error(_+"number");for(t.s="-"==e.charAt(0)?(e=e.slice(1),-1):1,(r=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(r<0&&(r=n),r+=+e.slice(n+1),e=e.substring(0,n)):r<0&&(r=e.length),i=e.length,n=0;n<i&&"0"==e.charAt(n);)++n;if(n==i)t.c=[t.e=0];else{for(;i>0&&"0"==e.charAt(--i););for(t.e=r-n-1,t.c=[],r=0;n<=i;)t.c[r++]=+e.charAt(n++)}}(n,r)}n.constructor=e}return e.prototype=O,e.DP=20,e.RM=1,e.NE=-7,e.PE=21,e.strict=!1,e.roundDown=0,e.roundHalfUp=1,e.roundHalfEven=2,e.roundUp=3,e}();function L(t){return BigInt(t).toString()}function $(t){var e=t.startsWith("-");return(t=(t=(t=t.replace("-","")).replace(/\.0*$/g,"")).replace(/^0+/,"")).includes(".")&&(t=t.replace(/0+$/,"")),t.startsWith(".")&&(t="0"+t),(e?"-":"")+t}function F(t){if(!t.match(/e/i))return $(t);var e=t.split(/e/i),r=e[0],n=e[1],i=Number(r)<0,o=(r=$(r=r.replace("-",""))).split("."),s=o[0],u=o[1],f=void 0===u?"":u;if(0===Number(n))return(i?"-":"")+$(r);r.includes(".")||(r+=".");var a,c=(r=r.replace(".","")).length;return Number(n)<0?(s.length<Math.abs(Number(n))&&(r=r.padStart(c+Math.abs(Number(n))-s.length,"0")),a=r.split(""),s.length<Math.abs(Number(n))?a=["."].concat(a):a.splice(a.length-Math.abs(Number(n)),0,".")):(f.length<Math.abs(Number(n))&&(r=r.padEnd(c+Math.abs(Number(n))-f.length,"0")),a=r.split(""),f.length>Math.abs(Number(n))&&a.splice(a.length-Math.abs(Number(n)),0,".")),(i?"-":"")+$(a.join(""))}var G=/*#__PURE__*/function(t){function e(e){var r;return"string"==typeof e&&e.startsWith("0x")&&(e=L(e)),(r=t.call(this,e)||this).padAndChop=function(t,e,r){return(Array(r).fill(e).join("")+t).slice(-1*r)},r}n(e,t);var r=e.prototype;return r.toHexString=function(){return"0x"+BigInt(this.toString()).toString(16)},r.toNumber=function(){return Number(F(t.prototype.toString.call(this)))},r.toString=function(){return 0===this.toNumber()?"0":F(t.prototype.toString.call(this))},r.toTwos=function(t){var e;if(this.gte(0)){var r=this.toNumber().toString(2);e=this.padAndChop(r,"0",t||r.length)}else if(e=this.plus(Math.pow(2,t)).toNumber().toString(2),Number(e)<0)throw new Error("Cannot calculate twos complement");return H(Number("0b"+e))},e}(M);function H(t){return new G(t)}var z=function(t,e){if(!e.includes(typeof t))throw new Error(e.join(" or ")+" required. Received "+typeof t)};function D(t){if(z(t,["string"]),!/^(0x)?[0-9a-f]{40}$/i.test(t))throw new Error('Invalid Ethereum address "'+t+'"');for(var e=t.toLowerCase().replace(/^0x/i,""),r=new I.Keccak(256).update(e).digest("hex").replace(/^0x/i,""),n="0x",i=0;i<e.length;i++)parseInt(r[i],16)>7?n+=e[i].toUpperCase():n+=e[i];if(t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&n!==t)throw new Error('Invalid Checksum address for "'+t+'"');return n}var q="0".repeat(64),W="0".repeat(63)+"1";function Z(t,e){var r=new I.Keccak(256),n=t.name+"("+t.inputs.map(function(t){return"uint[]"===(e=t.type)?"uint256[]":"int[]"===e?"int256[]":e;var e})+")",i=r.update(n).digest("hex"),o=t.inputs.length,s=!0;if(t.inputs.find(function(t){return t.type.includes("[")})&&(s=!1),s&&e.length!==o)throw new Error('args inputs of "'+e.length+'" does not match expected length of "'+t.inputs.length+'"');var u=(t.inputs||[]).reduce(function(t,r,n){if(r.type.includes("[")){var i,o=null==(i=/([^[]*)\[.*$/g.exec(r.type))?void 0:i[1];return e.forEach(function(e){t=t.concat([[e,o]])}),t}return t.concat([[e[n],r.type]])},[]),f=u.map(function(t){var e=t[0],r=t[1],n=e;switch(r){case"bool":return e?W:q;case"address":n=e.replace(/^0x/g,"").toLowerCase();break;default:if(r.startsWith("bytes"))return n.split("").map(function(t){return t.charCodeAt(0).toString(16)}).join("").padEnd(64,"0");if("uint256"===r)return BigInt(e).toString(16).padStart(64,"0");if(r.startsWith("uint"))break;throw new Error('essential-eth does not yet support "'+r+'" inputs. Make a PR today!"')}return n.toString(16).padStart(64,"0")});return"0x"+i.slice(0,8)+f.join("")}function V(t,e){var r,n=t.outputs,i=e.slice(2);if(1===(null==t||null==(r=t.outputs)?void 0:r.length)&&"string"===t.outputs[0].type){var o=[i.slice(0,64),i.slice(64)],s=o[1],u=Number(L("0x"+o[0])),f=s.slice(0,2*u),a=Number(L("0x"+f));return function(t){var e="",r=0,n=t.length;for("0x"===t.substring(0,2)&&(r=2);r<n;r+=2){var i=parseInt(t.substr(r,2),16);0!==i&&(e+=String.fromCharCode(i))}try{return decodeURIComponent(escape(e))}catch(t){return e}}(s.slice(2*u,2*u+2*a))}var c=(i.match(/.{1,64}/g)||[]).map(function(t,e){var r=(n||[])[e].type;switch(r){case"bool":return t===W;case"address":return D("0x"+t.slice(24));case"uint256":case"uint120":return H(L("0x"+t));case"bytes32":return"0x"+t;case"uint8":return Number(L("0x"+t));default:throw new Error('essential-eth does not yet support "'+r+'" outputs. Make a PR today!"')}});return 1===c.length?c[0]:c}function J(t){t.split("").reduce(function(t,e){return t+("0"===e?4:68)},0)}var K=function(t,e,n){var i=this,o=this;this._address=void 0,this._provider=void 0,this._address=t,this._provider=n,e.filter(function(t){return"function"===t.type}).forEach(function(t){var e;"name"in t&&"string"==typeof t.name&&(e=function(){try{var e=arguments,n=[].slice.call(e),i=n,s={},u=n[n.length-1];Array.isArray(u)||"object"!=typeof u||(s=u,i=n.slice(0,n.length-1));var f=Z(t,i),a="number"==typeof s.gasLimit?s.gasLimit:"number"==typeof(null==t?void 0:t.gas)?J(f):null,c=function(){try{return Promise.resolve(o._provider.call(r({to:o._address.toLowerCase(),data:f},a?{gas:"0x"+a.toString(16)}:{}),"latest"))}catch(t){return Promise.reject(t)}};return Promise.resolve(c()).then(function(e){return V(t,e)})}catch(t){return Promise.reject(t)}},Object.defineProperty(i,t.name,{enumerable:!0,value:e,writable:!1}))})},Y=/*#__PURE__*/function(t){function e(){return t.apply(this,arguments)||this}return n(e,t),e}(K);function X(t){var e=r({},t);return Object.keys(t).forEach(function(r){if(t[r])switch(r){case"blockNumber":case"chainId":case"transactionIndex":case"type":case"v":e[r]=Number(L(t[r]));break;case"from":case"to":t[r]&&(e[r]=D(t[r]));break;case"value":case"gas":case"gasPrice":case"maxFeePerGas":case"maxPriorityFeePerGas":case"nonce":e[r]=H(L(t[r]))}}),e}function Q(t,e){var n=r({},t);return Object.keys(t).forEach(function(r){switch(r){case"address":n[r]=D(t[r]);break;case"blockNumber":case"logIndex":case"transactionIndex":n[r]=Number(L(t[r]));break;case"removed":e&&delete n[r]}}),n}var tt={__proto__:null,default:function(t,e){return e=e||{},new Promise(function(r,n){var i=new XMLHttpRequest,o=[],s=[],u={},f=function(){return{ok:2==(i.status/100|0),statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(i.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:f,headers:{keys:function(){return o},entries:function(){return s},get:function(t){return u[t.toLowerCase()]},has:function(t){return t.toLowerCase()in u}}}};for(var a in i.open(e.method||"get",t,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(t,e,r){o.push(e=e.toLowerCase()),s.push([e,r]),u[e]=u[e]?u[e]+","+r:r}),r(f())},i.onerror=n,i.withCredentials="include"==e.credentials,e.headers)i.setRequestHeader(a,e.headers[a]);i.send(e.body||null)})}},et=self.fetch||(self.fetch=tt.default||tt);function rt(t,e){return{jsonrpc:"2.0",id:1,method:t,params:e}}var nt=new(/*#__PURE__*/function(){function t(){this.packageVersion=void 0,this.packageVersion="0.9.1-next.1"}var e=t.prototype;return e.throwError=function(t,e){var r=Object.keys(e).length;throw new Error(t+" ("+Object.entries(e).map(function(t,e){return t[0]+"="+t[1]+(e<r-1&&", ")})+", version=essential-eth@"+this.packageVersion+")")},e.throwArgumentError=function(t,e,r){throw new Error(t+' (argument="'+e+'" value='+r+", version=essential-eth@"+this.packageVersion+")")},e.checkSafeUint53=function(t,e){void 0===e&&(e="value not safe"),"number"==typeof t&&((t<0||t>=9007199254740991)&&this.throwError(e,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,{operation:"checkSafeInteger",fault:"non-integer",value:t}))},t}());function it(t){return!!t.toHexString}function ot(t){return ht(t)&&!(t.length%2)||ut(t)}function st(t){return"number"==typeof t&&t==t&&t%1==0}function ut(t){if(null==t)return!1;if(t.constructor===Uint8Array)return!0;if("string"==typeof t)return!1;if(!st(t.length)||t.length<0)return!1;for(var e=0;e<t.length;e++){var r=t[e];if(!st(r)||r<0||r>=256)return!1}return!0}function ft(t,e){if(e||(e={}),"number"==typeof t){nt.checkSafeUint53(t,"invalid arrayify value");for(var r=[];t;)r.unshift(255&t),t=parseInt(String(t/256));return 0===r.length&&r.push(0),new Uint8Array(r)}if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),it(t)&&(t=t.toHexString()),ht(t)){var n=t.substring(2);n.length%2&&("left"===e.hexPad?n="0"+n:"right"===e.hexPad?n+="0":nt.throwArgumentError("hex data is odd-length","value",t));for(var i=[],o=0;o<n.length;o+=2)i.push(parseInt(n.substring(o,o+2),16));return new Uint8Array(i)}return ut(t)?new Uint8Array(t):nt.throwArgumentError("invalid arrayify value","value",t)}function at(t){var e=t.map(function(t){return ft(t)}),r=e.reduce(function(t,e){return t+e.length},0),n=new Uint8Array(r);return e.reduce(function(t,e){return n.set(e,t),t+e.length},0),n}function ct(t,e){(t=ft(t)).length>e&&nt.throwArgumentError("value out of range","value",t);var r=new Uint8Array(e);return r.set(t,e-t.length),r}function ht(t,e){return!("string"!=typeof t||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}var lt="0123456789abcdef";function pt(t,e){if(e||(e={}),"number"==typeof t){nt.checkSafeUint53(t,"invalid hexlify value");for(var r="";t;)r=lt[15&t]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if("bigint"==typeof t)return(t=t.toString(16)).length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),it(t))return t.toHexString();if(ht(t))return t.length%2&&("left"===e.hexPad?t="0x0"+t.substring(2):"right"===e.hexPad?t+="0":nt.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(ut(t)){for(var n="0x",i=0;i<t.length;i++){var o=t[i];n+=lt[(240&o)>>4]+lt[15&o]}return n}return nt.throwArgumentError("invalid hexlify value","value",t)}function gt(t,e,r){return"string"!=typeof t?t=pt(t):(!ht(t)||t.length%2)&&nt.throwArgumentError("invalid hexData","value",t),e=2+2*e,null!=r?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function dt(t){"string"!=typeof t&&(t=pt(t)),ht(t)||nt.throwArgumentError("invalid hex string","value",t),t=t.substring(2);for(var e=0;e<t.length&&"0"===t[e];)e++;return"0x"+t.substring(e)}function yt(t,e){for("string"!=typeof t?t=pt(t):ht(t)||nt.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&nt.throwError("value out of range",{value:t,length:e});t.length<2*e+2;)t="0x0"+t.substring(2);return t}function mt(t){var e=r({},t);return Object.keys(t).forEach(function(r){switch(r){case"gas":case"gasPrice":case"nonce":case"maxFeePerGas":case"maxPriorityFeePerGas":case"value":var n=t[r];e[r]=n instanceof G?n.toHexString():n instanceof M?"0x"+BigInt(n.toString()).toString(16):"number"==typeof t[r]?"0x"+t[r].toString(16):t[r].toString();break;case"data":e[r]=pt(t[r])}}),e}var vt={1:["eth","0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"],5:["gor","0x112234455c3a32fd11230c42e7bccd4a84e02010"],10:["oeth"],50:["xdc"],56:["bnb"],100:["gno"],137:["matic"],250:["ftm"],324:["zksync"],1101:["zkevm"],1337:["geth"],7700:["canto"],9001:["evmos"],42161:["arb1"],42220:["celo"],43114:["avax"],59140:["linea-testnet"],80001:["maticmum"],421613:["arb-goerli"],534352:["scr"],11155111:["sep"]};function wt(t){return"number"==typeof t?H(t).toHexString():t}var bt=/*#__PURE__*/function(){function t(t){var e=this;this._rpcUrls=[],this._post=function(t){return function(t,e){return et(t,function(t){return{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}}(e)).then(function(t){try{return Promise.resolve(t.text()).then(function(t){try{return JSON.parse(t)}catch(e){throw new Error('Invalid JSON RPC response: "'+t+'"')}})}catch(t){return Promise.reject(t)}}).then(function(t){if(!(null==t?void 0:t.result))throw new Error("Invalid JSON RPC response: "+JSON.stringify(t));return t.result})}(e.selectRpcUrl(),t)},this._rpcUrls=t}var e=t.prototype;return e.getNetwork=function(){try{return Promise.resolve(this.post(rt("eth_chainId",[]))).then(function(t){var e=L(t),r=vt[e];return{chainId:Number(e),name:r[0]||"unknown",ensAddress:r[1]||null}})}catch(t){return Promise.reject(t)}},e.getBlockNumber=function(){try{return Promise.resolve(this.post(rt("eth_blockNumber",[]))).then(function(t){return Number(L(t))})}catch(t){return Promise.reject(t)}},e.getTransaction=function(t){try{return Promise.resolve(Promise.all([this.post(rt("eth_getTransactionByHash",[t])),this.getBlock("latest")])).then(function(t){var e=t[1],r=X(t[0]);return r.confirmations=e.number-r.blockNumber+1,r})}catch(t){return Promise.reject(t)}},e.getTransactionReceipt=function(t){try{return Promise.resolve(Promise.all([this.post(rt("eth_getTransactionReceipt",[t])),this.getBlock("latest")])).then(function(t){var e=t[1],n=function(t){var e=r({},X(t));return Object.keys(t).forEach(function(r){if(t[r])switch(r){case"status":e[r]=Number(L(t[r]));break;case"contractAddress":t[r]&&(e[r]=D(t[r]));break;case"cumulativeGasUsed":case"effectiveGasPrice":case"gasUsed":e[r]=H(L(t[r]));break;case"logs":t[r].forEach(function(t,n){e[r][n]=Q(t,!0)})}}),e.byzantium=e.blockNumber>=437e4,e}(t[0]);return n.confirmations=e.number-n.blockNumber+1,n})}catch(t){return Promise.reject(t)}},e.getTransactionCount=function(t,e){void 0===e&&(e="latest");try{return e=wt(e),Promise.resolve(this.post(rt("eth_getTransactionCount",[t,e]))).then(function(t){return Number(L(t))})}catch(t){return Promise.reject(t)}},e.getBlock=function(t,e){void 0===t&&(t="latest"),void 0===e&&(e=!1);try{var n="Number";return"string"==typeof t&&66===t.length?n="Hash":t=wt(t),Promise.resolve(this.post(rt("eth_getBlockBy"+n,[t,e]))).then(function(t){return function(t,e){var n=r({},t);return Object.keys(t).forEach(function(e){if(t[e])switch(e){case"difficulty":case"totalDifficulty":case"gasLimit":case"gasUsed":case"size":case"timestamp":case"baseFeePerGas":n[e]=H(L(t[e]));break;case"number":n[e]=Number(L(t[e]));break;case"miner":n[e]=D(t[e])}}),e&&t.transactions.forEach(function(t,e){n.transactions[e]=X(t)}),n}(t,e)})}catch(t){return Promise.reject(t)}},e.getGasPrice=function(){try{return Promise.resolve(this.post(rt("eth_gasPrice",[]))).then(function(t){return H(L(t))})}catch(t){return Promise.reject(t)}},e.getBalance=function(t,e){void 0===e&&(e="latest");try{return e=wt(e),Promise.resolve(this.post(rt("eth_getBalance",[t,e]))).then(function(t){return H(L(t))})}catch(t){return Promise.reject(t)}},e.getCode=function(t,e){void 0===e&&(e="latest");try{return e=wt(e),Promise.resolve(this.post(rt("eth_getCode",[t,e])))}catch(t){return Promise.reject(t)}},e.estimateGas=function(t){try{var e=mt(t);return Promise.resolve(this.post(rt("eth_estimateGas",[e]))).then(function(t){return H(L(t))})}catch(t){return Promise.reject(t)}},e.getFeeData=function(){try{return Promise.resolve(Promise.all([this.getBlock("latest"),this.getGasPrice()])).then(function(t){var e=t[0],r=t[1],n=null,i=null,o=null;return e&&e.baseFeePerGas&&(n=e.baseFeePerGas,o=H("1500000000"),i=H(e.baseFeePerGas.mul(2).add(o))),{lastBaseFeePerGas:n,maxFeePerGas:i,maxPriorityFeePerGas:o,gasPrice:r}})}catch(t){return Promise.reject(t)}},e.getLogs=function(t){try{var e=t;return e.fromBlock&&(e.fromBlock=wt(e.fromBlock)),e.toBlock&&(e.toBlock=wt(e.toBlock)),Promise.resolve(this.post(rt("eth_getLogs",[t]))).then(function(t){return t.map(function(t){return Q(t,!1)})})}catch(t){return Promise.reject(t)}},e.call=function(t,e){void 0===e&&(e="latest");try{t.gasPrice&&(t.maxPriorityFeePerGas||t.maxFeePerGas)&&nt.throwError('Cannot specify both "gasPrice" and ("maxPriorityFeePerGas" or "maxFeePerGas")',{gasPrice:t.gasPrice,maxFeePerGas:t.maxFeePerGas,maxPriorityFeePerGas:t.maxPriorityFeePerGas}),t.maxFeePerGas&&t.maxPriorityFeePerGas&&nt.throwError('Cannot specify both "maxFeePerGas" and "maxPriorityFeePerGas"',{maxFeePerGas:t.maxFeePerGas,maxPriorityFeePerGas:t.maxPriorityFeePerGas}),e=wt(e);var r=mt(t);return Promise.resolve(this.post(rt("eth_call",[r,e])))}catch(t){return Promise.reject(t)}},t}(),Et=/*#__PURE__*/function(t){n(r,t);var e=r.prototype;function r(e){return void 0===e&&(e="https://free-eth-node.com/api/eth"),t.call(this,[e])||this}return e.selectRpcUrl=function(){return this._rpcUrls[0]},e.post=function(t){return this._post(t)},r}(bt),xt=/*#__PURE__*/function(t){function e(e,r){return void 0===r&&(r="mainnet"),t.call(this,"https://eth-"+r+".alchemyapi.io/v2/"+e)||this}return n(e,t),e}(Et),At=/*#__PURE__*/function(t){function e(e,r){var n;return void 0===r&&(r={}),Array.isArray(e)||nt.throwError("Array required",{rpcUrls:e}),e.length<=1&&nt.throwError("More than one rpcUrl is required",{rpcUrls:e}),(n=t.call(this,e)||this).rpcUrlCounter=0,n.timeoutDuration=void 0,n.post=function(t){var e=n.rpcUrlCounter;return function r(){var i,o,s=n.selectRpcUrl();return(i=n._post(t),o=n.timeoutDuration,new Promise(function(t,e){var r=setTimeout(function(){return e(new Error("Promise timed out"))},o);i.then(function(e){clearTimeout(r),t(e)}).catch(function(t){clearTimeout(r),e(t)})})).catch(function(t){if(s===n.selectRpcUrl()&&(n.rpcUrlCounter=(n.rpcUrlCounter+1)%n._rpcUrls.length),n.rpcUrlCounter===e)throw t;return r()})}()},n.timeoutDuration=r.timeoutDuration||8e3,n}return n(e,t),e.prototype.selectRpcUrl=function(){return this._rpcUrls[this.rpcUrlCounter]},e}(bt);const Bt=BigInt(0),Pt=BigInt(1),It=BigInt(2),St=BigInt(3),Ut=BigInt(8),_t=Object.freeze({a:Bt,b:BigInt(7),P:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:Pt,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee")}),Rt=(t,e)=>(t+e/It)/e,kt={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar(t){const{n:e}=_t,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-Pt*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=r,s=BigInt("0x100000000000000000000000000000000"),u=Rt(o*t,e),f=Rt(-n*t,e);let a=Xt(t-u*r-f*i,e),c=Xt(-u*n-f*o,e);const h=a>s,l=c>s;if(h&&(a=e-a),l&&(c=e-c),a>s||c>s)throw new Error("splitScalarEndo: Endomorphism failed, k="+t);return{k1neg:h,k1:a,k2neg:l,k2:c}}};function Ot(t){const{a:e,b:r}=_t,n=Xt(t*t),i=Xt(n*t);return Xt(i+e*t+r)}const Nt=_t.a===Bt;function Ct(t){if(!(t instanceof Tt))throw new TypeError("JacobianPoint expected")}class Tt{constructor(t,e,r){this.x=t,this.y=e,this.z=r}static fromAffine(t){if(!(t instanceof Lt))throw new TypeError("JacobianPoint#fromAffine: expected Point");return t.equals(Lt.ZERO)?Tt.ZERO:new Tt(t.x,t.y,Pt)}static toAffineBatch(t){const e=function(t,e=_t.P){const r=new Array(t.length),n=t.reduce((t,n,i)=>n===Bt?t:(r[i]=t,Xt(t*n,e)),Pt),i=te(n,e);return t.reduceRight((t,n,i)=>n===Bt?t:(r[i]=Xt(t*r[i],e),Xt(t*n,e)),i),r}(t.map(t=>t.z));return t.map((t,r)=>t.toAffine(e[r]))}static normalizeZ(t){return Tt.toAffineBatch(t).map(Tt.fromAffine)}equals(t){Ct(t);const{x:e,y:r,z:n}=this,{x:i,y:o,z:s}=t,u=Xt(n*n),f=Xt(s*s),a=Xt(e*f),c=Xt(i*u),h=Xt(Xt(r*s)*f),l=Xt(Xt(o*n)*u);return a===c&&h===l}negate(){return new Tt(this.x,Xt(-this.y),this.z)}double(){const{x:t,y:e,z:r}=this,n=Xt(t*t),i=Xt(e*e),o=Xt(i*i),s=t+i,u=Xt(It*(Xt(s*s)-n-o)),f=Xt(St*n),a=Xt(f*f),c=Xt(a-It*u),h=Xt(f*(u-c)-Ut*o),l=Xt(It*e*r);return new Tt(c,h,l)}add(t){Ct(t);const{x:e,y:r,z:n}=this,{x:i,y:o,z:s}=t;if(i===Bt||o===Bt)return this;if(e===Bt||r===Bt)return t;const u=Xt(n*n),f=Xt(s*s),a=Xt(e*f),c=Xt(i*u),h=Xt(Xt(r*s)*f),l=Xt(Xt(o*n)*u),p=Xt(c-a),g=Xt(l-h);if(p===Bt)return g===Bt?this.double():Tt.ZERO;const d=Xt(p*p),y=Xt(p*d),m=Xt(a*d),v=Xt(g*g-y-It*m),w=Xt(g*(m-v)-h*y),b=Xt(n*s*p);return new Tt(v,w,b)}subtract(t){return this.add(t.negate())}multiplyUnsafe(t){const e=Tt.ZERO;if("bigint"==typeof t&&t===Bt)return e;let r=Yt(t);if(r===Pt)return this;if(!Nt){let t=e,n=this;for(;r>Bt;)r&Pt&&(t=t.add(n)),n=n.double(),r>>=Pt;return t}let{k1neg:n,k1:i,k2neg:o,k2:s}=kt.splitScalar(r),u=e,f=e,a=this;for(;i>Bt||s>Bt;)i&Pt&&(u=u.add(a)),s&Pt&&(f=f.add(a)),a=a.double(),i>>=Pt,s>>=Pt;return n&&(u=u.negate()),o&&(f=f.negate()),f=new Tt(Xt(f.x*kt.beta),f.y,f.z),u.add(f)}precomputeWindow(t){const e=Nt?128/t+1:256/t+1,r=[];let n=this,i=n;for(let o=0;o<e;o++){i=n,r.push(i);for(let e=1;e<2**(t-1);e++)i=i.add(n),r.push(i);n=i.double()}return r}wNAF(t,e){!e&&this.equals(Tt.BASE)&&(e=Lt.BASE);const r=e&&e._WINDOW_SIZE||1;if(256%r)throw new Error("Point#wNAF: Invalid precomputation window, must be power of 2");let n=e&&Mt.get(e);n||(n=this.precomputeWindow(r),e&&1!==r&&(n=Tt.normalizeZ(n),Mt.set(e,n)));let i=Tt.ZERO,o=Tt.BASE;const s=1+(Nt?128/r:256/r),u=2**(r-1),f=BigInt(2**r-1),a=2**r,c=BigInt(r);for(let e=0;e<s;e++){const r=e*u;let s=Number(t&f);t>>=c,s>u&&(s-=a,t+=Pt);const h=r,l=r+Math.abs(s)-1,p=e%2!=0,g=s<0;0===s?o=o.add(jt(p,n[h])):i=i.add(jt(g,n[l]))}return{p:i,f:o}}multiply(t,e){let r,n,i=Yt(t);if(Nt){const{k1neg:t,k1:o,k2neg:s,k2:u}=kt.splitScalar(i);let{p:f,f:a}=this.wNAF(o,e),{p:c,f:h}=this.wNAF(u,e);f=jt(t,f),c=jt(s,c),c=new Tt(Xt(c.x*kt.beta),c.y,c.z),r=f.add(c),n=a.add(h)}else{const{p:t,f:o}=this.wNAF(i,e);r=t,n=o}return Tt.normalizeZ([r,n])[0]}toAffine(t){const{x:e,y:r,z:n}=this,i=this.equals(Tt.ZERO);null==t&&(t=i?Ut:te(n));const o=t,s=Xt(o*o),u=Xt(s*o),f=Xt(e*s),a=Xt(r*u),c=Xt(n*o);if(i)return Lt.ZERO;if(c!==Pt)throw new Error("invZ was invalid");return new Lt(f,a)}}function jt(t,e){const r=e.negate();return t?r:e}Tt.BASE=new Tt(_t.Gx,_t.Gy,Pt),Tt.ZERO=new Tt(Bt,Pt,Bt);const Mt=new WeakMap;class Lt{constructor(t,e){this.x=t,this.y=e}_setWindowSize(t){this._WINDOW_SIZE=t,Mt.delete(this)}hasEvenY(){return this.y%It===Bt}static fromCompressedHex(t){const e=32===t.length,r=Jt(e?t:t.subarray(1));if(!re(r))throw new Error("Point is not on curve");let n=function(t){const{P:e}=_t,r=BigInt(6),n=BigInt(11),i=BigInt(22),o=BigInt(23),s=BigInt(44),u=BigInt(88),f=t*t*t%e,a=f*f*t%e,c=Qt(a,St)*a%e,h=Qt(c,St)*a%e,l=Qt(h,It)*f%e,p=Qt(l,n)*l%e,g=Qt(p,i)*p%e,d=Qt(g,s)*g%e,y=Qt(d,u)*d%e,m=Qt(y,s)*g%e,v=Qt(m,St)*a%e,w=Qt(v,o)*p%e,b=Qt(w,r)*f%e,E=Qt(b,It);if(E*E%e!==t)throw new Error("Cannot find square root");return E}(Ot(r));const i=(n&Pt)===Pt;e?i&&(n=Xt(-n)):1==(1&t[0])!==i&&(n=Xt(-n));const o=new Lt(r,n);return o.assertValidity(),o}static fromUncompressedHex(t){const e=Jt(t.subarray(1,33)),r=Jt(t.subarray(33,65)),n=new Lt(e,r);return n.assertValidity(),n}static fromHex(t){const e=Kt(t),r=e.length,n=e[0];if(32===r)return this.fromCompressedHex(e);if(33===r&&(2===n||3===n))return this.fromCompressedHex(e);if(65===r&&4===n)return this.fromUncompressedHex(e);throw new Error(`Point.fromHex: received invalid point. Expected 32-33 compressed bytes or 65 uncompressed bytes, not ${r}`)}static fromPrivateKey(t){return Lt.BASE.multiply(function(t){let e;if("bigint"==typeof t)e=t;else if("number"==typeof t&&Number.isSafeInteger(t)&&t>0)e=BigInt(t);else if("string"==typeof t){if(64!==t.length)throw new Error("Expected 32 bytes of private key");e=Zt(t)}else{if(!(t instanceof Uint8Array))throw new TypeError("Expected valid private key");if(32!==t.length)throw new Error("Expected 32 bytes of private key");e=Jt(t)}if(!ee(e))throw new Error("Expected private key: 0 < key < n");return e}(t))}static fromSignature(t,e,r){const{r:n,s:i}=function(t){if(t instanceof Gt)return t.assertValidity(),t;try{return Gt.fromDER(t)}catch(e){return Gt.fromCompact(t)}}(e);if(![0,1,2,3].includes(r))throw new Error("Cannot recover: invalid recovery bit");const o=function(t,e=!1){const r=function(t){const e=8*t.length-256,r=Jt(t);return e>0?r>>BigInt(e):r}(t);if(e)return r;const{n:n}=_t;return r>=n?r-n:r}(Kt(t)),{n:s}=_t,u=2===r||3===r?n+s:n,f=te(u,s),a=Xt(-o*f,s),c=Xt(i*f,s),h=Lt.fromHex((1&r?"03":"02")+qt(u)),l=Lt.BASE.multiplyAndAddUnsafe(h,a,c);if(!l)throw new Error("Cannot recover signature: point at infinify");return l.assertValidity(),l}toRawBytes(t=!1){return Vt(this.toHex(t))}toHex(t=!1){const e=qt(this.x);return t?`${this.hasEvenY()?"02":"03"}${e}`:`04${e}${qt(this.y)}`}toHexX(){return this.toHex(!0).slice(2)}toRawX(){return this.toRawBytes(!0).slice(1)}assertValidity(){const t="Point is not on elliptic curve",{x:e,y:r}=this;if(!re(e)||!re(r))throw new Error(t);const n=Xt(r*r);if(Xt(n-Ot(e))!==Bt)throw new Error(t)}equals(t){return this.x===t.x&&this.y===t.y}negate(){return new Lt(this.x,Xt(-this.y))}double(){return Tt.fromAffine(this).double().toAffine()}add(t){return Tt.fromAffine(this).add(Tt.fromAffine(t)).toAffine()}subtract(t){return this.add(t.negate())}multiply(t){return Tt.fromAffine(this).multiply(t,this).toAffine()}multiplyAndAddUnsafe(t,e,r){const n=Tt.fromAffine(this),i=e===Bt||e===Pt||this!==Lt.BASE?n.multiplyUnsafe(e):n.multiply(e),o=Tt.fromAffine(t).multiplyUnsafe(r),s=i.add(o);return s.equals(Tt.ZERO)?void 0:s.toAffine()}}function $t(t){return Number.parseInt(t[0],16)>=8?"00"+t:t}function Ft(t){if(t.length<2||2!==t[0])throw new Error(`Invalid signature integer tag: ${zt(t)}`);const e=t[1],r=t.subarray(2,e+2);if(!e||r.length!==e)throw new Error("Invalid signature integer: wrong length");if(0===r[0]&&r[1]<=127)throw new Error("Invalid signature integer: trailing length");return{data:Jt(r),left:t.subarray(e+2)}}Lt.BASE=new Lt(_t.Gx,_t.Gy),Lt.ZERO=new Lt(Bt,Bt);class Gt{constructor(t,e){this.r=t,this.s=e,this.assertValidity()}static fromCompact(t){const e=t instanceof Uint8Array,r="Signature.fromCompact";if("string"!=typeof t&&!e)throw new TypeError(`${r}: Expected string or Uint8Array`);const n=e?zt(t):t;if(128!==n.length)throw new Error(`${r}: Expected 64-byte hex`);return new Gt(Zt(n.slice(0,64)),Zt(n.slice(64,128)))}static fromDER(t){const e=t instanceof Uint8Array;if("string"!=typeof t&&!e)throw new TypeError("Signature.fromDER: Expected string or Uint8Array");const{r:r,s:n}=function(t){if(t.length<2||48!=t[0])throw new Error(`Invalid signature tag: ${zt(t)}`);if(t[1]!==t.length-2)throw new Error("Invalid signature: incorrect length");const{data:e,left:r}=Ft(t.subarray(2)),{data:n,left:i}=Ft(r);if(i.length)throw new Error(`Invalid signature: left bytes after parsing: ${zt(i)}`);return{r:e,s:n}}(e?t:Vt(t));return new Gt(r,n)}static fromHex(t){return this.fromDER(t)}assertValidity(){const{r:t,s:e}=this;if(!ee(t))throw new Error("Invalid Signature: r must be 0 < r < n");if(!ee(e))throw new Error("Invalid Signature: s must be 0 < s < n")}hasHighS(){return this.s>_t.n>>Pt}normalizeS(){return this.hasHighS()?new Gt(this.r,Xt(-this.s,_t.n)):this}toDERRawBytes(){return Vt(this.toDERHex())}toDERHex(){const t=$t(Wt(this.s)),e=$t(Wt(this.r)),r=t.length/2,n=e.length/2,i=Wt(r),o=Wt(n);return`30${Wt(n+r+4)}02${o}${e}02${i}${t}`}toRawBytes(){return this.toDERRawBytes()}toHex(){return this.toDERHex()}toCompactRawBytes(){return Vt(this.toCompactHex())}toCompactHex(){return qt(this.r)+qt(this.s)}}const Ht=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function zt(t){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");let e="";for(let r=0;r<t.length;r++)e+=Ht[t[r]];return e}const Dt=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000");function qt(t){if("bigint"!=typeof t)throw new Error("Expected bigint");if(!(Bt<=t&&t<Dt))throw new Error("Expected number 0 <= n < 2^256");return t.toString(16).padStart(64,"0")}function Wt(t){const e=t.toString(16);return 1&e.length?`0${e}`:e}function Zt(t){if("string"!=typeof t)throw new TypeError("hexToNumber: expected string, got "+typeof t);return BigInt(`0x${t}`)}function Vt(t){if("string"!=typeof t)throw new TypeError("hexToBytes: expected string, got "+typeof t);if(t.length%2)throw new Error("hexToBytes: received invalid unpadded hex"+t.length);const e=new Uint8Array(t.length/2);for(let r=0;r<e.length;r++){const n=2*r,i=t.slice(n,n+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");e[r]=o}return e}function Jt(t){return Zt(zt(t))}function Kt(t){return t instanceof Uint8Array?Uint8Array.from(t):Vt(t)}function Yt(t){if("number"==typeof t&&Number.isSafeInteger(t)&&t>0)return BigInt(t);if("bigint"==typeof t&&ee(t))return t;throw new TypeError("Expected valid private scalar: 0 < scalar < curve.n")}function Xt(t,e=_t.P){const r=t%e;return r>=Bt?r:e+r}function Qt(t,e){const{P:r}=_t;let n=t;for(;e-- >Bt;)n*=n,n%=r;return n}function te(t,e=_t.P){if(t===Bt||e<=Bt)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=Xt(t,e),n=e,i=Bt,o=Pt;for(;r!==Bt;){const t=n%r,e=i-o*(n/r);n=r,r=t,i=o,o=e}if(n!==Pt)throw new Error("invert: does not exist");return Xt(i,e)}function ee(t){return Bt<t&&t<_t.n}function re(t){return Bt<t&&t<_t.P}function ne(t){return t=pt(t).slice(2),"0x"+Lt.fromPrivateKey(t).toHex()}function ie(t){var e;return e="string"==typeof t?Buffer.from(t.replace(/^0x/,""),"hex"):Buffer.from(t),"0x"+new I.Keccak(256).update(e).digest("hex")}function oe(t){return new Uint8Array(Buffer.from(t))}Lt.BASE._setWindowSize(8);var se=new RegExp("^bytes([0-9]+)$"),ue=new RegExp("^(u?int)([0-9]*)$"),fe=new RegExp("^(.*)\\[([0-9]*)\\]$");function ae(t,r,n){switch(t){case"address":return n?ct(r,32):ft(r);case"string":return e.Buffer.from(r);case"bytes":return ft(r);case"bool":return r=r?"0x01":"0x00",n?ct(r,32):ft(r)}var i=t.match(ue);if(i){var o=parseInt(i[2]||"256");return(i[2]&&String(o)!==i[2]||o%8!=0||0===o||o>256)&&nt.throwArgumentError("invalid number type","type",t),n&&(o=256),ct(pt(r=H(r).toTwos(o).toNumber()),o/8)}if(i=t.match(se)){var s=parseInt(i[1]);return(String(s)!==i[1]||0===s||s>32)&&nt.throwArgumentError("invalid bytes type","type",t),ft(r).byteLength!==s&&nt.throwArgumentError("invalid value for "+t,"value",r),n?ft((r+q).substring(0,66)):r}if((i=t.match(fe))&&Array.isArray(r)){var u=i[1];parseInt(i[2]||String(r.length))!=r.length&&nt.throwArgumentError("invalid array length for "+t,"value",r);var f=[];return r.forEach(function(t){f.push(ae(u,t,!0))}),at(f)}return nt.throwArgumentError("invalid type","type",t)}function ce(t,e){t.length!=e.length&&nt.throwArgumentError("wrong number of values; expected ${ types.length }","values",e);var r=[];return t.forEach(function(t,n){r.push(ae(t,e[n]))}),pt(at(r))}t.AlchemyProvider=xt,t.BaseContract=K,t.Contract=Y,t.FallthroughProvider=At,t.JsonRpcProvider=Et,t.TinyBig=G,t.arrayify=ft,t.computeAddress=function(t){return t.startsWith("0x04")||t.startsWith("0x03")||t.startsWith("0x02")||(t=ne(t)),D(gt(ie(gt(t,1)),12))},t.computePublicKey=ne,t.concat=at,t.etherToGwei=function(t){z(t,["string","number","object"]);var e=H(t).times("1000000000");return H(e)},t.etherToWei=function(t){z(t,["string","number","object"]);var e=H(t).times("1000000000000000000");return H(e)},t.gweiToEther=function(t){z(t,["string","number","object"]);var e=H(t).div("1000000000");return H(e)},t.hashMessage=function(t){return"string"==typeof t&&(t=oe(t)),ie(at([oe("Ethereum Signed Message:\n"),oe(String(t.length)),t]))},t.hexConcat=function(t){var e="0x";return t.forEach(function(t){e+=pt(t).substring(2)}),e},t.hexDataLength=function(t){if("string"!=typeof t)t=pt(t);else if(!ht(t)||t.length%2)return null;return(t.length-2)/2},t.hexDataSlice=gt,t.hexStripZeros=dt,t.hexValue=function(t){var e=dt(pt(t,{hexPad:"left"}));return"0x"===e?"0x0":e},t.hexZeroPad=yt,t.hexlify=pt,t.isAddress=function(t){z(t,["string"]);try{return D(t),!0}catch(t){return!1}},t.isBytes=ut,t.isBytesLike=ot,t.isHexString=ht,t.jsonRpcProvider=function(t){return new Et(t)},t.keccak256=ie,t.pack=ce,t.solidityKeccak256=function(t,e){return ie(ce(t,e))},t.splitSignature=function(t){var e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(ot(t)){var r=ft(t);64===r.length?(e.v=27+(r[32]>>7),r[32]&=127,e.r=pt(r.slice(0,32)),e.s=pt(r.slice(32,64))):65===r.length?(e.r=pt(r.slice(0,32)),e.s=pt(r.slice(32,64)),e.v=r[64]):nt.throwArgumentError("invalid signature string","signature",t),e.v<27&&(0===e.v||1===e.v?e.v+=27:nt.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=pt(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,null!=e._vs){var n=ct(ft(e._vs),32);e._vs=pt(n);var i=n[0]>=128?1:0;null==e.recoveryParam?e.recoveryParam=i:e.recoveryParam!==i&&nt.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),n[0]&=127;var o=pt(n);null==e.s?e.s=o:e.s!==o&&nt.throwArgumentError("signature v mismatch _vs","signature",t)}null==e.recoveryParam?null==e.v?nt.throwArgumentError("signature missing v and recoveryParam","signature",t):e.recoveryParam=0===e.v||1===e.v?e.v:1-e.v%2:null==e.v?e.v=27+e.recoveryParam:e.recoveryParam!==(0===e.v||1===e.v?e.v:1-e.v%2)&&nt.throwArgumentError("signature recoveryParam mismatch v","signature",t),null!=e.r&&ht(e.r)?e.r=yt(e.r,32):nt.throwArgumentError("signature missing or invalid r","signature",t),null!=e.s&&ht(e.s)?e.s=yt(e.s,32):nt.throwArgumentError("signature missing or invalid s","signature",t);var s=ft(e.s);s[0]>=128&&nt.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(s[0]|=128);var u=pt(s);e._vs&&(ht(e._vs)||nt.throwArgumentError("signature invalid _vs","signature",t),e._vs=yt(e._vs,32)),null==e._vs?e._vs=u:e._vs!==u&&nt.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e},t.stripZeros=function(t){var e=ft(t);if(0===e.length)return e;for(var r=0;r<e.length&&0===e[r];)r++;return r&&(e=e.slice(r)),e},t.tinyBig=H,t.toChecksumAddress=D,t.toUtf8Bytes=oe,t.weiToEther=function(t){z(t,["string","number","object"]);try{var e=t;"string"==typeof t&&"0x"===t.slice(0,2)&&(e=BigInt(t).toString());var r=H(e).div("1000000000000000000");return H(r)}catch(t){throw t}},t.zeroPad=ct});
2
- //# sourceMappingURL=index.umd.js.map